PROJECT EULER · #0503
Compromise or Persist
Alice is playing a game with
A game consists of iterations of the following steps.
(1) Alice picks one of the cards at random.
(2) Alice cannot see the number on it. Instead, Bob, one of her friends, sees the number and tells Alice how many previously-seen numbers are bigger than the number which he is seeing.
(3) Alice can end or continue the game. If she decides to end, the number becomes her score. If she decides to continue, the card is removed from the game and she returns to (1). If there is no card left, she is forced to end the game.
Let
For example,
We can also verify that
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.