# Paper 2, Section II, F

Let $m$ and $n$ be positive integers with $n>m>0$ and let $p \in(0,1)$ be a real number. A random walk on the integers starts at $m$. At each step, the walk moves up 1 with probability $p$ and down 1 with probability $q=1-p$. Find, with proof, the probability that the walk hits $n$ before it hits 0 .

Patricia owes a very large sum $£ 2(N$ !) of money to a member of a violent criminal gang. She must return the money this evening to avoid terrible consequences but she only has $£ N$ !. She goes to a casino and plays a game with the probability of her winning being $\frac{18}{37}$. If she bets $£ a$ on the game and wins then her $£ a$ is returned along with a further $£ a$; if she loses then her $£ a$ is lost.

The rules of the casino allow Patricia to play the game repeatedly until she runs out of money. She may choose the amount $£ a$ that she bets to be any integer a with $1 \leqslant a \leqslant N$, but it must be the same amount each time. What choice of $a$ would be best and why?

What choice of $a$ would be best, and why, if instead the probability of her winning the game is $\frac{19}{37}$ ?