Hey that's pretty cool, though. Nice one.

Printable View

- 03-26-2009Sebastiani
Hey that's pretty cool, though. Nice one.

- 03-26-2009CornedBeeRiddle #3: three dwarfs, two paths, one life
Giant In the Playground Games

That's all I'll say. :) - 03-26-2009PerspectiveRiddle #3: three dwarfs, two paths, one life
There's a whole book of these problem called Knights and Knaves, something like this:

Knights and Knaves: Knights and Knaves Logic Puzzle

Knights always tell the truth and Knaves always lie. There was a second book about Humans and Vampires. Humans always tell the truth, vampires always lie, insane humans think they are telling the truth but lie, and insane vampires think they are lying but always tell the truth. Then there's a bunch of riddles of this sort.

If you like this, also check out The Puzzling Adventures of Dr. Ecco - 03-27-2009abachlerNumber theory in 21 minutes
Its faster to just check if a number, modulo 6469693230 has a prime remainder, since all prime numbers do.

- 03-27-2009TontoNumber theory in 21 minutes
The greatest common factor explanation of this is great

- 03-27-2009SebastianiNumber theory in 21 minutes
>> Its faster to just check if a number, modulo 6469693230 has a prime remainder, since all prime numbers do.

Are you sure about that? Can you elaborate? - 03-27-2009SnafuistRiddle #3: three dwarfs, two paths, one life
Ok, just to bring this to an end:

First, you ask a random dwarf: "Who of your brothers lies more often?"

If you happen to ask A, he will correctly point to C.

If you happen to ask B, he will incorrectly point to C.

If you happen to ask C, he will randomly point to either A or B.

In either case, the dwarf*not*asked and*not*pointed to is*not*C.

Ask this dwarf the following question: "Which path would the dwarf suggest who is the exact opposite of you?"

If you ask A, he will tell the truth and provide you with the path that B would've suggested, i.e. the wrong path.

If you ask B, he will lie and provide you with the path that A would'nt have suggested, i.e. the wrong path.

So you take the other path.

Greets,

Philip - 03-27-2009laserlightRiddle #3: three dwarfs, two paths, one life
hmm... but that seems to assume that the dwarves are benevolent. If they are (or more accurately, could be) malicious, then you have to phrase that second question more explicitly to your advantage.

- 03-27-2009SnafuistRiddle #5: more dwarfs
There are seven dwarfs, each one wearing a unique hat. A wind blows off the hats. The dwarfs start running after their hats and each dwarf puts on the first hat that he manages to catch. Eventually every dwarf has a hat again.

What is the probability that exactly six dwarfs are wearing their own hat now?

Greets,

Philip - 03-27-2009SnafuistRiddle #3: three dwarfs, two paths, one life
Right. I already had several discussions about that. The problem arises due to the inexactness of most natural languages. The most obvious solution is to ask a more concise (and more awful) question. Personally, I prefer adding the proposition to the riddle that the dwarfs are benevolent. I didn't do it in the first place because it only distracts from the intended solution, but it's good that you pointed it out.

Greets,

Philip - 03-27-2009laserlightRiddle #3: three dwarfs, two paths, one lifeQuote:

Originally Posted by**Snafuist**

- 03-27-2009SnafuistRiddle #4: if-statement considered harmful
Oops, I skipped #4, so here it is.

Consider the following program:

Code:`int cmp(int a, int b)`

{

if(a > b) {

return 1;

} else if(a < b) {

return -1;

} else {

return 0;

}

}

Greets,

Philip - 03-27-2009laserlightRiddle #4: if-statement considered harmful
I presume that includes ternary operator, and that this is either C or C++?

- 03-27-2009matspRiddle #4: if-statement considered harmfulCode:
`return (a >b)?1:(a<b)?-1:0;`

Mats - 03-27-2009tabstopRiddle #5: more dwarfs
I would say that equals (6!/(6*5!))-1.