📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

The Geometric Distribution: The First Success of a Bernoulli Distribution

Steve Brunton12:56

Transcription

Welcome back. So today, I'm going to tell you about a neat distribution called the geometric distribution. So this is kind of a fun random variable, uh, that's geometrically distributed where we are trying to see what is the first success in N random trials.

So imagine I'm flipping a coin. Uh, what is the probability distribution of the first heads being on the nth coin flip? I'm going to say this again, cuz it's a little bit of a mouthful, and it's kind of a strange thing. It turns out to be a really easy probability to calculate, but it doesn't sound like it would be that easy. So this is all about, um, the first success. First success in N trials. Okay.

So we know that we can have these n, uh, n Bernoulli trials. So we have a sequence, uh, of Bernoulli events. Bernoulli events. And I might actually remove this n here. We just have a sequence of of, uh, Bernoulli events, meaning they can either be a zero or a one. This random variable can only be a zero or a one depending on if the thing I'm looking for happened or didn't happen. So I could roll a dice, and maybe I'm looking for fives. You know, I'm rolling the bones; I need fives. Then, then my Bernoulli event would be a one if I get a five and a zero if I don't get a five, and there's some probability associated. So I have a sequence of Bernoulli events with probability P. Okay.

So in the case of rolling a five, my probability P would be 1 and 6. What is the probability? What is the probability that my first success, that the first success, meaning first Bernoulli variable that equals one, my first Bernoulli variable that equals one, uh, occurs on the nth trial? Now that sounds like kind of a weird thing to compute, but it actually sounds useful also. So I'm rolling, you know, I'm rolling dice. What is the probability that it takes me n times before I get the thing I'm looking for? I'm looking for fives. What's the probability it takes me 10 rolls to get a five? Okay. And it turns out that this is actually a pretty easy probability to compute.

So the probability—I'm just going to write this out—the probability of the first success on the nth trial, just going to write it like this: first success on the nth. The only way that that can happen, um, and this is the first success on exactly the nth trial, not at least the nth. So I want exactly the nth trial to be my first success. The way that that can happen is basically I have to fail; I have to have not success. My Bernoulli var, my Bernoulli, uh, events all have to be zeros; they all have to be failures until the nth trial. So that means the probability that my first trial is a failure—this is shorthand, meaning my first Bernoulli event was a failure—and my second Bernoulli had to be a failure, and dot dot dot, and my n minus oneth Bernoulli event had to be a failure, and my nth trial had to be a success. I had to have success on my nth trial. And remember these are independent; uh, these are independent. It's really important: independent Bernoulli trials, like flipping a coin or rolling dice or, you know, playing roulette or whatever. And so the probability of all of these things happening is the product of the probability of each of them happening. That's how independent probabilities work, is that the probability of all of these things happening, you know, uh, in conjunction is the product of all of them happening in isolation. So this equals the probability of my first trial failing times the probability of my second trial failing times dot dot dot times the probability of my, uh, n minus oneth trial failing times the probability of my nth trial being a success. And again, what I mean here, this failure notation, this is shorthand. F2 just means that my Bernoulli, my second Bernoulli variable was a zero, and success n, that means that my nth Bernoulli variable was a one. These Bernoulli events can take values zero or one. Really, really simple, good. And these probabilities are really, really easy. If success is probability P, then, uh, failure—so this is, uh, kind of success being probability P, then failure is probability 1 minus P. So this equals 1 minus P to the n minus 1 because I had n minus one non-successes, failures with probability 1 minus P, times the probability of success here is P. That's it. That's the that's the formula for the geometric, uh, distribution. Pretty cool. And sometimes I can use shorthand, and I can call this Q to the n minus 1 * P, where Q is just 1 minus P. It's the probability of my event failing. Okay, good.

Um, and that's essentially it. So we would say X is distributed as a geometric variable; it has a geometric distribution if you like, with parameter P. There's only one number I need to specify this geometric distribution: if the probability of big X equaling some little n, some integer n, is Q to the n minus 1 * P. So this is the definition of my geometric, uh, distributed random variable X, and this is pretty useful. This seems like I can actually use this to compute some pretty useful probabilities: the probability of my first dice roll, um, of which roll my first five will occur on, that's geometrically distributed, and this is a pretty easy formula. Okay, good.

Uh, so I want to do just one really, really simple example. Um, I'm going to do it here. So my example is going to be—so this is for the probability that my first success is at exactly the nth trial. What if I want to know, um, what is the chance that it takes me at least 10 dice rolls to roll a five? So what is my probability it takes at least 10 rolls of a d, d dice, of a d of dice to roll a five? Okay. So this is a probability that we're going to compute right now using this geometric formula. It's really, really simple. So the answer—maybe I'll use blue here—is the probability that x, uh, equals—so this is the probability of of taking n rolls to roll a five—is geometric with parameter P equal 1, 1/6. Okay. So maybe I should actually write this like—I'll write it down here—so X is geometrically distributed with parameter 1 and 6 because there's a one in six chance that I'll roll a five with each of these. These were newly independent random trials. So the probability that X is at least is greater than or equal to 10, that's kind of interesting. It is the sum—this is the sum of P of X exactly equal to 10 plus the probability of X exactly equal to 11 plus the probability of X exactly equal to 12 plus dot dot dot forever and ever and ever. That's what this is. So if it takes at least 10 rolls, it could happen on the 10th, it could happen on the 11th, the 12th, and so on and so forth. And for each of these, there's a very simple formula here that I can use. So the probability that it takes, uh, 10 is Q to the, uh, 10 minus 1, that's Q to the 9, uh, times P. The probability that my first, uh, roll of a five is on the 11th roll, that is Q to the 11 minus 1 is 10 * P plus dot dot dot Q1 P plus Q2 P plus, and this is kind of a sequence that we can work with. We can work with this probability here. So this equals—I'm going to pull out Q to the 9—so this is Q to the 9, Q to the 9, uh, times P, Q to the 9 * P * 1 + Q + Q to the 2 + Q cubed plus dot dot dot dot dot. And Q is less than one, so this is a geometric sequence, and this equals Q to the 9 P over 1 minus Q. And I'm sorry that my Qs and my 9s look really, really close. I really should have picked a different number here because my Qs and my 9s look almost identical. This is a Q. This is a Q. This is a 9. Okay, good. So this is the answer. This is the way of getting this sum. And remember, 1 minus Q is just P. 1 minus Q is the probability that that P didn't, that my event didn't happen. So P / 1 - Q, this is just equal to to P over 1 - Q is 1, so this equals Q to the 9th power. Q to the 9th power is the probability that my first five is on at least the 10th roll. Okay, uh, and you can actually compute this. So the probability P is 1 and 6, so Q is 5/6. 5/6 to the power 9, not to the power, Q to the power 9, to the power 9, uh, is a number that you can actually compute. Okay. So you should, you know, try this out and compute this. Maybe this will be a homework problem is to actually, you know, compute the number. What is the percentage chance that it takes at least 10 rolls to roll a five? Okay, good.

Um, there is a pretty easy other way of computing this. The other way of computing this, um, there is another way, another way, Skywalker, is the probability of it taking at least 10 rolls for this dice to roll a five would be equivalent to there being no successes on the first nine rolls. That's that's the equivalent probability. This is equivalent to there being no successes on the first nine rolls. So the probability of, uh, first success after ninth roll is equal to the probability of no successes on first nine rolls, and that's actually really easy. The probability of no successes on the first nine rolls is just the probability of failure times 9, or Q to the power 9. This is Q to the 9th power, which is what we got here using this formula here. So these are equivalent. Um, what I really want you to take away from this is that there is this cool distribution called a geometric distribution. It has a really simple formula, and it tells you what is the probability that your first success on a series of Bernoulli random trials happens on the nth trial, and you can use it for all kinds of cool calculations, uh, and probabilities. Okay, thank you.