Home : General : Chit Chat :

## Riddles

##### (Page 1 of 2)
Doh. I thought there was more to it. As in

Why do programmers get halloween and christmas mixed up?

Because

Because OCT(31) = DEC(25)

OCT(31) = Octal 31 = 3 * 8 + 1 = 25
DEC(25) = Decimal 25 = 2 * 10 + 1 = 25

#### Last edited by:

Aki: Aug 23, 2002, 3:47 PM
>>
OCT(31) = DEC(25)
<<

Well for valid perl it would have to be:

print oct (31) == 25 ? 'Yes' : 'No';

OCT/DEC will throw errors as will dec(25)

#### Last edited by:

Paul: Aug 23, 2002, 2:44 PM
Yeah, I don't think that this is specific to perl.
That's quite cute! I was wondering about that, I figured it was something to do with the overflow of bytes. Day % 256.

I saw that first in this riddle collection:

http://www.ocf.berkeley.edu/.../riddles/intro.shtml

#### Last edited by:

Aki: Aug 23, 2002, 3:16 PM
Yeah, I saw that on slashdot too. [I guess that's where you saw it ] I found them quite hard to be honest.
Yep, the same place.

Some of them really are quite tricky... but all the same, some of them are pretty silly eh:

Quote:
q1. scientific studies have shown that there is a direct, positive correlation between foot size and performance in spelling bees / spelling tests. why?

q2. What gets wetter the more it dries?

I haven't had much time to spend on them. Have them bookmarked if down time should ever appear
>>
What gets wetter the more it dries?
<<

A towel
That's terrible.
Haha, wait till you hear the answer to q1.

The positive correlation is due to babies having small feet and little verbal skills and adults having big feet and somewhat better spelling skills (though that's debatable sometimes )
Wow. That's even worse.
_________________________
Just mildly harder but a bit more interesting...

q: Using only a 5-gallon bucket and a 3-gallon bucket, put exactly four gallons of water in the 5-gallon bucket. (Assume you have an infinite supply of water. No measurement markings on the buckets.)
Fill the 5 gallon bucket. Pour it into the 3 gallon bucket until the 3 gallon one is full. Dump the water in the 3 gallon bucket. Pour the remaining water from the 5 gallon bucket (2 gallons) into the 3 gallon bucket. Fill the 5 gallon bucket again. Pour into the 3 gallon bucket until it is full. The 5 gallon bucket now contains 4 gallons.
_________________________
Actually, one that I'm not sure what the proper answer is the one that says:

Two people stand at the parting of a Y fork. One is a compulsive liar, the other will only say the truth. You are trying to reach the city at the end of one of these forks, you may only ask one question to learn which path is the correct one to take

It's annoying me since I've known the answer before... urgh!
"Were I to ask the other fellow which path is correct, what would he tell me?"

- wil
Remind me what Alex pays you to do again?....are you chief riddler?
Definitely not chief riddler anyways. With the quality of the riddles I've put up, I think I'm going to be fired soon if that was my job title.

Thanks for the solution Wil :)
ugh, but that is assuming that the they both add a phrase similar to ( that person always tells a lie / the truth so they will say "that way." )

I figure since if you don't have that information and if you don't have the information of knowing which person is which their answer would be just as effective as if asking that person.

So, the fork in road question definitely needs the clarification of which person says what.

ugh, baby feet. That sucks. It sucks even more when I realize how my thinking has gotten less and less flexible. ughhh

openoffice + gimp + sketch ...
The solution Wil found will work as long as you know who lies and who doesn't
If correct path is right fork, then:

1. if you ask person A (liar), he'll reply left fork since he knows person B is honest and would reply right. But person A lies so he would say left.

2. if you ask person B (honest), he'll reply left fork since he knows person B liar and would reply left. But person B is honest so he would reply left.

So both reply left. Therefore you always take other path than they both give in agreement.

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Yes, that explanation is correct. A lot of it depends on if the reader parses compulsive as "always".

- wil
>>
<<

If the person telling the truth replies left that he isn't telling the truth is he
Quote:
"Were I to ask the other fellow which path is correct, what would he tell me?"

Nope. The honest person replies honestly that the liar would lie and say left.

----
Cheers,

Dan
Founder and CEO

LionsGate Creative
GoodPassRobot
Magelln
Ok this has gotten too confusing for my little brain now :)
Ok, to continue with the current line of debating:
Sorry, but you need to hear full sentences with the most possible amount of information if not you are all making assumptions.

Now, why are you all assuming that the liar will lie? S/he could be telling truth since s/he might realize that you would assume that s/he would lie. Where would that put you all?

Now let's get back to Aki's question:

Actually, one that I'm not sure what the proper answer is the one that says:

Two people stand at the parting of a Y fork. One is a compulsive liar, the other will only say the truth. You are trying to reach the city at the end of one of these forks, you may only ask one question to learn which path is the correct one to take