Expected Cost of Picking Up Same Colored Ball Assuming there are 10 Colored Ball $$\{ A, B, C, D, E, F, G, H, I, J \}$$
My goal is to get two balls of color "$J$", by picking it from a bag one at a time. (You will replace the ball each time you pick).
But there is a condition, 


*

*Cost of picking a ball is $230 \ 769$ dollars

*As soon as you pick the ball of another color, you have to pay a fine of $200 \ 000$ dollars. And you cannot continue the game, you have to restart. 


I cannot get the mathematical formula to represent the expected cost.
For some reason, simple table manage to arrive at the answer too!

 A: Notice that the only way you can win is to get $J$ twice in a row.
So in the first round, you either


*

*Pay $\$230769$ and get $J$ with $p=\frac1{10}$, then continue to the next round, or

*Pay $\$430769$ and not get $J$ with $p=\frac9{10}$ and restart.


The next round has the same outcome as above. Hence, the moment you get two $J$'s you end the game, otherwise, you keep spending $E$, where $E$ is the expected cost. 
Mathematically,
$$E=\underbrace{\frac{1}{10}}_\text{first round $J$, continue}\left(230769+\underbrace{\frac{1}{10}(230769)}_\text{second round $J$, end}+\underbrace{\frac{9}{10}(E+430769)}_\text{second round not $J$, restart}\right)+\underbrace{\frac{9}{10}(E+430769)}_\text{first round not $J$, restart}$$
which you can then solve to get
$$E\approx4.51846\times10^7$$

I suppose that your numbers are made up so if the cost of drawing a ball is $x$ and the fine is $y$, with $x,y>0$, then
$$E={\frac{1}{10}}\left(x+\frac{1}{10}x+{\frac{9}{10}(E+x+y)}\right)+\frac{9}{10}(E+x+y)$$
which solves to
$$E=110x+99y$$
