You have a basket of infinite size (meaning it can hold an infinite number of objects). You also have an infinite number of balls, each with a different number on it, starting at 1 and going up (1, 2, 3, etc...).
A genie suddenly appears and proposes a game that will take exactly one minute. The game is as follows: The genie will start timing 1 minute on his stopwatch. Where there is 1/2 a minute remaining in the game, he'll put balls 1, 2, and 3 into the basket. At the exact same moment, you will grab a ball out of the basket (which could be one of the balls he just put in, or any ball that is already in the basket) and throw it away.
Then when 3/4 of the minute has passed, he'll put in balls 4, 5, and 6, and again, you'll take a ball out and throw it away.
Similarly, at 7/8 of a minute, he'll put in balls 7, 8, and 9, and you'll take out and throw away one ball.
Similarly, at 15/16 of a minute, he'll put in balls 10, 11, and 12, and you'll take out and throw away one ball.
And so on....After the minute is up, the genie will have put in an infinite number of balls, and you'll have thrown away an infinite number of balls.
Assume that you pull out a ball at the exact same time the genie puts in 3 balls, and that the amount of time this takes is infinitesimally small.
You are allowed to choose each ball that you pull out as the game progresses (for example, you could choose to always pull out the ball that is divisible by 3, which would be 3, then 6, then 9, and so on...).
You play the game, and after the minute is up, you note that there are an infinite number of balls in the basket.
The next day you tell your friend about the game you played with the genie. "That's weird," your friend says. "I played the exact same game with the genie yesterday, except that at the end of my game there were 0 balls left in the basket."
How is it possible that you could end up with these two different results?
Your strategy for choosing which ball to throw away could have been one of many. One such strategy that would leave an infinite number of balls in the basket at the end of the game is to always choose the ball that is divisible by 3 (so 3, then 6, then 9, and so on...). Thus, at the end of the game, any ball of the format 3n+1 (i.e. 1, 4, 7, etc...), or of the format 3n+2 (i.e. 2, 5, 8, etc...) would still be in the basket. Since there will be an infinite number of such balls that the genie has put in, there will be an infinite number of balls in the basket.
Your friend could have had a number of strategies for leaving 0 balls in the basket. Any strategy that guarantees that every ball n will be removed after an infinite number of removals will result in 0 balls in the basket.
One such strategy is to always choose the lowest-numbered ball in the basket. So first 1, then 2, then 3, and so on. This will result in an empty basket at the game's end. To see this, assume that there is some ball in the basket at the end of the game. This ball must have some number n. But we know this ball was thrown out after the n-th round of throwing balls away, so it couldn't be in there. This contradiction shows that there couldn't be any balls left in the basket at the end of the game.
An interesting aside is that your friend could have also used the strategy of choosing a ball at random to throw away, and this would have resulted in an empty basket at the end of the game. This is because after an infinite number of balls being thrown away, the probability of any given ball being thrown away reaches 100% when they are chosen at random.
See also best riddles or new riddles.interviewlogicmath
The Miller next took the company aside and showed them nine sacks of flour that were standing as depicted in the sketch.
"Now, hearken, all and some," said he, "while that I do set ye the riddle of the nine sacks of flour.
And mark ye, my lords and masters, that there be single sacks on the outside, pairs next unto them, and three together in the middle thereof.
By Saint Benedict, it doth so happen that if we do but multiply the pair, 28, by the single one, 7, the answer is 196, which is of a truth the number shown by the sacks in the middle.
Yet it be not true that the other pair, 34, when so multiplied by its neighbour, 5, will also make 196.
Wherefore I do beg you, gentle sirs, so to place anew the nine sacks with as little trouble as possible that each pair when thus multiplied by its single neighbour shall make the number in the middle."
As the Miller has stipulated in effect that as few bags as possible shall be moved, there is only one answer to this puzzle, which everybody should be able to solve.
The way to arrange the sacks of flour is as follows: 2, 78, 156, 39, 4. Here each pair when multiplied by its single neighbour makes the number in the middle, and only five of the sacks need be moved.
There are just three other ways in which they might have been arranged (4, 39, 156, 78, 2; or 3, 58, 174, 29, 6; or 6, 29, 174, 58, 3), but they all require the moving of seven sacks.logicmath
On the first day they cover one quarter of the total distance.
The next day they cover one quarter of what is left.
The following day they cover two fifths of the remainder and on the fourth day half of the remaining distance.
The group now have 14 miles left, how many miles have they walked?
You are standing in a pitch-dark room. A friend walks up and hands you a normal deck of 52 cards. He tells you that 13 of the 52 cards are face-up, the rest are face-down. These face-up cards are distributed randomly throughout the deck.
Your task is to split up the deck into two piles, using all the cards, such that each pile has the same number of face-up cards. The room is pitch-dark, so you can't see the deck as you do this.
How can you accomplish this seemingly impossible task?
Take the first 13 cards off the top of the deck and flip them over. This is the first pile. The second pile is just the remaining 39 cards as they started.
This works because if there are N face-up cards in within the first 13 cards, then there will be (13 - N) face up cards in the remaining 39 cards. When you flip those first 13 cards, N of which are face-up, there will now be N cards face-down, and therefore (13 - N) cards face-up, which, as stated, is the same number of face-up cards in the second pile.logicmath
There are 1 million closed school lockers in a row, labeled 1 through 1,000,000.
You first go through and flip every locker open.
Then you go through and flip every other locker (locker 2, 4, 6, etc...). When you're done, all the even-numbered lockers are closed.
You then go through and flip every third locker (3, 6, 9, etc...). "Flipping" mean you open it if it's closed, and close it if it's open. For example, as you go through this time, you close locker 3 (because it was still open after the previous run through), but you open locker 6, since you had closed it in the previous run through.
Then you go through and flip every fourth locker (4, 8, 12, etc...), then every fifth locker (5, 10, 15, etc...), then every sixth locker (6, 12, 18, etc...) and so on. At the end, you're going through and flipping every 999,998th locker (which is just locker 999,998), then every 999,999th locker (which is just locker 999,999), and finally, every 1,000,000th locker (which is just locker 1,000,000).
At the end of this, is locker 1,000,000 open or closed?
Locker 1,000,000 will be open.
If you think about it, the number of times that each locker is flipped is equal to the number of factors it has. For example, locker 12 has factors 1, 2, 3, 4, 6, and 12, and will thus be flipped 6 times (it will end be flipped when you flip every one, every 2nd, every 3rd, every 4th, every 6th, and every 12th locker). It will end up closed, since flipping an even number of times will return it to its starting position. You can see that if a locker number has an even number of factors, it will end up closed. If it has an odd number of factors, it will end up open.
As it turns out, the only types of numbers that have an odd number of factors are squares. This is because factors come in pairs, and for squares, one of those pairs is the square root, which is duplicated and thus doesn't count twice as a factor. For example, 12's factors are 1 x 12, 2 x 6, and 3 x 4 (6 total factors). On the other hand, 16's factors are 1 x 16, 2 x 8, and 4 x 4 (5 total factors).
So lockers 1, 4, 9, 16, 25, etc... will all be open. Since 1,000,000 is a square number (1000 x 1000), it will be open as well.logicmath
You have been given the task of transporting 3,000 apples 1,000 miles from Appleland to Bananaville. Your truck can carry 1,000 apples at a time. Every time you travel a mile towards Bananaville you must pay a tax of 1 apple but you pay nothing when going in the other direction (towards Appleland). What is highest number of apples you can get to Bananaville?
Step one: First you want to make 3 trips of 1,000 apples 333 miles. You will be left with 2,001 apples and 667 miles to go.
Step two: Next you want to take 2 trips of 1,000 apples 500 miles. You will be left with 1,000 apples and 167 miles to go (you have to leave an apple behind).
Step three: Finally, you travel the last 167 miles with one load of 1,000 apples and are left with 833 apples in Bananaville.logicmath
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?
The fly has travelled exactly 100 miles. We can figure this out using some simple math. Becuase the trains are 120 miles apart when the fly takes off, and are travelling at 60 mph each, they will collide in exactly 1 hour. This gives the fly exactly 1 hour of flying time, going at a speed of 100 miles per hour. Thus, the fly will travel 100 miles in this hour.logicmathshort
A man gave one son 10 cents and another son was given 15 cents. What time is it?
1:45. The man gave away a total of 25 cents. He divided it between two people. Therefore, he gave a quarter to two.logicmath
You are visiting NYC when a man approaches you.
"Not counting bald people, I bet a hundred bucks that there are two people living in New York City with the same number of hairs on their heads," he tells you.
"I'll take that bet!" you say. You talk to the man for a minute, after which you realize you have lost the bet.
What did the man say to prove his case?
This is a classic example of the pigeonhole principle. The argument goes as follows: assume that every non-bald person in New York City has a different number of hairs on their head. Since there are about 9 million people living in NYC, let's say 8 million of them aren't bald.
So 8 million people need to have different numbers of hairs on their head. But on average, people only have about 100,000 hairs. So even if there was someone with 1 hair, someone with 2 hairs, someone with 3 hairs, and so on, all the way up to someone with 100,000 hairs, there are still 7,900,000 other people who all need different numbers of hairs on their heads, and furthermore, who all need MORE than 100,000 hairs on their head.
You can see that additionally, at least one person would need to have at least 8,000,000 hairs on their head, because there's no way to have 8,000,000 people all have different numbers of hairs between 1 and 7,999,999. But someone having 8,000,000 is an essential impossibility (as is even having 1,000,000 hairs), So there's no way this situation could be the case, where everyone has a different number of hairs. Which means that at least two people have the same number of hairs.logicmath
In the land of Brainopia, there are three races of people: Mikkos, who tell the truth all the time, Kikkos, who always tell lies, and Zikkos, who tell alternate false and true statements, in which the order is not known (i.e. true, false, true or false, true, false). When interviewing three Brainopians, a foreigner received the following statements:
I am a Mikko.
I am a Kikko.
a. They are both lying.
b. I am a Zikko.
Can you help the very confused foreigner determine who is who, assuming each person represents a different race?
Person 1 is a Miko.
Person 2 is a Ziko.
Person 3 is a Kikko. logicmath
Every day, Jack arrives at the train station from work at 5 pm. His wife leaves home in her car to meet him there at exactly 5 pm, and drives him home. One day, Jack gets to the station an hour early, and starts walking home, until his wife meets him on the road. They get home 30 minutes earlier than usual. How long was he walking? Distances are unspecified. Speeds are unspecified, but constant. Give a number which represents the answer in minutes.
The best way to think about this problem is to consider it from the perspective of the wife. Her round trip was decreased by 30 minutes, which means each leg of her trip was decreased by 15 minutes. Jack must have been walking for 45 minutes.