Thread: Riddle Thread

  1. #16
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Riddle #3: three dwarfs, two paths, one life

    In my circle of friends, this one is well-known by now, but maybe you haven't heard of it already:

    You walk along a path until you reach a crotch. One way leads to your destination, the other to sudden death, but you don't know which one is right. Fortunately, there is a house with three dwarfs. One always tells the truth (A), one always lies (B), and one sometimes tells the truth and sometimes lies (C).

    How do you find out the right path with only two questions?

    Greets,
    Philip
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  2. #17
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    Riddle #3: three dwarfs, two paths, one life

    I only knew this one without C and only one question. But it's still fairly similar .
    Last edited by CornedBee; 03-28-2009 at 11:37 AM.

  3. #18
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    Riddle #2: one night in the UAE

    My question is why was this on a "systems architecture" exam...it seems quite tangential to the material that should be taught in a systems architecture class.
    Last edited by CornedBee; 03-28-2009 at 11:38 AM.
    My Website

    "Circular logic is good because it is."

  4. #19
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    Riddle #3: three dwarfs, two paths, one life

    Actually, I thought about it... I was used to saying, as answer "Which direction would the other say I'd have to go". But I think this one is possible with one question:
    - Which way would the one of you that always speaks the truth say you would say I'd have to go?

    The one who always speaks the truth would speak the truth about the way and point the proper direction.
    The one who always lies knows the one who would speak the truth would tell he'd say the wrong direction. But he lies about that fact, so he points to the proper direction.
    The one who sometimes speaks the truth is undecided.

    So two always point to the proper way.
    Last edited by CornedBee; 03-28-2009 at 11:38 AM.

  5. #20
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717

    Riddle #3: three dwarfs, two paths, one life

    I'd just choose which direction to take myself, and then hope I took the right one, that way I don't have to go through the hassle with the dwarves
    Last edited by CornedBee; 03-28-2009 at 11:38 AM.
    Currently research OpenGL

  6. #21
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Riddle #2: one night in the UAE

    Quote Originally Posted by DavidP View Post
    My question is why was this on a "systems architecture" exam...it seems quite tangential to the material that should be taught in a systems architecture class.
    Because back then, our prof told us all questions from the exam in advance, except this one. He didn't want to give 100% of the points to someone who merely learned everything by heart.

    BTW, the number of people that managed to pass the exam was below 50%. My prof's theory was that everyone who learns the stuff will pass anyway, and everyone else won't learn enough even if they know exactly what to learn. He was proven right: the overall result was comparable to his other exams.

    Greets,
    Philip
    Last edited by CornedBee; 03-28-2009 at 11:39 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  7. #22
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717

    Number theory in 21 minutes

    Damn... My argument to why I don't understand any of this is... I haven't finished school xP Now make the algorithm for randomness for me >: D
    Last edited by CornedBee; 03-28-2009 at 11:39 AM.
    Currently research OpenGL

  8. #23
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,195

    Number theory in 21 minutes

    Well that makes for an interesting optimization for large prime number searches. I wonder what percentage of workload it would reduce to first check that a number met that particular criteria.
    Last edited by CornedBee; 03-28-2009 at 11:39 AM.

  9. #24
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Riddle #3: three dwarfs, two paths, one life

    Quote Originally Posted by EVOEx View Post
    Which way would the one of you that always speaks the truth say you would say I'd have to go?

    The one who always speaks the truth would speak the truth about the way and point the proper direction.
    The one who always lies knows the one who would speak the truth would tell he'd say the wrong direction. But he lies about that fact, so he points to the proper direction.
    The one who sometimes speaks the truth is undecided.

    So two always point to the proper way.
    Right. Now you have one question left to determine who's (C), or who's not.

    This is the interesting part. Without (C), my grandma would solve this riddle in no time :P

    Greets,
    Philip
    Last edited by CornedBee; 03-28-2009 at 11:40 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  10. #25
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    Riddle #3: three dwarfs, two paths, one life

    I guess that would work...

    I would have just used sequential Bayes

    (I.E. ask two dwarfs which is the right path and use sequential Bayes to calculate the probability of each being the actual correct one)
    Last edited by CornedBee; 03-28-2009 at 11:40 AM.
    My Website

    "Circular logic is good because it is."

  11. #26
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    Riddle #3: three dwarfs, two paths, one life

    Why? Only one person will answer? :P I thought just ask all three of them at the same time. It's really just one question... And if all three of them answer, you're done.
    Last edited by CornedBee; 03-28-2009 at 11:40 AM.

  12. #27
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Number theory in 21 minutes

    Quote Originally Posted by abachler View Post
    Well that makes for an interesting optimization for large prime number searches. I wonder what percentage of workload it would reduce to first check that a number met that particular criteria.
    A number is dividable by 2 and 3 if it is dividable by 24, so checking if 2 or 3 divides a given number is probably much faster (and tells you more about the number).

    Greets,
    Philip
    Last edited by CornedBee; 03-28-2009 at 11:40 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  13. #28
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Riddle #3: three dwarfs, two paths, one life

    Quote Originally Posted by EVOEx View Post
    Why? Only one person will answer? :P I thought just ask all three of them at the same time. It's really just one question... And if all three of them answer, you're done.
    I guess there's only one dwarf supposed to answer. But if all three were allowed to answer, what would you ask?

    Greets,
    Philip
    Last edited by CornedBee; 03-28-2009 at 11:40 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

  14. #29
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262

    Riddle #3: three dwarfs, two paths, one life

    Like I said before:
    Which way would the one of you that always speaks the truth say you would say I'd have to go?

    The one who always speaks the truth would speak the truth about the way and point the proper direction.
    The one who always lies knows the one who would speak the truth would tell he'd say the wrong direction. But he lies about that fact, so he points to the proper direction.
    The one who sometimes speaks the truth is undecided.

    So two always point to the proper way.


    If all three answer, two point you to the right way, and the other you don't know... And the riddle doesn't say only one dwarf will answer your question :P.
    Last edited by CornedBee; 03-28-2009 at 11:41 AM.

  15. #30
    Complete Beginner
    Join Date
    Feb 2009
    Posts
    312

    Riddle #3: three dwarfs, two paths, one life

    Well, now you can imagine why nobody will let me do mental arithmetic...

    I hereby establish that only one dwarf is allowed to answer per question.

    Greets from Graz,
    Philip
    Last edited by CornedBee; 03-28-2009 at 11:41 AM.
    All things begin as source code.
    Source code begins with an empty file.
    -- Tao Te Chip

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Thread Synchronization in Win32
    By passionate_guy in forum C Programming
    Replies: 0
    Last Post: 02-06-2006, 05:34 AM
  2. [code] Win32 Thread Object
    By Codeplug in forum Windows Programming
    Replies: 0
    Last Post: 06-03-2005, 03:55 PM
  3. Win32 Thread Object Model Revisted
    By Codeplug in forum Windows Programming
    Replies: 5
    Last Post: 12-15-2004, 08:50 AM
  4. Simple thread object model (my first post)
    By Codeplug in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2004, 11:34 PM
  5. Problem : Threads WILL NOT DIE!!
    By hanhao in forum C++ Programming
    Replies: 2
    Last Post: 04-16-2004, 01:37 PM