What is the probability of getting r heads before s tails?

  • Thread starter Thread starter Eclair_de_XII
  • Start date Start date
  • Tags Tags
    Probability
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
37 replies · 9K views
So is it ##\frac{p}{q}(\frac{1-q^{s-1}}{p})=\frac{1-q^{s-1}}{q}##, then...?
 
Physics news on Phys.org
Eclair_de_XII said:
So is it ##\frac{p}{q}(\frac{1-q^{s-1}}{p})=\frac{1-q^{s-1}}{q}##, then...?

I'm not sure how you're getting to this? You should be able to telescope this quite easily. I wrote out the derivation in a couple of lines but I decided not to post it yet. You need to show some work here.
 
This is how I'm getting it: ##\sum_{k=1}^{s-1} pq^{k-1}=\frac{p}{q}\sum_{k=1}^{s-1} q^{k}=\frac{p}{q}(\frac{1-q^{s-1}}{1-q})=\frac{p}{q}(\frac{1-q^{s-1}}{p})##.
 
Eclair_de_XII said:
This is how I'm getting it: ##\sum_{k=1}^{s-1} pq^{k-1}=\frac{p}{q}\sum_{k=1}^{s-1} q^{k}=\frac{p}{q}(\frac{1-q^{s-1}}{1-q})=\frac{p}{q}(\frac{1-q^{s-1}}{p})##.

Two fundamental issues:
1.) You still have not shown your work for the telescoping process
2.) ##\sum_{k=1}^{s-1} q^{k}\neq (\frac{1-q^{s-1}}{1-q})##
this obviously cannot be true. Selecting ##q = 0## doesn't work because ##0 \neq 1##. Now select some small ##\delta \gt 0## and set ##q := \delta##. The left hand side is approximately 0 while the right hand side is approximately 1. This is not an equality.
 
I don't know what you mean by telescoping process. Do you mean that the finite sum is a telescoping series?
 
Eclair_de_XII said:
I don't know what you mean by telescoping process. Do you mean that the finite sum is a telescoping series?

I mean show your work such that you telescope a series with ##s-1## terms in it and convert it into a fraction that has much less terms. I have not seen your work here. My sense is you're just guessing or otherwise skipping steps.
 
it's killing me here because your post 25 and 27 are so close and I think you're within shouting distance of the finish line. All I'm getting at is

we have ## p \in (0,1)## and ##q = 1-p##, referencing the left side of post 30

##y:= \sum_{k=1}^{s-1} pq^{k-1} = p\big( 1+ q + q^2 + ... q^{s-2}\big) ##

I created ##y## for convenience. What you actually want is ##y \cdot P(E|H_1) = P(E|H_1)\cdot p\big( 1+ q + q^2 + ... q^{s-2}\big) ##, so we'll just multiply by ##P(E|H_1)## at the end.

the magic of telescoping is, we find some pattern in the sum and exploit it.

In this case, multiply each side by ##(1-q)## noting that ##(1-q) \gt 0##, so you get

##(1-q)y = (1-q) p\big( 1+ q + q^2 + ... q^{s-2}\big) = p\big( 1 - q^{s-1}\big) ##

divide each side by ##(1-q)## and get

##y =\frac{ p\big( 1 - q^{s-1}\big)}{1-q} = \frac{ p\big( 1 - q^{s-1}\big)}{p}= 1 - q^{s-1}##

so you what you're looking for is
##P(E|T_1) = y \cdot P(E|H_1) = P(E|H_1) \big(1 - q^{s-1}\big) ##
- - - -
If you swap this into your second line on post 16, and solve the system of equations good things should happen...
 
First of all, I'm so sorry for being so clueless about finite sums and geometric series; Calculus II was so very long ago for me, and from what I remember of the class, I covered mostly infinite series. Anyway:

##P(E|H_1)+(p^{r-1}-1)P(E|T_1)=p^{r-1}##
##(q^{s-1}-1)P(E|H_1)+P(E|T_1)=0##

##A= \begin{pmatrix}
1 & (p^{r-1}-1) \\
(q^{s-1}-1) & 1 \\
\end{pmatrix}##

##det(A)=1+(1-q^{s-1})(p^{r-1}-1)##

##A^{-1} = \frac{1}{det(A)}\begin{pmatrix}
1 & (1-p^{r-1}) \\
(1-q^{s-1}) & 1 \\
\end{pmatrix}##

##\begin{pmatrix}
P(E|H_1) \\
P(E|T_1) \\
\end{pmatrix}
=\frac{1}{det(A)} \begin{pmatrix}
1 & (1-p^{r-1}) \\
(1-q^{s-1}) & 1 \\
\end{pmatrix} \begin{pmatrix}
p^{r-1} \\
0 \\
\end{pmatrix} =\frac{1}{1+(1-q^{s-1})(p^{r-1}-1)}\begin{pmatrix}
p^{r-1} \\
p^{r-1}(1-q^{s-1}) \\
\end{pmatrix}##

So ##P(E)=\frac{p^r+qp^{r-1}(1-q^{s-1})}{1+(1-q^{s-1})(p^{r-1}-1)}##
 
  • Like
Likes   Reactions: StoneTemplePython