# A and B play a series of games. Find the probability that a total of 4 games are played.

A and B play a series of games. Each game is independently won by A with probability $p$ and by B with probability $1 􀀀- p$. They stop when the total number of wins of one of the players is two greater than that of the other player.
The player with the greater number of total wins is declared the winner of the series.

(a) Find the probability that a total of 4 games are played.
(b) Find the probability that A is the winner of the series.

I though I could do this using conditional probability and independent trials/bernoulli trials but I am really confused.

let's say I want to find the probability that A wins three games and B wins 1 game and add that to the probability of B wins 3 games and A wins 1 game, but I am not sure of how to do that because B has to win at least 1 game before A wins 2.
If I set $n$ = number of games played would the sample space equal $p^n * (1-p)^n$?
How do I solve this? is there an easier way?

• For a) favourable outcomes are (ABAA, BAAA, BABB, ABBB) – math_noob Oct 23 '15 at 15:55
• yes exactly four games, i know how to do it by calculating the different possibilities, but i have to learn how to do it the right way using probability notation – idknuttin Oct 23 '15 at 16:00
• In "small" problems, often a careful listing of cases will do the job. That is true of a). For b), if it asks for the probability A ultimately wins, length of series unspecified, the analysis is more delicate. – André Nicolas Oct 23 '15 at 16:04
• to find the probability i would have to put the number of outcomes over the total number of outcomes (sample space), what would be the sample space in this situation since the game can go to infinity? how do I use a sum of a series to answer this? – idknuttin Oct 23 '15 at 16:20

I would consider two games at a time. Two games can result in AA (team A wins, probability $p^2$) or BB (team B wins, probability $(1-p)^2$) or AB, BA considered together (match is back to starting state, with probability $2p(1-p)$).

Then the probability that the match goes for four games (two pairs) is $(2p(1-p))(p^2+(1-p)^2)$, occurring when the first pair is split and the second pair is swept.

The probability that team A wins the match is $\frac{p^2}{p^2+(1-p)^2}$ since that is the ratio of team A winning to team B winning in any given round of two games.

• i understand your answer to part a but for part b I see the probability that team A wins two in a row is p^2 and you put that over the sample space p^2+(1-p)^2, why is the denominator a sample space? so if I want to find out the probability of team b winning I would simply write (1-p)^2 / (p^2 + (1-p)^2)? – idknuttin Oct 23 '15 at 20:02
• @idknuttin Yes, that is the correct probability for B winning. The reasoning is that eventually someone will win. And in the pair of games that someone wins, we are in the reduced sample space where A or B sweeps the two games; so the denominator becomes $p^2+(1-p)^2$. – paw88789 Oct 23 '15 at 20:09

The first question is best done by enumeration, as suggested in the comments.

To handle the second one:

Let's introduce the relevant states of the game. We will index these by the number of games by which $A$ is ahead. Thus we have $5$ states: $(0),(1),(-1),Win,Loss$. Let $p(state)$ denote the probability that $A$ will win if the teams are in the given state. Thus the answer we seek is $p(0)$. Obviously $p(Win)=1$ and $p(Loss)=0$. By considering the possible outcomes of the next game, we get some basic relations between the probabilities as: $$p(0)=p(1)p+p(-1)(1-p)$$ $$p(1)=1^*p+p(0)(1-p)$$ $$p(-1)=p(0)p+0^*(1-p)$$ This system is easily solved to get $$p(0)=\frac {p^2}{1-2p(1-p)}$$ As a sanity check observe that this correctly gives $\frac 12$ if $p=\frac 12$.

• if p(0) is that A is zero games ahead then why does it equal p(1)p + p(-1)(1-p)? isnt this saying that A won and B is one game behind? I dont see how you calculated p(0), p(1), and p(-1)? – idknuttin Oct 23 '15 at 16:30
• Imagine you are in state $(0)$, like at the start. You play a game. Either $A$ wins (with probability $p$) and we are in state $(1)$ or $A$ loses (with probability $1-p$) and we are in state $(-1)$. That's what the top equation expresses. The others are similar. – lulu Oct 23 '15 at 16:33
• Phrased (slightly) differently: How can $A$ win from the start, i.e. from state $(0)$? Well, there are exactly $2$ ways. Either $A$ wins the first game and then wins from state (1)...a combination that has probability $p(1)^*p$ or $A$ loses the first game and then wins from state $(-1)$....a combination that has probability $p(-1)^*(1-p)$. – lulu Oct 23 '15 at 16:37
• what method did you use to solve the system? – idknuttin Oct 23 '15 at 16:40
• To solve the system? It's just three linear equations in three unknowns...as we only cared about $p(0)$ I just used the second and third equations to eliminate $p(1)$ and $p(-1)$. – lulu Oct 23 '15 at 16:47

The first is easy.

To handle the second, as you remarked, the game can go on indefinitely, so here's another way to solve using the sum of an infinite G.P. For compactness, I will call chances of $B$ winning a game $q$ instead of $(1-p)$

The earliest win for $A$ will be at $2-0$ for with probability $p^2$, but if they reach $1-1$, it will become like "deuce" in tennis, and A will need to create a lead of $2$.

Now draw a $2D$ lattice path with paths to reach possible $A$ wins counted on the lattice. For $A$ to get 2 ahead before B does at any stage, you will find that it follows the pattern $p^2(1+2pq+4p^2q^2+8p^3q^3+16p^4q^4+......)$

which is an infinite G.P. with $a=p^2,r=2pq$, sum $= \dfrac{a}{1−r}$

Thus the probability that ($A$ wins) $= \dfrac{p^2}{1−2pq}$