This week's book giveaway is in the Performance forum.We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!

Arjun Shastry
Ranch Hand
Posts: 1898
1
I have taken this problem from 'Discrete Mathematics' by C N Liu.
In one country ,all people always lie or always talk truth.These people always answer in the form of 'Yes/No' ONLY.One tourist is visiting this country and saw the inhibitant sitting near a junction.One road goes to capital of the country and another goes to desert.Tourist wants to go to capital.By asking ONLY ONE question,tourist should find the road which goes to capital.
What question should tourist ask to inhibitant?
[ August 11, 2003: Message edited by: Capablanca Kepler ]
[ August 11, 2003: Message edited by: Capablanca Kepler ]

Ranch Hand
Posts: 70
the question will be like
the traveller should take the other road to go to the capital.
Let us take all are telling the truth if we ask the question, his friend should say the correct road to the desert and he also will say the same road to desert. so now we can take the other road to go to the capital.
if all are telling lies and if we ask the question his friend should say the wrong road(road to the capital) and as he is a liar he wont say the same road and say the road to the desert. so now we can take the other road to go to the capital.

Jim Yingst
Wanderer
Sheriff
Posts: 18671
First, what friend? The question only mentioned one person by the road.
Second, even if there are two people present (or maybe you can talk about some other friend even though he's not physically there), why assume that either they're both liars, or both truthful? Maybe one's a liar and the other's truthful. Then your answer won't work.

Arjun Shastry
Ranch Hand
Posts: 1898
1
Originally posted by Jim Yingst:
First, what friend? The question only mentioned one person by the road.
Second, even if there are two people present (or maybe you can talk about some other friend even though he's not physically there), why assume that either they're both liars, or both truthful? Maybe one's a liar and the other's truthful. Then your answer won't work.

Jim,the ALL people are either speak truth or ALL people speak false.People are not divided there.
Karthink was almost right.
[ August 12, 2003: Message edited by: Capablanca Kepler ]

Michael Dunn
Ranch Hand
Posts: 4632

Arjun Shastry
Ranch Hand
Posts: 1898
1
If all people(i.e. me too)truth speaking and if the road to the left goes to capital,my answer will be Yes.If all people(i.e. me too) are liars (and road to left goes to capital)then also my answer will be Yes.So if answer is Yes then tourist can conclude that road to left goes to capital.
On the other hand if all people are truth speaking and road to capital goes to right,then my answer will be No.Whereas if all the people are liars and road to right goes to capital,still my answer be No.So tourist can conlude if answer is No,road to right must be going to capital.
[ August 12, 2003: Message edited by: Capablanca Kepler ]

Jim Yingst
Wanderer
Sheriff
Posts: 18671
Jim,the ALL people are either speak truth or ALL people speak false.People are not divided there.
Really? Well, that's a new version. I couldn't tell that from your initial problem statement. Anyway, I like Michael Dunn's answer, as it works regardless of how other people on the island behave. (Or even if there's no one else on the island.) See also this post, including Joel McNary's version.
[ August 12, 2003: Message edited by: Jim Yingst ]

Vivek Kumar
Greenhorn
Posts: 9
I agree with Jim. The original version suggests that 'any' person on island either always seaks truth or always speak lie. Still, the answer given by karthikeyan is correct.