# Shooting the rabbit

You have $21$ shots. You can shoot any of two windows $A$ and $B$. How many shots will you fire at window $A$ to maximize your chances of hitting a rabbit when:

a) Rabbit's location is static i.e. it is either in window $A$ with probability $8/9$ or in window $B$ with probability $1/9$ through the duration of $21$ shots.

b) Rabbit can move between the windows after each shot. The probability that rabbit will be in window $A$ is $8/9$ and for window $B$ is $1/9$ for each shot.

There is one more thing: the likelihood of your shot hitting the rabbit when you fire at the window is $1/2$.

• Will the rabbit always move between windows, or randomly decide whether or not to change windows? – George V. Williams Mar 30 '13 at 21:29
• Hi George, the choice is random, but overall the chance that rabbit will be found in window A at any given time is 8/9. – VJune Mar 30 '13 at 21:38
• For b) I'd say shoot window A every time. a) is a bit more complicated. – DarkLightA Mar 30 '13 at 21:42

As stated in a comment, for b) always shoot at window $A$.

For a), if you shoot $n_A$ times at window $A$ and $21-n_A$ times at window $B$, your chance of hitting the rabbit is

$$\frac89\left(1-\left(\frac12\right)^{n_A}\right)+\frac19\left(1-\left(\frac12\right)^{21-n_A}\right)\;.$$

Setting the derivative with respect to $n_A$ to zero yields

$$\frac89\left(\frac12\right)^{n_A}=\frac19\left(\frac12\right)^{21-n_A}$$

and thus

$$8=2^{2n_A-21}$$

with solution $n_A=12$, so you should fire $12$ times at window $A$ and $9$ times at window $B$.

• Thanks. Its just that on the surface situation (a) and (b) just do not look very different, and more so when you take into account that probability of rabbit being found in window A at any given time is same in both cases. – VJune Mar 30 '13 at 23:11
• But ofcourse I agree with your solution. Probability is just funny perhaps. – VJune Mar 30 '13 at 23:12