473,473 Members | 1,419 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Truthtellers and Liars

Banfa
9,065 Recognized Expert Moderator Expert
I'm sure you've all heard this one
You come to a T junction, 1 road leads to certain doom in the pit of invalid memory accesses while the other leads to a chocolate mountain (or in mmccarthy's case a Whiskey Lake). There are no sign posts but there are 2 people at the cross roads, one is wearing a red T-shirt and the other is wearing a blue T-shirt.

There is a wooden sign saying, "1 person always tells the truth and the other always lies. But we are not telling you who is who. Meuuuuuuuuu Ha Ha Haaa".

You can not go back the way you came because you are being chased by a BOFH.

You may ask 1 question that can be answered yes or no (you don't know how you know this, the knowledge just appeared in your mind as you took in the scene. Almost as if it was POKEd there).

What question should you ask to find out which path to take?
Like a said well known, in fact it has even appeared in the odd film (Labyrinth), so if that was too easy for you try this one
You come to a another T junction, 1 road leads to even more certain doom in the dungeon of middle managers while the other leads to the oasis of coffee and forgetting about work. There are no sign posts but there are 3 people at the cross roads, one is wearing a red T-shirt, one is wearing a blue T-shirt, and the last one is wearing a Hawkwind T-shirt.

There is a wooden sign saying, "1 person always tells the truth, 1 person always lies and 1 person randomly answers yes or no. But we are not telling you who is who. MEEEEUuuuuuuuu Ha Ha Haaaaaaaaaaaaaa".

You can not go back the way you came because a particularly vicious virus is in the process of erasing that road.

You may ask 2 questions that can be answered yes or no (you know this because floating above the scene is a bright pink flashing neon sign saying so).

What questions should you ask of who to find out which path to take?
May 12 '07 #1
11 4219
subashini Thiyagarajan
218 New Member
HI banfa,

I don't know whether my understanding is correct.

it is very easy

i ll ask truth teller


Is this(left) road leads to cholcolate mountain?


Truth teller answer me yes or no
so i ll go ahead

if two question allowed
i 'll ask lier the same question .if i get different answer with full confirmation i'll go ahead!!

any comments
May 13 '07 #2
Banfa
9,065 Recognized Expert Moderator Expert
HI banfa,

I don't know whether my understanding is correct.

it is very easy

i ll ask truth teller


Is this(left) road leads to cholcolate mountain?


Truth teller answer me yes or no
so i ll go ahead

if two question allowed
i 'll ask lier the same question .if i get different answer with full confirmation i'll go ahead!!

any comments
Yes I have a comment, I have completely written the questions wrong. Your solution works the way I originally wrote the questions but I am about to re-write them to actually be what they should be, then please try again.
May 13 '07 #3
AdrianH
1,251 Recognized Expert Top Contributor
Yes I have a comment, I have completely written the questions wrong. Your solution works the way I originally wrote the questions but I am about to re-write them to actually be what they should be, then please try again.
I know the answer to your first question.

The answer to the second one is not as clear. If I were ask the one in the red "what would the one in the blue say if I asked the one in the Hawkwind, ``does the left path lead to certain doom?''" and that person is not the random one, how will that one react? Will it ask the one in blue to ask the one in Hawkwind? Or will it not answer because it cannot do so without violating it's yes/no ability?


Adrian
May 14 '07 #4
Banfa
9,065 Recognized Expert Moderator Expert
The answer to the second one is not as clear. If I were ask the one in the red "what would the one in the blue say if I asked the one in the Hawkwind, ``does the left path lead to certain doom?''" and that person is not the random one, how will that one react? Will it ask the one in blue to ask the one in Hawkwind? Or will it not answer because it cannot do so without violating it's yes/no ability?
You will always get an answer, if any one of the people in the chain of people involved in your question is the random answerer than the answer you get will be random.
May 14 '07 #5
subashini Thiyagarajan
218 New Member
please repeat the correct question again

i feel this is not to think a lot to answer ........
May 17 '07 #6
Banfa
9,065 Recognized Expert Moderator Expert
please repeat the correct question again

i feel this is not to think a lot to answer ........
I edited the original posts to contain the correct answers.

As a clue I will say that in both questions the people you meet at the T junction already know who each other are and how they will respond.
May 17 '07 #7
Ganon11
3,652 Recognized Expert Specialist
I have a creative answer to the first question;

First step: Randomly punch one of the people. If you have punched the Truthful one, he will inevitably start screaming in pain, saying, "Ow, it hurts!" etc. etc. If you have punched the liar, he will vehemently deny that you hurt him at all. Either way, you will know who the Truthful one is.

Second step: Ask the truthteller which way leads to certain doom, and take the other path.

I'm the winner!
May 17 '07 #8
AdrianH
1,251 Recognized Expert Top Contributor
I have a creative answer to the first question;

First step: Randomly punch one of the people. If you have punched the Truthful one, he will inevitably start screaming in pain, saying, "Ow, it hurts!" etc. etc. If you have punched the liar, he will vehemently deny that you hurt him at all. Either way, you will know who the Truthful one is.

Second step: Ask the truthteller which way leads to certain doom, and take the other path.

I'm the winner!
ROFLMAO. :D


Adrian
May 17 '07 #9
Banfa
9,065 Recognized Expert Moderator Expert
I have a creative answer to the first question;

First step: Randomly punch one of the people. If you have punched the Truthful one, he will inevitably start screaming in pain, saying, "Ow, it hurts!" etc. etc. If you have punched the liar, he will vehemently deny that you hurt him at all. Either way, you will know who the Truthful one is.

Second step: Ask the truthteller which way leads to certain doom, and take the other path.

I'm the winner!
It is typical of a C++ programmer to approach a (fairly) elegant logic problem with brute force :p
May 17 '07 #10
AdrianH
1,251 Recognized Expert Top Contributor
I have a creative answer to the first question;

First step: Randomly punch one of the people. If you have punched the Truthful one, he will inevitably start screaming in pain, saying, "Ow, it hurts!" etc. etc. If you have punched the liar, he will vehemently deny that you hurt him at all. Either way, you will know who the Truthful one is.
Ahhh, but what happens if these are ninja-kung-fu people. Then they'd whip yer ass. :D


Adrian
May 17 '07 #11
tolkienarda
316 Contributor
Answer to question one
Ask: "If i were to ask for the road to wisky lake what direction would the other person point right",
the liar will lie about the way the truth teller will point and then point to the bad place, and the truth teller will also point to the bad place. so of course go the oposite way they both point

eric
May 17 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: PeopleIhavefeeling | last post by:
Real conspiracy theory's script: leaving the key Assalam u'Alekum :), The second night , before the two women came in, Mahmud Kurchu left a key with me, he told me I have to give this key to the...
14
by: Good Man | last post by:
Hi There A client of mine has some banner ads placed on the net. Instead of relying on the sites the ads are posted on tell us how many clicks they are getting, we wanted to track the number...
7
by: Alex | last post by:
I've just noticed that directories in Unix have different sizes whereas in Windows they don't. Why is this so? Thanks. Alex.
0
by: abcd | last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a ljetvedehg, hard slog," mariyu vede legai pressed...
8
by: CaptainDeep | last post by:
Hi all, I have couple of questions about architecting web application using asp.net 1. is ther any performance gain in using c# over vb.net 2. best way to handle transactions in .net? using ado...
17
by: joebenjamin | last post by:
This is a problem I was trying to help a few friends figure out for fun. I am not sure how to go about this, but there is something I am missing here. Here is what we want the output to be: Need...
75
by: Amkcoder | last post by:
http://amkcoder.fileave.com/L_BitWise.zip http://amkcoder.fileave.com/L_ptr2.zip
27
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.