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$.