Two sentries were on duty outside a barracks.
One faced up the road to watch for anyone approaching from the North.
The other looked down the road to see if anyone was approached from the South.
Suddenly one of them said to the other, "Why are you smiling?"
How did he know that his companion was smiling?
Although the guards were looking in opposite directions, they were not back to back. They were facing each other.
You have two jugs, one that holds exactly 3 gallons, and one that holds exactly 5 gallons. Using just these two jugs and a fire hose, how can you measure out exactly 4 gallons of water?
Fill the 5-gallon jug to the top, and then pour it into the 3-gallon jug until the 3-gallon jug is full. You now have 2 gallons remaining in the 5-gallon jug. Pour out the 3-gallon jug, and then pour the 2 gallons from the 5-gallon jug into the 3-gallon jug. Finally, fill the 5-gallon jug to the top and pour it into the 3-gallon jug until it's full. Since there was only space left for 1 more gallon in the 3-gallon jug, you now have exactly 4 gallons in the 5-gallon jug.
There is a small town in the midwest with exactly 2 barbershops, one on each side of town. The barbershop on the west side of town is pristine. Its floors are spotless, the windows are always perfectly clear, and the air always smells fresh. The barber has a friendly smile, shined shoes, a well-groomed head of hair, and a fancy shirt. The barbershop on the east side of town is a mess. Its floors and windows are dirty, and the air smells of garbage. The barber always has a grimace on his face. His skin is oily, his hair is short and ragged, and he has food on his clothes all the time.
A man travelling through the town realizes he needs a haircut. Knowing the stories of the two barbers, the man decides to go to the dirty barbershop on the east side of town.
Why does he do this?
Because there are only two barbers in the town, the barbers must cut each-other's hair. The barber on the west side of town has a nice haircut, so the east-side barber must be a good barber. On the other hand, the barber on the east side of town has ragged hair, meaning the west-side barber must not be very good. So the man goes to the east-side barber to get a better haircut.
You have two lengths of rope. Each rope has the property that if you light it on fire at one end, it will take exactly 60 minutes to burn to the other end. Note that the ropes will not burn at a consistent speed the entire time (for example, it's possible that the first 90% of a rope will burn in 1 minute, and the last 10% will take the additional 59 minutes to burn).
Given these two ropes and a matchbook, can you find a way to measure out exactly 45 minutes?
The key observation here is that if you light a rope from both ends at the same time, it will burn in 1/2 the time it would have burned in if you had lit it on just one end.
Using this insight, you would light both ends of one rope, and one end of the other rope, all at the same time. The rope you lit at both ends will finish burning in 30 minutes. Once this happens, light the second end of the second rope. It will burn for another 15 minutes (since it would have burned for 30 more minutes without lighting the second end), completing the 45 minutes.
Suppose you want to send in the mail a valuable object to a friend. You have a box which is big enough to hold the object. The box has a locking ring which is large enough to have a lock attached and you have several locks with keys. However, your friend does not have the key to any lock that you have. You cannot send the key in an unlocked box since it may be stolen or copied. How do you send the valuable object, locked, to your friend - so it may be opened by your friend?
Send the box with valuable object and a lock attached and locked. Your friend attaches his or her own lock and sends the box back to you. You remove your lock and send it back to your friend. Your friend may then remove the lock she or he put on and open the box.
Search: Man-in-the-middle attack
You are on a gameshow and the host shows you three doors. Behind one door is a suitcase with $1 million in it, and behind the other two doors are sacks of coal. The host tells you to choose a door, and that the prize behind that door will be yours to keep.
You point to one of the three doors. The host says, "Before we open the door you pointed to, I am going to open one of the other doors." He points to one of the other doors, and it swings open, revealing a sack of coal behind it.
"Now I will give you a choice," the host tells you. "You can either stick with the door you originally chose, or you can choose to switch to the other unopened door."
Should you switch doors, stick with your original choice, or does it not matter?
You should switch doors.
There are 3 possibilities for the first door you picked:
You picked the first wrong door - so if you switch, you win
You picked the other wrong door - again, if you switch, you win
You picked the correct door - if you switch, you lose
Each of these cases are equally likely. So if you switch, there is a 2/3 chance that you will win (because there is a 2/3 chance that you are in one of the first two cases listed above), and a 1/3 chance you'll lose. So switching is a good idea.
Another way to look at this is to imagine that you're on a similar game show, except with 100 doors. 99 of those doors have coal behind them, 1 has the money. The host tells you to pick a door, and you point to one, knowing almost certainly that you did not pick the correct one (there's only a 1 in 100 chance). Then the host opens 98 other doors, leave only the door you picked and one other door closed. We know that the host was forced to leave the door with money behind it closed, so it is almost definitely the door we did not pick initially, and we would be wise to switch.
Search: Monty Hall problem
One day a boss said to her employees, "I can fight and beat any man who works here."
A new employee, a seven-foot-tall ex-prize fighter, stood up to take on the boss.
The boss kept her word, but did not beat the man or back down.
What did the boss do?
In a one storey brown house, there was a brown person with a brown computer, brown telephone, and brown chair. He also had a brown cat and a brown fish – Just about everything was brown – What colour was the stairs?
As it was a one-storey house – there were no stairs.