Sunday, May 21, 2006

Birthday matching

At a movie theater, the manager announces that he would give a free ticket to the first person in line whose birthday is the same as someone who has already bought a ticket. You have the option of getting in line at any time. Assuming that you don't know anyone else's birthday and that birthdays are distributed randomly throughout the year what position in line gives you the greatest chance of being the first duplicate birthday so you can get a free ticket?

Tuesday, May 16, 2006

Crazy guy on the airplane

A line of 1000 airline passengers is waiting to board a plane. They each hold a ticket to one of the 1000 seats on that flight. For convenience, let's say that the nth passenger in line has a ticket for the seat number n. Unfortunately, the first person in line is crazy, and will ignore the seat number on his ticket and picks a random seat to occupy. All of the other passengers are quite normal, and will go to their proper seat unless it is already occupied. If it is occupied, they will then find a free seat to sit in, at random. What is the probability that the last (1000th) person to board the plane will sit in their proper seat (#1000)? Now what is the probability for the nth guy to sit in the nth seat number, if there an 'n' people waiting to board the plane?

Level: Easy to Medium

(Image credit:

Saturday, May 13, 2006


How many trailing 0's does 100! have? Generalize it for any N! after you have computed for 100!

N! = Factorial N = N * N-1 * N-2 * ......2 * 1

Level: Medium to Hard

Thursday, May 11, 2006

What's so strange about me?

Pick a 3-digit number where the first and last digits differ by 2 or more...

* Consider the "reverse" number, obtained by reading it backwards.
* Subtract the smaller of these two numbers from the larger one.
* Add the result to its own reverse.

What is the peculiarity you observe in the result? Can you explain why it is so? Is there some mathematical logic behind this?

Level: Easy

Monday, May 08, 2006

Playing quarters with the devil

The devil has you captured and he agrees to leave you only if you win a game with him in playing quarters. The devil says "We both take turns in placing quarters on a table and the one who cannot place any more quarters looses". The devil also adds that there are no overlapping of the coins allowed. Now, what should your strategy be to win against the devil?

Level: Medium

Friday, May 05, 2006

Name the hidden card

Let's take on the deck of cards today and see where it takes us to: You and another intelligent friend of yours offer to perform this trick together in front of an audience. There is a deck of 52 cards in front of you. Assume the deck is neat with 13 of each type. The deck is shuffled and your friend asks the audience (one of them) to pick 5 cards. Your friend then takes those 5 cards and sees the cards that the audience has picked without showing it to you. Then your friend will pick one card from that 5 cards and hand it back to the audience. Then your friend neatly piles the remaining 4 cards in an order and places it on the table downwards and you start to pick them up. After you pick all the 4 cards, you are able to tell for sure what the 5th card with the audience is. How is that possible? Can you do the same experiment with 4 cards? Rule out all silly assumptions like "ESP between you and your friend, somehow your friend signals to you what it is, etc.," It is purely logical

Level: Hard

Wednesday, May 03, 2006

Am I red, or Am I blue?

There are 100 criminals in a jail and the jailor gets a change of heart and wants to release them. But he does not want to release them just like that, he wants to play a game with them. He announces that the next day, he will be putting hats, either blue or red, in equal randomness, on each of the prisoner's heads and all the prisoners will be lined up facing in one direction in a single file. So the last prisoner is able to see all the others' hats except of course his, the last but one will be able to see all the others except his and the last prisoner's, and so on...Basically they all can see what is in front of them. The first prisoner is unable to see any prisoner's hat as he is the first guy. The prisoners will be blindfolded until the jailor completes the task of putting the hats and then the blindfold will be removed. Once the blindfolds are removed, the jailor starts from the back and asks the color of the hat the prisoner is wearing. If the prisoner guesses the color of his own hat correctly, he survives, if not he is shot. To make things spicy, lets say the jailor allows others only to hear prisoner say the color of his hat and not whether he was correct or wrong. The prisoners are dismissed for the night. They discuss a strategy and come up with an optimal solution of saving lots of their fellow buddies. To top it all off, the jailor has a microphone bug inside the cell and he is able to hear their plan. So what is the strategy of the prisoners and how do they make sure lots of their folks are saved in the cruel game played by the jailor?

Once you solve the problem, lets try to get a generic methodology for a 'N' prisoner and 'K' different colors of the hats put in random. How many prisoners can be saved at a maximum and how many will be killed at a minimum?

Level: Hard

(Image courtesy:, I have put in the red and blue hats for those prisoners)

Tuesday, May 02, 2006

Hands of a clock

How many times in a day do the hands of a clock overlap? Can you list out the times too? Explain your methodology and not just list the answer.

Level: Medium

Monday, May 01, 2006

What's our average salary?

There are 3 colleagues who want to know what their average salary is, but they do not want to disclose to each other their individual salary. How do they go about doing it? In the process of doing it what is the worst that each could learn about the salaries of the other two? Is this method fail-proof? Think about it! Would you be willing to adopt your methodology with your colleagues and find the average salary?

Level: Medium