You have just purchased a small company called Company X. Company X has N employees, and everyone is either an engineer or a manager. You know for sure that there are more engineers than managers at the company.
Everyone at Company X knows everyone else's position, and you are able to ask any employee about the position of any other employee. For example, you could approach employee A and ask "Is employee B an engineer or a manager?" You can only direct your question to one employee at a time, and can only ask about one other employee at a time. You're allowed to ask the same employee multiple questions if you want.
Your goal is to find at least one engineer to solve a huge problem that has just hit the company's factory. The problem is so urgent that you only have time to ask N-1 total questions.
The major problem with questioning the employees, however, is that while the engineers will always tell you the truth about other employees' roles, the managers may lie to you if they like. You can assume that the managers will do their best to confuse you.
How can you find at least one engineer by asking at most N-1 questions?
You can find at least one engineer using the following process:
Put all of the employees in a conference room. If there happen to be an even number of employees, pick one at random and send him home for the day so that we start with an odd number of employees. Note that there will still be more engineers than managers after we send this employee home.
Then call them out one at a time in any order. You will be forming them into a line as follows:
If there is nobody currently in the line, put the employee you just called out in the line.
Otherwise, if there is anybody in the line, then we do the following. Let's call the employee currently at the front of the line Employee_Front, and call the employee who we just called out of the conference room Employee_Next.
So ask Employee_Front if Employee_Next is a manager or an engineer.
If Employee_Front says "manager", then send both Employee_Front and Employee_Next home for the day.
However, if Employee_Front says "engineer", then put Employee_Next at the front of the line.
Keep doing this until you've called everyone out of the conference room. Notice that at this point, you'll have asked N-1 or less questions (you asked at most one question each time you called an employee out except for the first employee, when you didn't ask a question, so that's at most N-1 questions).
When you're done calling everyone out of the conference room, the person at the front of the line is an engineer. So you've found your engineer!
But the real question: how does this work?
We can prove this works by showing a few things.
First, let's show that if there are any engineers in the line, then they must be in front of any managers.
We'll show this with a proof by contradiction. Assume that there is a manager in front of an engineer somewhere in the line. Then it must have been the case that at some point, that engineer was Employee_Front and that manager was Employee_Next. But then Employee_Front would have said "manager" (since he is an engineer and always tells the truth), and we would have sent them both home. This contradicts their being in the line at all, and thus we know that there can never be a manager in front of an engineer in the line.
So now we know that after the process is done, if there are any engineers in the line, then they will be at the front of the line. That means that all we have to prove now is that there will be at least one engineer in the line at the end of the process, and we'll know that there will be an engineer at the front.
So let's show that there will be at least one engineer in the line. To see why, consider what happens when we ask Employee_Front about Employee_Next, and Employee_Front says "manager". We know for sure that in this case, Employee_Front and Employee_Next are not both engineers, because if this were the case, then Employee_Front would have definitely says "engineer". Put another way, at least one of Employee_Front and Employee_Next is a manager. So by sending them both home, we know we are sending home at least one manager, and thus, we are keeping the balance in the remaining employees that there are more engineers than managers.
Thus, once the process is over, there will be more engineers than managers in the line (this is also sufficient to show that there will be at least one person in the line once the process is over). And so, there must be at least one engineer in the line.
Put altogether, we proved that at the end of the process, there will be at least one engineer in the line and that any engineers in the line must be in front of any managers, and so we know that the person at the front of the line will be an engineer.
A man was to be sentenced, and the judge told him, "You may make a statement. If it is true, I'll sentence you to four years in prison. If it is false, I'll sentence you to six years in prison." After the man made his statement, the judge decided to let him go free.What did the man say?
He said, "You'll sentence me to six years in prison." If it was true, then the judge would have to make it false by sentencing him to four years. If it was false, then he would have to give him six years, which would make it true. Rather than contradict his own word, the judge set the man free.
Jack and Joe were on vacation and driving along a deserted country road from the town of Kaysville to the town of Lynnsville. They came to a multiple fork in the road. The sign post had been knocked down and they were faced with choosing one of five different directions. Since they had left their map at the last gas station and there was no one around to ask, how could Jack and Joe find their way to Lynnsville?
They need to stand the signpost up so that the arm reading Kaysville points in the direction of Kaysville, the town they had just come from. With one arm pointing the correct way, the other arms will also point in the right directions.
Once upon a time, in the West Lake village, a servant lived with his master. After service of about 30 years, his master became ill and was going to die.
One day, the master called his servant and asked him for a wish. It could be any wish but just one. The master gave him one day to think about it. The servant became very happy and went to his mother for discussion about the wish. His mother was blind and she asked her son for making a wish for her eye-sight to come back. Then the servant went to his wife. She became very excited and asked for a son as they were childless for many years. After that, the servant went to his father who wanted to be rich and so he asked his son to wish for a lot of money. The next day he went to his master and made one wish through which all the three (mother, father, wife) got what they wanted. You have to tell what the servant asked the master.
The servant said, "My mother wants to see her grandson swinging on a swing of gold."
Shadow drove into the Speedy Service Station and pulled up to the pumps. "Fill it up, please," said Shadow. "
This may sound strange," said the owner, "but I'd rather fill two cars from out of town than one car from this town."
Shadow looked across the small town and replied, "I know just what you mean."
Why would the owner feel this way?
The owner would rather fill two cars from anywhere than one car from town because he would make twice the amount of money.
Jake and his friend Paco had very famous challenge sessions at their school. One would suggest something they could do, and the other would prove it wrong somehow.
One day, Jake surprised Paco by stating: "I can answer any question in the world."
Sure that he would win the challenge, Paco accepted the task of proving it wrong. He wrote up a test full of impossible questions. After a while, Jake returned the test. Paco unbelievably lost the challenge and told Jake he could indeed answer any question. How did Jake win?
For all the impossible questions, Jake simply wrote "I don't know".
One day, Emperor Akbar posed a question to Birbal. He asked him what Birbal would choose if he offered either justice or a gold coin.
"The gold coin," said Birbal without hesitation.
On hearing this, Akbar was taken aback. "You would prefer a gold coin to justice?" he asked, not believing his own ears.
"Yes," said Birbal.
The other courtiers were amazed by Birbal's display of idiocy. They were full of glee that Birbal had finally managed himself to do what these courtiers had not been able to do for a long time - discredit Birbal in the emperor's eyes!
"I would have been disappointed if this was the choice made even by my lowliest of servants," continued the emperor. "But coming from you it's not only disappointing, but shocking and sad. I did not know you were so debased!"
How did Birbal justify his answer to the enraged and hurt Emperor?
"One asks for what one does not have, Your Majesty." said Birbal, smiling gently and in quiet tones.
"Under Your Majesty´s rule, justice is available to everybody. But I am a spendthrift and always short of money and therefore I said I would choose the gold coin."
The answer immensely pleased the emperor and respect for Birbal was once again restored in the emperor's eyes.
"Welcome back to the show. Before the break, Mr Ixolite here made it to our grand finale! How do you feel Mr.Ix?"
"Okay, now to win the star prize of one million pounds all you have to do is answer the following question in 90 seconds."
"Okay, I'm ready."
"Right. In 90 seconds name 100 words that do NOT contain the letter 'A'. Start the clock!"
Can you help?
One, two, three, four, five...one hundred! I just counted from 1 to 100 in ninety seconds (it is possible).
Two convicts are locked in a cell. There is an unbarred window high up in the cell. No matter if they stand on the bed or one on top of the other they can't reach the window to escape. They then decide to tunnel out. However, they give up with the tunnelling because it will take too long. Finally one of the convicts figures out how to escape from the cell. What is his plan?
His plan is to dig the tunnel and pile up the dirt to climb up to the window to escape.