Hard logic riddles

cleanlogicsimple

Imagine John, a party magician, is carrying three pieces of gold each piece weighing one kilogram. While taking a walk he comes to a bridge which has a sign posted saying the bridge could hold only a maximum of 80 kilograms. John weighs 78 kilograms and the gold weighs three kilograms. John reads the sign and still safely crossed the bridge with all the gold. How did he manage this?
John is a juggler. When he came to the bridge he juggled the gold, always keeping one piece in the air.
68.66 %
79 votes
logicsimpletricky

Romeo and Juliet are found dead on the floor in a bedroom. When they were discovered, there were pieces of glass and some water on the floor. The only furniture in the room is a shelf and a bed. The house is in a remote location, away from everything except for the nearby railroad track. What caused the death of Romeo and Juliet?
Romeo and Juliet are fishies. The rumble of the train knocked the tank off the shelf, it broke and Romeo and Julia did not survive.
68.54 %
75 votes
cleverlogicsimpletricky

Three people check into a hotel. They pay $30 to the manager and go to their room. The manager finds out that the room rate is $25 and gives $5 to the bellboy to return. On the way to the room, the bellboy reasons that $5 would be difficult to share among three people, so he pockets $2 and gives $1 to each person. Now, each person paid $10 and got back $1. So they paid $9 each, totalling $27. The bellboy has $2, totalling $29. ) Where is the remaining dollar?
Each person paid $9, totalling $27. The manager has $25 and the bellboy has $2. The bellboy's $2 should be added to the manager's $25 or substracted from the tenant's $27, not added to the tenants' $27.
68.20 %
103 votes
logicmath

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
68.01 %
59 votes
logicmysterystory

A king has no sons, no daughters, and no queen. For this reason he must decide who will take the throne after he dies. To do this he decides that he will give all of the children of the kingdom a single seed. Whichever child has the largest, most beautiful plant will earn the throne; this being a metaphor for the kingdom. At the end of the contest all of the children came to the palace with their enormous and beautiful plants in hand. After he looks at all of the children's pots, he finally decides that the little girl with an empty pot will be the next Queen. Why did he choose this little girl over all of the other children with their beautiful plants?
The king gave them all fake seeds and the little girl was the only honest child who didn't switch seeds.
67.59 %
277 votes
cleanlogicmysteryscarydetective

Two girls ate dinner together. They both ordered iced tea. One girl drank them very fast and had finished five in the time it took the other to drink just one. The girl who drank one died while the other survived. All of the drinks were poisoned. How is that possible?
The poison was in the ice.
66.27 %
2125 votes
logicsimpleclever

Your enemy challenges you to play Russian Roulette with a 6-cylinder pistol (meaning it has room for 6 bullets). He puts 2 bullets into the gun in consecutive slots, and leaves the next four slots blank. He spins the barrel and hands you the gun. You point the gun at yourself and pull the trigger. It doesn't go off. Your enemy tells you that you need to pull the trigger one more time, and that you can choose to either spin the barrel at random, or not, before pulling the trigger again. Spinning the barrel will position the barrel in a random position. Assuming you'd like to live, should you spin the barrel or not before pulling the trigger again?
You are better off shooting again without spinning the barrel. Given that the gun didn't fire the first time, it was pointing to one of the four empty slots. Because your enemy spun the cylinder randomly, it would have been pointing to any of these empty slots with equal probability. Three of these slots would not fire again after an additional trigger-pull, and one of them would. Thus, by not spinning the barrel, there is a 1/4 chance that pulling the trigger again would fire the gun. Alternatively, if you spin the barrel, it will point to each of the 6 slots with equal probability. Because 2 of these 6 slots have bullets in them, there would be a 2/6 = 1/3 chance that the gun would fire after spinning the barrel. Thus, you are better off not spinning the barrel.
66.18 %
83 votes