PROJECT EULER · #0938
Exhausting a Colour
A deck of cards contains
A card is chosen uniformly randomly from the deck and removed. A second card is then chosen uniformly randomly from the cards remaining and removed.
- If both cards are red, they are discarded.
- If both cards are black, they are both put back in the deck.
- If they are different colours, the red card is put back in the deck and the black card is discarded.
Play ends when all the remaining cards in the deck are the same colour and let
You are given
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.