Riddle #782

logicstoryclever

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.
72.14 %
77 votes

Similar riddles

See also best riddles or new riddles.

cleanstoryclever

In classic mythology, there is the story of the Sphinx, a monster with the body of a lion and the upper part of a woman. The Sphinx lay crouched on the top of a rock along the highroad to the city of Thebes, and stopped all travellers passing by, proposing to them a riddle. Those who failed to answer the riddle correctly were killed. This is the riddle the Sphinx asked the travellers: "What animal walks on four legs in the morning, two legs during the day, and three legs in the evening?"
This is part of the story of Oedipus, who replied to the Sphinx, "Man, who in childhood creeps on hands and knees, in manhood walks erect, and in old age with the aid of a staff." Morning, day and night are representative of the stages of life. The Sphinx was so mortified at the solving of her riddle that she cast herself down from the rock and perished.
77.05 %
1161 votes
storyclever

In a far away land, it was known that if you drank poison, the only way to save yourself is to drink a stronger poison, which neutralizes the weaker poison. The king that ruled the land wanted to make sure that he possessed the strongest poison in the kingdom, in order to ensure his survival, in any situation. So the king called the kingdom's pharmacist and the kingdom's treasurer, he gave each a week to make the strongest poison. Then, each would drink the other one's poison, then his own, and the one that will survive, will be the one that had the stronger poison. The pharmacist went straight to work, but the treasurer knew he had no chance, for the pharmacist was much more experienced in this field, so instead, he made up a plan to survive and make sure the pharmacist dies. On the last day the pharmacist suddenly realized that the treasurer would know he had no chance, so he must have a plan. After a little thought, the pharmacist realized what the treasurer's plan must be, and he concocted a counter plan, to make sure he survives and the treasurer dies. When the time came, the king summoned both of them. They drank the poisons as planned, and the treasurer died, the pharmacist survived, and the king didn't get what he wanted. What exactly happened there?
The treasurer's plan was to drink a weak poison prior to the meeting with the king, and then he would drink the pharmacist's strong poison, which would neutralize the weak poison. As his own poison he would bring water, which will have no effect on him, but the pharmacist who would drink the water, and then his poison would surely die. When the pharmacist figured out this plan, he decided to bring water as well. So the treasurer who drank poison earlier, drank the pharmacist's water, then his own water, and died of the poison he drank before. The pharmacist would drink only water, so nothing will happen to him. And because both of them brought the king water, he didn't get a strong poison like he wanted.
76.17 %
187 votes
logicsimpleclever

Pirate Pete had been captured by a Spanish general and sentenced to death by his 50-man firing squad. Pete cringed, as he knew their reputation for being the worst firing squad in the Spanish military. They were such bad shots that they would often all miss their targets and simply maim their victims, leaving them to bleed to death, as the general's tradition was to only allow one shot per man to save on ammunition. The thought of a slow painful death made Pete beg for mercy. "Very well, I have some compassion. You may choose where the men stand when they shoot you and I will add 50 extra men to the squad to ensure someone will at least hit you. Perhaps if they stand closer they will kill you quicker, if you're lucky," snickered the general. "Oh, and just so you don't get any funny ideas, they can't stand more than 20 ft away, they must be facing you, and you must remain tied to the post in the middle of the yard. And to show I'm not totally heartless, if you aren't dead by sundown I'll release you so you can die peacefully outside the compound. I must go now but will return tomorrow and see to it that you are buried in a nice spot, though with 100 men, I doubt there will be much left of you to bury." After giving his instructions the general left. Upon his return the next day, he found that Pete had been set free alive and well. "How could this be?" demanded the general. "It was where Pete had us stand," explained the captain of the squad. Where did Pete tell them to stand?
Pete told them to form a circle around him. All the squad was facing in at Pete, ready to shoot, when they realized that everyone who missed would likely end up shooting another squad member. So no one dared to fire, knowing the risk. Thus at sundown he was released.
76.02 %
167 votes
logiccleversimple

It was a grandeur party. In order to filter the uninvited guests, the security guard was assigned a task to check the secret password. The guests invited by the royal family also were shared with the secret password. John wasn't an invited guest. He learned that the password is needed to make an entry. He hides himself and started watching the guests and the security. The first guest comes. Security told him, TWELVE and the guest replied SIX. He wished him and allowed him to enter. The second guest comes. Security told him SIX and the guest replied THREE! He was too allowed. John made an entry as third guest. Security told him EIGHT and John replied FOUR. He was thrown out of the party! Why?
The answer should be five. The password is not half of the digit, but the number that represents the number of digits told by security.
75.77 %
99 votes
logiccleverstory

Emily was sitting at her study table, home alone, on a cold and stormy night. Her parents had taken a flight earlier in the morning to Australia as her grandmother had passed away. She had wanted to follow her parents but she had an important English examination the next day which she could not miss. The storm was getting heavier by the minute and the wind was howling outside. All this noise made it very hard for her to concentrate. She was on the verge of dozing off when she was shaken alert by a sudden "THUD!" She dismissed it as a window which had been slammed shut by the wind. She tried to concentrate on her books when she heard faint footsteps. Emily got out of her room and looked around when suddenly, without warning, she was grabbed by the neck. She tried to scream but it came out as a mere whimper as the intruder was pressing hard against her throat with his arm. She tried to free herself from his grip but to no avail. "Give me all your money!" growled the man who had grabbed her from behind. "Th-there is none h-here! Please ll-let me go!" cried Emily. "Don't LIE TO ME!" screamed the increasingly agitated man. She felt the man strengthen his grip around her neck. She said nothing and a few seconds passed by in silence. Suddenly the phone rang which alerted both of them. "People will get suspicious if I don't answer the phone," said Emily, with a controlled voice. The intruder let her go. "Alright, but NO funny business, or ELSE!" said the nervous intruder. Emily walked toward the phone. She took a deep breath and calmed herself. She picked up the phone. "Hey Em! How's the revision going?" said the caller. "Hey Anna. Thanks for the call. Hey you know those Science notes I lent you last week? Well I really need them back. It would be a great help to me. It's an emergency, so if you could give me them tomorrow it would be great. Please hurry in finding the notes. I need to get back to my books now. Bye," Emily said. She hung up the phone. "It was wise of you not to say anything," said the intruder, although he was more than a bit confused by her conversation. "Now TELL ME WHERE THE MONEY IS KEPT!" screamed the thief. "It...it's...in my dad's room. The first room on the right. Third drawer," said Emily. "SHOW me!" said the man, and removed his grip around her neck. She took a big gulp of air and nearly fell. She swallowed hard and said a silent prayer. She walked slowly, in silence, toward her father's room. All of a sudden, they heard police sirens. The intruder froze in his footsteps. He ran to the nearest window and jumped out of it. Emily ran outside in time to see the intruder being escorted into the car. She saw Anna and she ran toward her and hugged her. "Smart kids," said the policeman. What had happened?
Emily had used the mute button during her conversation with Anna so that all Anna heard was: "call...help...emergency...please hurry". Anna, sensing something was wrong, called the police and told them Emily's address. The police were able to come to Emily's house in time to catch the perpetrator.
75.54 %
250 votes
logiccleversimple

In olden days you are a clever thief charged with treason against the king and sentenced to death. But the king decides to be a little lenient and lets you choose your own way to die. What way should you choose? Remember, you're clever!
I would have chosen to die of "old age". Did you?
75.48 %
334 votes
logicmathsimplecleanclever

There are 100 ants on a board that is 1 meter long, each facing either left or right and walking at a pace of 1 meter per minute. The board is so narrow that the ants cannot pass each other; when two ants walk into each other, they each instantly turn around and continue walking in the opposite direction. When an ant reaches the end of the board, it falls off the edge. From the moment the ants start walking, what is the longest amount of time that could pass before all the ants have fallen off the plank? You can assume that each ant has infinitely small length.
The longest amount of time that could pass would be 1 minute. If you were looking at the board from the side and could only see the silhouettes of the board and the ants, then when two ants walked into each other and turned around, it would look to you as if the ants had walked right by each other. In fact, the effect of two ants walking into each other and then turning around is essentially the same as two ants walking past one another: we just have two ants at that point walking in opposite directions. So we can treat the board as if the ants are walking past each other. In this case, the longest any ant can be on the board is 1 minute (since the board is 1 meter long and the ants walk at 1 meter per minute). Thus, after 1 minute, all the ants will be off the board.
74.89 %
100 votes
logicsimpleclever

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.
74.80 %
118 votes