Quant, Math & Computer Science Puzzles for Interview Preparation & Brain Teasing
A collection of ~225 Puzzles with Solutions (classified by difficulty and topic)

Dec 29, 2012

Pizza Distribution Puzzle

Source: xkcd wiki

Problem:
The king of the universe has decided to play a game. To start, he selects 1 person. He then flips two fair coins - if they both come up heads, the person gets a free pizza and the game is over. For any other result, he sends the person home and selects 2 new people, where he does the same 2-coin flip to decide if they each get a pizza. If they don’t, he picks 4 people at random, then 8, and so on, doubling each round. If you are selected but don’t win, you can’t be selected again – and you can assume the population is extremely large so there’s no chance of running out of contestants.

You are sitting at home when you get a call – you have been selected to play the game. What is the chance that you will get a free pizza?

You don't know which round number it is, but if you ask, the king will tell you. Does it matter?

Disclaimer: Very easy problem!

Update (31 January 2013):
Title changed to "Pizza Distribution Puzzle" from "Pizza Paradox Puzzle" - as pointed out by Vivek Ranjan Nema in comments, there is no paradox. My mistake. Apologies.
Solution posted by Rushabh Sheth, Pratyush Rathore, Nathan Jacobson, Marjansek, Shyam Raj in comments!

9 comments:

  1. answer 1/4
    matters not which round.
    each round has same probability of winning.
    we are not interested in what round is going on, just what our probability of winning is.

    ReplyDelete
  2. 1/4.
    My fate of pizza is decided by a single event, the coin toss.

    Everything prior to this, determines the chance whether or not, I get to play the game, which is the starting point in this case.

    ReplyDelete
  3. I guess the probability is still 1/2 as I have already been selected for the contest.

    ReplyDelete
  4. Isn't it just a 25% chance since if you are getting a call the previous rounds all lost and your outcome is not influenced by the other players in your round

    ReplyDelete
  5. 1/4; probabilities are independent.

    ReplyDelete
  6. If the first person did not get pizza, the king selects 2 people. I am not sure, does he flip 2 coins for both and both can get free pizza, or does he flip 2 coins for person 1 and if he gets free pizza the second does not?
    Rika

    ReplyDelete
    Replies
    1. No matter what is your order in the queue. But for every person, the king flips two coins. And both have to show heads for you to get the pizza. Which means (1/2)*(1/2). Hence 1/4.

      Delete
  7. 1 - (3/4)^k, where k is round number

    ReplyDelete