Brainteaser iconBrainteaser - Risky Coins: To Bet or Not to Bet?

Risky Coins: To Bet or Not to Bet?
Probability
Optiver, Da Vinci Trading
You have 1000 coins and must place bets repeatedly until you've wagered all 1000 coins at least once before cashing out. Each round, you decide how many coins, \(x\), to bet. Flipping a fair coin determines the outcome: heads gives you your bet back plus 90% more; tails results in losing your bet. What's the optimal betting strategy to maximize your coins by the end?