Two trains are traveling toward each other on the same track, each at 60 miles per hour. When they are exactly 120 miles apart, a fly takes off from the front of one of the trains, flying toward the other train at a constant rate of 100 miles per hour. When the fly reaches the other train, it instantly changes directions and starts flying toward the other train, still at 100 miles per hour. It keeps doing this back and forth until the trains finally collide. If you add up all the distances back and forth that the fly has travelled, how much total distance has the fly travelled when the trains finally collide?
SEE ANSWER
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
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.
Answer:- You will never reach the door! If you only move half the distance, then you will always have half the distance remaining no matter, how small is the number.
Two workmen were repairing a roof. Suddenly, they both fell down the chimney and found themselves in the large fireplace.
One man`s face was smeared with soot and one wasn`t. The one with the clean face washed his and the dirty man did not and went back to work. Why?
Answer:- When the two men looked at each other, the clean man thought his face was dirty as well. The dirty man, looking at the first's place, thought his was clean.
What can you swallow than can also swallow you?
Answer:- Water.
What has five eyes, but cannot see?
Answer:- The Mississippi River.
What is everthing yet nothing, has no start and no end, creates yets destroys, brings life and death what is it?
Answer:- Void
What is the first thing a storm cloud puts on after a shower?
Answer:- Thunderwear.
What kind of corn starts with the letter A?
Answer:- Acorn.
When I look at her, she smiles at me. When I wink at her, she winks at me. When I kiss her, she kisses me back. When I say I love you, she says it back. Who am I?
Answer:- Your own reflection in the mirror.
When you do know me about me, them I am definitely something. You will always search for me. But when you know me, I am nothing. Who am I?
Answer:- I'm a Riddle.
Which weighs more, a pound of feathers or a pound of bricks?
Answer:- They weigh the same amount.
While mixing sand, gravel, and cement for the foundation of a house, a worker noticed a small bird hopping along the top of the foundation wall. The bird misjudged a hop and fell down one of the holes between the blocks. The bird was down too far for anyone to reach it and the hole was too small for it to fly out of. Someone suggested using two sticks to reach down into the hole and pull the bird out, but this idea was rejected for fear it would injure the fragile bird. What would be the easiest way to get the bird out of the hole without injuring it?
Answer:- Since they had plenty of sand available, they could pour a little at a time into the hole. The bird would constantly keep shifting its position so that it stood on the rising sand.
