In American casinos, the roulette wheels have the integers between 1 and 36, together with 0 and 00. Half of the non-zero numbers are red, the other half are black, and 0 and 00 are green. A common bet in this game is to bet a dollar on red. If a red number comes up, the bettor gets her dollar back, and also gets another dollar. If a black or green number comes up, she loses her dollar.

(a) Suppose that someone starts with 40 dollars, and continues to bet on red until either her fortune reaches 50 or 0. Find the probability that her fortune reaches 50 dollars.

p <- 18/38
p
## [1] 0.4736842
q <- 20/38
q
## [1] 0.5263158
v <- q/p
v
## [1] 1.111111
(v^40-1)/(v^50-1)
## [1] 0.3453043