PROJECT EULER · #0951
A Game of Chance
Two players play a game using a deck of
- Remove the top card from the deck, taking note of its colour.
- If there is a next card and it is the same colour as the previous card they toss a fair coin. If the coin lands on heads they remove that card as well; otherwise leave it on top of the deck.
The player who removes the final card from the deck wins the game.
Some starting configurations give an advantage to one of the players; while some starting configurations are fair, in which both players have exactly
Define
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.