Note that there are some explanatory texts on larger screens.

plurals
  1. POOptimal Algorithm
    primarykey
    data
    text
    <p>I have got following problem. On a given mountain a girl is stuck and there are two paths. One path will take her to the rescuer (left turn) and the second one (right turn) will take her to a jungle from where there is no chance to come back. Now she meets a group of people say n who always speak the truth and some people say m may / may not speak the truth. We are given that n is greater than m. So the girl can ask to a random person - which way are the rescuers, the problem is that she doesn't know which one is she asking to (n or m). <strong>I want to know if there is a Big Theta (n + m) algorithm to find how many people are telling the truth? or strictly speaking the value of n?</strong></p> <p>I am able to solve a simpler version of this by myself. Say there only two people, 1 always speaks the truth and other one always lies. She can ask a question for which both of them will give the same answer. For example: to the truth speaker she can ask - "Hey according to the other guy, which way takes to rescuer?". The truth speaker will say - right turn (because the other guy lies). Now she can ask the same question to the liar - he will respond by saying - right turn as well (because the true answer is left turn but since he always lies, he will say right). Now she can walk away to the left knowing it is right answer.</p> <p>The problem is that in the first case - second set of people may / may not lie. But I think the key is that n > m i.e. number of people who always speak the truth are greater than number of people who may/may not speak the truth. So looks like this will cancel out something.</p> <p>Any help will be appreciated. Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload