Alice and bob play a game. Bob has a well-shuffled deck of $M=4999$ white cards and $N=4999$ green cards. Each permutation of cards in the deck is equally likely. Alice has set some rules for Bob.
- Every time Bob flips a white card he gets one coin, otherwise he loses one coin. At any moment (even at the beginning), Bob is allowed to stop playing the game and keep the number of coins that he has.
- During the game-play the balance of coins that Bob has may be negative.
If Bob plays optimally, what the expected amount of coins Bob will have?
Can any body give me an idea or a hint how to solve it.