If A and B are independent sequences of Bernoulli trials w/ different p, what is the probability that success occurs in A before success occurs in B?

327 Views Asked by At

Suppose a sequence of Bernoulli trials continues until a success occurs. For two independent such sequences, say $A$ and $B$, with respective success-probabilities $a$ and $b$, what is the probability that $A$ is shorter than $B$?

Here's an example of what I mean: Suppose that I have two unfair coins. Coin 1 has a probability of coming up heads of $\frac{1}{3}$, and coin 2 has a probability of coming up heads of $\frac{2}{3}$. I flip both coins at the same time. What is the probability that Coin 1 is heads before coin 2? Let $C_n$ be the number of flips it takes coin $n$ to come up heads.

$P(C_1<C_2) = ?$

3

There are 3 best solutions below

0
On

The most straightforward approach is to sum a series. Instead, we will condition on the results of the first toss. Let $a$ be the probability Coin 1 lands head, and let $b$ be the probability Coin 2 lands head. Let $x$ be the probability Coin 1 lands head before Coin 2 does.

If on the first toss Coin 1 lands heads, and Coin 2 does not, then Player $1$ has won. This has probability $a(1-b)$.

Player 1 can also win if both coins land tail on the first toss, but Player 1 still ultimately wins. The conditional probability Player 1 ultimately wins given both got tails on the first toss is $x$. Thus, by the Law of Total Probability, $$x=a(1-b)+(1-a)(1-b)x.$$ Solve for $x$.

0
On

We solve it by using the same basic principles used to find the probability mass of a geometric series.

$C_1$ will happen before $C_2$ if: there are numerous events in which neither occurs followed by an event which the first coin shows heads and the second does not.

$$\begin{align}\mathsf P(C_1< C_2) ~=~& \sum_{k=0}^\infty (1-p_{1\cup 2})^k p_{1\cap 2^\complement}\\[1ex] ~=~& p_1(1-p_2)\sum_{k=0}^\infty (1-p_1-p_2+p_1p_2)^k\\[1ex] =~&\dfrac{p_1(1-p_2)}{p_1+p_2-p_1p_2} \\[1ex] =~& \dfrac{(1/3)(1-2/3)}{1/3+2/3-2/9}\\[1ex] =~& \dfrac{1}{7}\end{align}$$

If we do not exclude the event of a tie

$$\begin{align}\mathsf P(C_1\leqslant C_2) =~&\dfrac{p_1}{p_1+p_1-p_1p_2} \\[1ex] =~& \dfrac{3}{7}\end{align}$$

8
On

A simple simulation of $100,000,000$ cases where the $1/3$rd probability coin gets heads before the $2/3$rds probability coin is showing very close to $1/7$. I got $14,287,277$ which is very close to $14,285,714$ expected value. Note that the Rand() function, (with no parameter passed), returns a real number between $0$ and $1$.

* A program to check the probability of a 1/3rd probability head biased coin coming up heads before a 2/3rds
* probability head biased coin comes up heads if both are tossed simultaneously multiple times.

sec = SECONDS()  && check the timer so we get the start time and check how long program takes to run.
=RAND(-1)        && initialize random number generator to give different random sequence each time program runs.
good = 0         && counter for # of times 1/3rd bias coin comes up heads before 2/3 bias coin.
its = 100000000  && 100 million iterations should be enough.

FOR i = 1 TO its
 STORE .f. TO c1h, c2h     && c1h = flag for coin 1 is heads.  .f. = false.
 DO WHILE !c1h AND !c2h    && loop while both coins are tails.
  c1h = INT(3*RAND()) = 1  && 1 chance  in 3 of this being true.
  c2h = INT(3*RAND()) # 1  && 2 chances in 3 of this being true.
  IF c1h AND !c2h          && coin 1 is heads but coin 2 is tails.
   good = good + 1         && that is a winner.
  ENDIF
 ENDDO
NEXT i

? good, SECONDS() - sec  && ? means show to the screen (standard output).

Runtime was about $2$ minutes and output was $14287277$ and $125.302$ (seconds).