wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> Dominant Fifth
(Message started by: Nootch on Jul 12th, 2004, 3:03pm)

Title: Dominant Fifth
Post by Nootch on Jul 12th, 2004, 3:03pm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is the puzzle:

   "What's the Dominant Fifth?" asked Dr. Dingo, as his daughter Cicely came in from school.
 
    Cicely blushed. "Just a secret society," she said.  "I'm one of the vice-presidents."
 
    "And you're meeting tonight; is that right?"
   
   "How on earth did you know?" ask Cicely.
 
   "You left this lying about.  That's no way to keep secrets, my girl."  He handed Cicely this paper:

                               Dominant Fifth
          REASM NCNVE OTMLE SEHST TAOEI

   "How did you manage to read it?" asked Cicely.  "The code is known to only about eight of us."
 
    "Change it," said Dingo. "Any fool can read that."

 ~~~~~~~~~~~~~~
 This may be an exaggeration.  But it's not a difficult code.

   Can you decipher it?  
           ~Where and When is the next meeting scheduled?


// thread title renamed by wwu 10:41 PM 8/19/2004

Title: Re: Help me solve this riddle anyone?
Post by towr on Jul 12th, 2004, 3:07pm
Posting it in just one place is plenty.
Posting it on at least four boards (and once in another active thread) on the other hand is highly annoying (so I removed the other ones)..

I haven't broken the code yet though (despite leaving it in easy). But I'm sure it has something to do with the number 5

Title: Re: Help me solve this riddle anyone?
Post by Nootch on Jul 12th, 2004, 3:33pm
I am very sorry for the mulitple posts.  I couldn't quite figure out how to "tell" if they had been posted, being a newbie and all.  In the end, I noted that in fact, my posts had popped up everywhere.  Again, I apologize for the over-abundance of postings.

I have figured out that if you skip every fifth letter, you get the word MEET -- after that, I get a little stumped on where to continue the decipher path.  Should I now go backwards, should i skip a word cluster, etc....  Your help is appreciated.  I usually sleep much easier after the puzzles are solved.  ;)  Thanks again.

Title: Re: Help me solve this riddle anyone?
Post by Three Hands on Jul 12th, 2004, 4:27pm
Well, you got the first 4 letters...

I make it:

[hide]Meet in the classroom at seven[/hide]

Method:[hide]
Take every fifth unused letter from the sequence, looping from the end to the beginning. This would create the following sequence, where every fifth letter is removed from the loop:
REASM NCNVE OTMLE SEHST TAOEI  REASN CNVOT MLSEH STAOE REASC NVOML SESTA OREAS NVOMS ESTOR EANVO MESTO EANVM ESTEA NVEST ENVES ENVEE NVENV ENENE NNNNN

The spaces after each fifth letter highlight which letter is being removed, and you can read the message by taking the last letter of each group of five.
[/hide]

Some credit also to rmsgrey for helping in checking that my theory was correct, and for suggesting the layout for the method explanation.

Title: Re: Help me solve this riddle anyone?
Post by Sir Col on Jul 12th, 2004, 4:44pm
RERDN HEWHI KAEOC SNT

::[hide]Alternatively you can just cross off a letter after it has been used.[/hide]::

It is quite challenging trying to encode a message. Can you work out how to do it?

Title: Re: Help me solve this riddle anyone?
Post by Three Hands on Jul 12th, 2004, 5:14pm
AOIST YNRUH LCKO ;D

Can't think of an easier way of encoding off the top of my head than create a line of x's equal to the number of letters you're encoding, and then replace every fifth x you come to with a letter to spell out the message - at least, that's how I did my little bit of work...

Presumably there is some clever trick to doing it, but I just can't think of it...

Title: Re: Help me solve this riddle anyone?
Post by towr on Jul 13th, 2004, 1:12am
It should be easy enough to program (and for other bases than 5 as well)

Title: Re: Help me solve this riddle anyone?
Post by Speaker on Jul 13th, 2004, 1:17am
I do not know how to program, but Sir Col's idea of finding an easy way to encode is interesting.
I have been trying to work out a way to do it by writing in a triangle, or a circle, or a square. Then straightening out the shape into a mixed up line.

But, no luck.   ???

I tried to write an equation, but I do that worse than programming.  :'(  :'(

Title: Re: Help me solve this riddle anyone?
Post by towr on Jul 13th, 2004, 2:33am
lcr/tPH SwrsrMe upw/ipr i.et:oe HgpGha' n~/rtps /o.Ei/m :.fPtoy /nhaw.v Aocdste ow_r (http://www.ai.rug.nl/~towr/PHP/GAMES/rot_code.php)

http://www.ocf.berkeley.edu/~wwu/YaBBImages/grin.gif

Title: Re: Help me solve this riddle anyone?
Post by Sir Col on Jul 13th, 2004, 3:01am
Very neat, towr, but...

ctxw naio rpru hygl elrd atoy a?oo moiu eul

Title: Re: Help me solve this riddle anyone?
Post by towr on Jul 13th, 2004, 3:07am
Well, for encoding I just used the method Three Hands mentioned (starting with a blank line and replacing each nth blank character with the next character in the string), and for decoding also the obvious one (removing each nth letter and counting to the next )

Title: Re: Help me solve this riddle anyone?
Post by towr on Jul 13th, 2004, 3:21am
You can make all sorts of devious variation on the encoding:

nied__C t_es?ca duoohy

b)so?dobwengH htuheuaysSuh; otioael

olewstoorctrc ekeasOtproceu a,odsewnagrfe f.uir.vhnebnd nd.Tb

Title: Re: Help me solve this riddle anyone?
Post by Barukh on Jul 13th, 2004, 4:05am
The problem of encoding is equivalent to the well known Josephus Problem (http://mathworld.wolfram.com/JosephusProblem.html): to encode is to put the prisoners in order of their execution.

It seems (http://citeseer.ist.psu.edu/cache/papers/cs/10412/http:zSzzSzpersonal-homepages.mis.mpg.dezSzbuhlerzSzjosephuszSzfinaljosephus.pdf/the-josephus-problem.pdf) (read the introduction) no explicit formula exists for the position of a certain symbol in the encoded sequence.

Title: Re: Dominant Fifth
Post by TINY on Aug 27th, 2004, 5:06am
MEET IN THE CLASSROOM AT SEVEN

Title: Re: Dominant Fifth
Post by Guest on Dec 3rd, 2004, 9:43pm
I still don't get it. Could you explain please?

Title: Re: Dominant Fifth
Post by Guest on Dec 3rd, 2004, 9:46pm
Whoops, I didn't see the other posts. Never mind.

Title: Re: Dominant Fifth
Post by jbcrowley on Jan 16th, 2013, 12:33pm
I've been trying to find a general equation for this problem.

To try to figure it out, I used the string ABCDEF...Y which has 25 letters (same as the original).  I encoded the string manually and then put together a table that contained the original index and the encoded index and tried to come up with a relationship between the two.  I found one that is pretty close but I can't quite get all the indices exactly right.


Code:
Original string A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y
Original index  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Encoded string  J  O  T  Y  A  F  K  P  U  B  G  L  Q  V  C  H  M  R  W  D  I  N  S  X  E

Original string A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y
Encoded pos     5  10 15 20 25 6  11 16 21 1  7  12 17 22 2  8  13 18 23 3  9  14 19 24 4
Calc Formula    5  10 15 20 1  6  11 16 21 2  7  12 17 22 3  8  13 18 23 4  9  14 19 24 5


Original string - the unencoded "message", A..Y
Original index - the index of each letter in the original message starting with 1
Encoded string - the original string after encoding
Encoded position - the index of the character in the encoded string, A is in position 5, B is in position 10, etc.
Calc formula - I used 5*mod(n,5)+floor(n/5) where n is the original index to calculate these values.

You can see that they all are correct except for every 5th index.  It's always off by -1.  I was hoping that if I posted this, someone else could see the key that I'm missing.

BTW, I wanted to put this in an html table but the bb didn't like it... it kept inserting spaces in places that broke the html table code, etc.

Title: Re: Dominant Fifth
Post by towr on Jan 16th, 2013, 1:06pm
Use ceil(n/5-1) instead of floor(n/5). Which is the same except for multiples of 5 where it's one less, exactly as you want.

Title: Re: Dominant Fifth
Post by jbcrowley on Jan 17th, 2013, 6:19am

on 01/16/13 at 13:06:59, towr wrote:
Use ceil(n/5-1) instead of floor(n/5). Which is the same except for multiples of 5 where it's one less, exactly as you want.


5*mod(n,5)+ceil(n/5-1) is very close but for n = 5 it gives 0 instead of 25.

5 10 15 20 0 6 11 16 21 1 7 12 17 22 2 8 13 18 23 3 9 14 19 24 4

Title: Re: Dominant Fifth
Post by SMQ on Jan 17th, 2013, 8:32am

on 01/17/13 at 06:19:48, jbcrowley wrote:
5*mod(n,5)+ceil(n/5-1) is very close but for n = 5 it gives 0 instead of 25.


That's because mod is zero-based and you're using one-based indexes.  You can fix it by wrapping the whole thing in another mod which essentially replaces 0 with 25:

mod(5*mod(n, 5) + ceil(n/5 - 1) - 1, 25) + 1

but that's starting to get fairly inelegant, and I'm not sure how well it can generalize to lengths that aren't multiples of 5...

--SMQ



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board