Logic riddles


Sam has got three daughters. The eldest daughter is the most honest girl in the universe and she always speaks truth. The middle daughter is a modest woman. She speaks truth and lies according to the situations. The youngest one never speaks truth. Not a single word she spoke was true and would never be true. Sam brought a marriage proposal for one of his girls. It was John. John wanted to marry either the eldest or the youngest daughter of Sam as he can easily identify whether the girl speaks truth or lie! John told his desire to Sam. However, Sam laid a condition. He told John that he will not say who the eldest, middle or youngest one is. Also, he allowed John to ask only one question to identify the eldest or youngest so he can marry one. John asked one question and found the right girl. What was the question and whom should he pick?
The question he asked is, 'Is she older than her?' He asks this question to one of the daughters. If he asked this question to older daughter pointing at other two, he probably would know the youngest one! NO matter, she always speaks truth. If he asked the question to middle one, probably he can choose either. If he asked the youngest one, she always lies and he can find eldest one. No matter, he has to choose the youngest one based on the answer.
72.05 %
51 votes

On the game show et´s Make a Deal, Monty Hall shows you three doors. Behind one of the doors is a new car, the other two hide goats. You choose one door, perhaps #1. Now Monty shows you what´s behind door #2 and it´s a goat.He gives you the chance to stay with original pick or select door #3. What do you do?
You should always abandon your original choice in favor of the remaining door (#3). When you make your first choice the chance of winning is 1 in 3 or 33%. When you switch doors, you turn a 2 in 3 chance of losing in the first round into a 2 in 3 chance of winning in the second round. Search: Monty Hall problem
72.01 %
85 votes

Galaxy Detective Karamchand was on a case. A spaceship was lost. Her partner, Galaxy Junior Detective Brightstar gave her a piece of paper. This was the location of the spaceship! This is what the slip had scribbled on it: Juice, Umbrella, Potato, Ice, Tomato, Elephant, Rice. Where is the spaceship?
71.97 %
89 votes

Mick and John were in a 100 meter race. When Mick crossed the finish line, John was only at the 90 meter mark. Mick suggested they run another race. This time, Mick would start ten meters behind the starting line. All other things being equal, will John win, lose, or will it be a tie in the second race?
John will lose again. In the second race, Mick started ten meters back. By the time John reaches the 90 meter mark, Mick will have caught up him. Therefore, the final ten meters will belong to the faster of the two. Since Mick is faster than John, he will win the final 10 meters and of course the race.
71.95 %
68 votes

A monk leaves at sunrise and walks on a path from the front door of his monastery to the top of a nearby mountain. He arrives at the mountain summit exactly at sundown. The next day, he rises again at sunrise and descends down to his monastery, following the same path that he took up the mountain. Assuming sunrise and sunset occured at the same time on each of the two days, prove that the monk must have been at some spot on the path at the same exact time on both days.
Imagine that instead of the same monk walking down the mountain on the second day, that it was actually a different monk. Let's call the monk who walked up the mountain monk A, and the monk who walked down the mountain monk B. Now pretend that instead of walking down the mountain on the second day, monk B actually walked down the mountain on the first day (the same day monk A walks up the mountain). Monk A and monk B will walk past each other at some point on their walks. This moment when they cross paths is the time of day at which the actual monk was at the same point on both days. Because in the new scenario monk A and monk B MUST cross paths, this moment must exist.
71.95 %
68 votes

A blind man walks into a hardware store to buy a hammer. There are hammers hanging behind the front desk, but obviously the blind man isn't able to see them. And yet a few minutes later, he happily walks out of the store, having just purchased a new hammer. How did he do it?
He walks up the the front desk where the clerk is working and says "I'd like to buy a hammer."
71.88 %
55 votes

Two words are anagrams if and only if they contain the exact same letters with the exact same frequency (for example, "name" and "mean" are anagrams, but "red" and "deer" are not). Given two strings S1 and S2, which each only contain the lowercase letters a through z, write a program to determine if S1 and S2 are anagrams. The program must have a running time of O(n + m), where n and m are the lengths of S1 and S2, respectively, and it must have O(1) (constant) space usage.
First create an array A of length 26, representing the counts of each letter of the alphabet, with each value initialized to 0. Iterate through each character in S1 and add 1 to the corresponding entry in A. Once this iteration is complete, A will contain the counts for the letters in S1. Then, iterate through each character in S2, and subtract 1 from each corresponding entry in A. Now, if the each entry in A is 0, then S1 and S2 are anagrams; otherwise, S1 and S2 aren't anagrams. Here is pseudocode for the procedure that was described: def areAnagrams(S1, S2) A = new Array(26) A.initializeValues(0) for each character in S1 arrayIndex = mapCharacterToNumber(character) //maps "a" to 0, "b" to 1, "c" to 2, etc... A[arrayIndex] += 1 end for each character in S2 arrayIndex = mapCharacterToNumber(character) A[arrayIndex] -= 1 end for (i = 0; i < 26; i++) if A[i] != 0 return false end end return true end
71.88 %
55 votes

This teaser is based on a weird but true story from a few years ago. A complaint was received by the president of a major car company: "This is the fourth time I have written you, and I don't blame you for not answering me because I must sound crazy, but it is a fact that we have a tradition in our family of having ice cream for dessert after dinner each night. Every night after we've eaten, the family votes on which flavor of ice cream we should have and I drive down to the store to get it. I recently purchased a new Pantsmobile from your company and since then my trips to the store have created a problem. You see, every time I buy vanilla ice cream my car won't start. If I get any other kind of ice cream the car starts just fine. I want you to know I'm serious about this question, no matter how silly it sounds: 'What is there about a Pantsmobile that makes it not start when I get vanilla ice cream, and easy to start whenever I get any other kind?'" The Pantsmobile company President was understandably skeptical about the letter, but he sent an engineer to check it out anyway. He had arranged to meet the man just after dinner time, so the two hopped into the car and drove to the grocery store. The man bought vanilla ice cream that night and, sure enough, after they came back to the car it wouldn't start for several minutes. The engineer returned for three more nights. The first night, the man got chocolate. The car started right away. The second night, he got strawberry and again the car started right up. The third night he bought vanilla and the car failed to start. There was a logical reason why the man's car wouldn't start when he bought vanilla ice cream. What was it? The man lived in an extremely hot city, and this took place during the summer. Also, the layout of the grocery store was such that it took the man less time to buy vanilla ice cream.
Vanilla ice cream was the most popular flavor and was on display in a little case near the express check out, while the other flavors were in the back of the store and took more time to select and check out. This mattered because the man's car was experiencing vapor lock, which is excess heat boiling the fuel in the fuel line and the resulting air bubbles blocking the flow of fuel until the car has enough time to cool.. When the car was running there was enough pressure to move the bubbles along, but not when the car was trying to start.
71.88 %
55 votes