00:01
In the ask -ed question, a coin with probability b of heads is flipped repeatedly.
00:06
Probability b of heads means the probability of getting head in one flip equals b and of course b is going to be between 0 and 1.
00:18
A sequence of outcomes can be divided into runs, blocks of heads or blocks of tails.
00:27
Here we have an example.
00:29
Heads, heads, heads, then we have four tails, one head, three tails, 2 heads.
00:41
Here we have 5 runs the first one has length of 3 the second 4 here we have lens of 1 for one head here we have lens of 3 and finally we have lens of 2 assume that the coin is fled at least until the start of the third run which means we have at least 2 runs we have the first run and the second run at least it's required to find the expected length of the first run and the expected length of the second run.
01:16
Let's see how to find the expected value of the first run.
01:22
Here we have two options.
01:25
The first flip to be head or a second flip to be tail.
01:31
This comes with probability p and this with probability 1 minus p.
01:37
After that we are going to count how many heads we can take until we reach tails.
01:46
Here for that example it's going to be heads heads tails and here we are going to count number of tails until we read we get hit then this is tails tails until we reach hits here the length is 3 why it's 3 because for that example it's heads heads and for that example here it's 4 tails tails tails tails this tails then heads we can see that this is the same lens of that branch heads heads tails is 3 as length of 3 and tails tails tails heads has length of 4 and we know that this has very common distribution then we can denote x or define x to be a random variable that follows a distribution with specific probability where x is the length until the first success in this case so going to follow the geometric distribution of the probability of getting tails and in that case we can define on the variable y which follows a geometric distribution sorry there is one being here geometric distribution with probability of getting hits probability of getting hits this is x here to find and here y is defined then if we want to find the expected length of the first run we can find it using conditional expectations the expected value of the first length of the first run is going to be the expected value of the length of the first run given the first flip was heads multiplied by the probability of its plus the expected value of the length of the first run given its tails multiplied by the probability of tails how to find this expectation we know that conditioning on the first one is heads this follows the length follows a geometric distribution with probability of t it is the expected value of x applied by the probability of x and this is the expected value of y to apply by the probability of getting tails the expected value of x this is geometric distribution then it's one over b one over the probability of getting tails and this is the probability of getting heads and this is the probability of getting one over the probability of getting heads multiplied by the probability of getting details let's substitute what is the probability of getting gets it's just to be what is the priority of getting tails it's going to be one minus a priority of getting gets it's one minus p and here it is 1 minus p divided by p which is the priority of getting x if you want to simplify it's going to be p multiplied by 1 minus p here and here it p squared plus 1 minus b squared all square we can keep it as it is or as in let's solve for the second part it's required to find the length of the second run using same reasoning if we started with head then the first run is going to be heads until we get one t and if we started by tails the first run are going to be heads until we get one t and if we started by tails the first run are going to be tails until we hit the first hit this here is going to be with probability b and here 1 minus b just as previous but here we are interested in the length of the second run for that branch we know that the second run must be tails then is going to be rounds of tails like that until we hit another head and here it's going to be runs of heads until we hit one tail.
07:27
This is just for illustration...