An interview question, please help!
you are offered to play a game of chance. A fair coin is tossed repeatedly until you get the first tails, at which point the game ends and you get the prize. The prize "pot" starts at $1 and doubles each time you get heads. So for instance, if you get heads the first toss, the pot becomes $2. If you get heads again the second toss, the pot becomes $4. If you get heads the third time, the pot becomes $8. If the fourth toss gives you the tail of the coin, you win and take home the $8 prize.
Before you play, you must pay a fee to enter this game. The question is, what's the maximum amount you're willing to pay in order to play this game?