Main content
Course: Statistics and probability > Unit 9
Lesson 1: Discrete random variables Random variables
 Discrete and continuous random variables
 Constructing a probability distribution for random variable
 Constructing probability distributions
 Probability models example: frozen yogurt
 Probability models
 Valid discrete probability distribution examples
 Probability with discrete random variable example
 Probability with discrete random variables
 Mean (expected value) of a discrete random variable
 Expected value
 Mean (expected value) of a discrete random variable
 Expected value (basic)
 Variance and standard deviation of a discrete random variable
 Standard deviation of a discrete random variable
© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Probability with discrete random variable example
Example analyzing discrete probability distribution.
Want to join the conversation?
 But... if you calculate P(2) as 0.8 (or the 'missing chance' in the first pack) times 0.2 (the 'finding chance' in the second pack), obtaining 0.16 probabilities of him buying 2 packs, I will suppose I have to do 0.8 * 0.8 * 0.2 obtaining 0.128 to calculate the probabilities of him buying three packs.
So...why isn't it 0.8*0.8*0.8*0.2 = 0.1024 probabilities of him buying four packs?
Because here you have all the potential probabilities of him buying more than four packs if he could...I guess, but I'm not grasping it clearly. How can I calculate that? Or what is a clearer way of thinking about it?(52 votes) So the key to understanding this solution is to realise that there are actually 5 possible outcomes here. i.e. X=1 because the first card is his favorite
X=2 because the 2nd card is his favorite
X=3 because 3rd card is his favorite
X=4 because 4th card is his favorite
and
X=4 when 4th card is NOT his favorite but he has to stop anyway (because of no money)
Thus using the reasoning you supposed, the probabilities are calculated as follows:
P(X=1) = 0.2
P(X=2) = 0.8*0.2= 0.16
P(X=3) = 0.8^2*0.2 =0.128
P(X=4) = 0.8^3*0.2 +0.8^4 =0.512
The key is to realize that X=4 is composed of two possible outcomes i.e. he either gets his favorite card on the 4th try.... or he doesn't but still has to stop after the 4th try.(93 votes)
 I think you have a mistake in the way you explain there.
P(X=4) = 0.8*0.8*0.8*0.2 = 0.1024
But don't forget that there is still P(X=5), P(X=6), P(X=7), ... . It's just that our main character here (Hugo) can only buy 4, but it's still a probability that he finally get his fav player card on the tenth try right? And all of that P(X=x) , with x is a positive real number, will sum up to 1. Lets ask Sal to further explain this in another video. SO we know that :
P(X=1) + P(X=2) + P(X=3) + ... = 1
The question is P(X>=2), so you will add P(X=2) + P(X=3) + P(X=3) + ... . By using the equation of the sum of all possibilities, we can get :
P(X=1) + P(X=2) + P(X=3) + ... = 1
P(X=2) + P(X=3) + ... = 1  P(X=1)(7 votes) There's no mistake in the video.
You're misinterpreting P(X=4) to mean the probability that Hugo gets the card he wants in the fourth pack (and not the first 3). That isn't correct. P(X=4) is the probability that Hugo buys 4 packs, regardless of whether the 4th pack contains the card or not.
P(X=5), P(X=6), etc will all be zero, because Hugo can't buy more than 4 packs.
In other words, P(X=4) is the probability that the Hugo gets the card in the 4th pack plus the probability that he doesn't get the card at all.
Here's a tree that might help:
 
 P(card)  P(not card)
 = 0.2  = 0.8
 
P(X=1) 
= 0.2  
 P(card)  P(not card)
 = 0.2  = 0.8
 
P(X=2) = 
0.8 * 0.2  
= 0.16  P(card)  P(not card)
 = 0.2  = 0.8
 
P(X=3) = 
0.8^2 * 0.2  
= 0.128  P(card)  P(not card)
 = 0.2  = 0.8
 
P(card in pack 4) P(didn't get card)
= 0.8^3 * 0.2 = 0.8^4
= 0.1024 = 0.4096
\ /
\ /


P(X=4) =
0.1024 + 0.4096
= 0.512(133 votes)
 I think the probability of Hugo getting the card that he wants is 0.2 in the first purchase because they said that each pack has probability 0.2 of containing the card Hugo is hoping for.
If he didn't get it in the first pack purchase, he can buy another pack (because he has the money to buy up to 4 packs). The probability of him getting the card that he wants in the second pack purchase is 0.16 (because if he didn't get it in the first one, we know that the probability of him getting the card is 0.2, of course it also means that the probability of him not getting it is 0.8), so 0.8 (probability of not getting it on the first purchase) x 0.2 (new hope or the probability of getting the card on the third pack that he is about to purchase) = 0.16. We use the general multiplication rule of probability because we're dealing with a dependent probability. Also, I quoted this from article on Khan Academy titled "The general multiplication rule": "When we calculate probabilities involving one event AND another event occurring, we multiply their probabilities. In some cases, the first event happening impacts the probability of the second event."
We assume that his only goal is to get that one card (the card of his favorite player). Suppose that he doesn't have the reason to purchase the cards packs other than getting the card. So, if he purchase another pack, it definitely means that he didn't get it in the previous pack. The probability of getting it in the third purchase is 0.8 (he didn't make it in the first purchase) x 0.8 (he didn't make it in the second purchase) x 0.2 (new hope or the probability of getting the card on the fourth pack, it would be the last hope because he can only afford up to 4 packs).
The probability of him getting it on the fourth card = 0.8 (he didn't make it on the first purchase) x 0.8 (he didn't make it on the second purchase) x 0.8 (he didn't make it on the third purchase). We don't multiply it with 0.2 (0.2 is the new hope or the probability of getting the card for each pack, 0.8 is the probability of NOT getting the card for each pack) because he can't afford to buy more packs. He can only afford up to 4 packs, we only multiply 0.2 if there we plan to purchase another pack (because the 0.2 is the probability of getting the card in the upcoming purchase), which we will not do because Hugo can't afford more than 4 packs. Even if he didn't get the card that he wants on the last purchase (in this case, the fourth purchase), he can't purchase another pack anymore because he can't afford it. So, he stops there.
If you add up all of the probabilities, they will add up to 1 (or 100%, since 100 percent is just 100/100). That is because it is established in the first place that he can only buy up to 4 packs, that's why it makes sense that it will add up to 100%. This is what we call discrete probability. A discrete probability distribution counts occurrences that have countable or finite outcomes (this definition is from Google, sorry). In this case, Hugo can only purchase up to 4 packs, so it's finite. That's why if we add up all of the probabilities, it adds up to 1.
If he don't have any constraints (for example, he doesn't have budget limit and he can buy it continuously), you can see that every purchase, if we add up all of the probabilities, it's more closer and closer to 100% or 1 but never 1. So, for all probabilities to be able to reach 1 or 100%, it has to be fixed/established how many packs you can purchase to make the probabilities add up to 100%.
For example, if we don't stop at 4 packs, the probability of getting the card in the fourth purchase is 0.8 (he didn't make it on the first purchase) x 0.8 (he didn't make it on the second purchase) x 0.8 (he didn't make it on the third purchase) x 0.2 (new hope or the probability of getting the card on the next purchase), and so on. You keep doing that continuously because in that case where you don't have limits, you will do it infinitely and the probabilities will never add up to 100% or 1.3:23"This seems like a high probability, there is more than 50% chance that he buys 4 packs. But, you have to remember that he has to stop at four. Even if on the fourth he doesn't get the card he wants, he still has to stop there. So, there's a high probability that that's where we end up." means that there is 20% probability of him stopping there after the first purchase because he got the card on the first purchase (because we assume that he only buys the pack of cards just to get that one card and there's no other reason for him to purchase any packs if he got it on the previous purchase), 16% probability of him stopping there after the second purchase because he got the card on the second purchase, 12.8% probability of him stopping there after the third purchase because he got the card on the third purchase, and there is 51.2% probability of him stopping there after the fourth purchase because he got the card on the fourth purchase AND there is also the probability that he only stops there (even if he didn't get the card at all) because he just can't afford any pack of cards anymore. So, the difference of the fourth purchase compared to the first, second, and third purchase is that the on the fourth purchase, there is also probability that he only stops there because he can't afford any pack of cards anymore, while if he stops at the first, second, or third purchase, that is definitely because he got the card and doesn't have to purchase any pack of cards anymore (assuming that he will not stop at less than 4 purchase if he hasn't got it). So, that's why the probability of him stopping there at the fourth purchase is relatively high. Please correct me if I'm wrong and sorry for the bad grammar!(13 votes)  I have been watching this for the past 1 hour. I do not understand the part 0.8 . 0.2 where X=2. Any idea how that became 0.16?(6 votes)
 Hopefully, this comment helps anyone who is confused with the problem. It is best that you read the whole comment because you may become confused if you do not. For anyone who did not know, when finding the probability of two or more events you multiply the first probability to the next probability; you follow this step consecutively with all given probabilities, multiplying each probability to the next probability and including all previous probabilities in an expression. The key to this problem is recognizing that 20% or 0.2 applies to both the probability of Hugo purchasing one pack—P(1) = 0.2—and the chance of him obtaining his favorite card in any pack; the given probabilities are the probabilities of Hugo purchasing the corresponding number of packs—P(2) = 0.16, P(3) = 0.128, & P(4) = ?—not the probability of Hugo obtaining his favorite card if he purchases packs collectively. In any given pack there is a 80% or 0.8 chance of it not having Hugo’s favorite card and a 20% or 0.2 chance of it having the card; TWENTY PERCENT AND EIGHTY PERCENT, REGARDING THE CHANCE OF HUGO’S FAVORITE CARDS, ARE FACTORS IN THE EXPRESSIONS FOR CALCULATING PROBABILITY; I assume that the reason you use the card’s 80% and 20% probability to calculate the probability for the number of packs after one is because they are the only constant feature of this problem. (If anyone can better explain my assumption please do so.) If Hugo does not obtain the card in pack one, he will purchase another pack, so you would calculate the probability of him purchasing a second pack by 0.8 x 0.2; you would say 0.8 x 0.2 since Hugo “fell into” the 80% with pack one (which acts as a factor when calculating the probabilities of each pack ) and he is hoping to “land in” in the 20% (another factor when calculating probability) with the next pack; this is why the probability for pack two is 0.16. Remember that every time you calculate the probability for a succeeding pack, you include 0.8 as a factor for each previous pack since calculating the probability for a succeeding pack means that Hugo did not obtain his favorite card in the previous pack. So, the expression for pack three would look like 0.8 x 0.8 x 0.2 = 0.128. Actually, none of the information above was needed to solve the problem; it just helps you understand the given information more. The problem—Find the indicated probability [of] P( X >_ 2 )= _ [I tried my best to show the eaquation in text] )— indicates that you are to find the collective probability of two packs, three packs, and four packs, excluding the first pack in the process. So, since we are expected to know that all the possibilities aggregately equal 100% or 1 and since we are only finding the probability of two packs and greater, you exclude the probability of pack one and subtract it from 1, which leaves you with 80% or 0.8. So, automatically, the probability (answer) for P ( X >_ 2 ) = 0.8. If you subtract the probabilities of pack two and pack three each from 0.8, you find that you are left with 0.512, the probability of Hugo ultimately buying four packs. Some people confuse 0.1024 as being the probability of four packs; however, since Hugo’s budget limits him to 4 packs at most, 0.1024 would not be the answer; THIS WAS JUST EXTRA WORK, SO DO NOT MENTALLY CONFUSE THIS WITH YOUR ANSWER; As Sal said, this seems like a high percentage, but the limited amount of packs Hugo can purchase makes him more likely to buy a fourth pack if he did not obtain his favorite card in the first three attempts. A logical way to look at this is that Hugo would possibly be more induce to buy a fourth pack since he did not obtain the card in his three previous purchases and since his budget allows him to purchase one more pack. This comment mostly addresses the confusion from what I saw in the Questions that most people meet when watching the video. The major problem most people have is interpreting the problem, so maybe I or someone else will post a comment deconstructing the question and what you have to do.(9 votes)
 I don't understand how the instructor calculated the probability of buying 2 packs at1:01. I don't understand the logic. Can someone explain?(3 votes)
 Allow me to explain. Hugo has a 0.2 probability of getting the card he wants on any given card. Conversely, he had a 0.8 (80%) probability of not getting his desired card. So, the chances of Hugo stopping to shop after two cards is the two numbers multiplied. 0.2*0.8=0.16, which is the probability that he leaves with his card after buying a second card. Greetings from 2021, take care.(8 votes)
 Hi everyone! I have been puzzled in the same way on this exercise. My opinion is that the confusion is due to a sort of mistake in the "declaration" of the random variable: based on the description of the problem and the table given, I believe that X is not "the number of packs that Hugo buys" but "the number of packs that Hugo stops buying at"!! I mean, if you picture it this way there is no need to further explain P(1) or even P(4) for that matter. Anyway, it worked nicely for me... :)(6 votes)
 There:
Hugo wants to find his favorite is basketball card and he is willing to pay a pack of cards and check of it has his favorite player card. He will do this only 4 times., so P(X) is the probability that he might find his card in the X pack he bought. FIRST YOU NEED TO FIND THE PROBABILITY SUCCEEDING OF EACH PACK.
= Probability of missing * probability of succeeding
P(1)= Probability of succeeding= 0.2
Missing= .8
To find P(2), we have to assume he missed on P(1)
So: .8 (missed probability from p(1) * .2 ( Succeeding P(2) )
=.16
To find P(3), we have to assume he missed on P(1) AND P(2)
and So on
=.8 * .8 * .2( succeed on P(3)
= .128
P(4) same process:
=.8* .8*.8.2
=.1024(6 votes)  I hope my explanation adds little insight into the question from the video.
The way I see it:
Each pack has a 20% chance of containing Hugo's desired card.
X = Number of packs Hugo purchases.
P(X >/= 1) = 1 (100%) > Since Hugo will have to buy, at the very least, one pack to get the card.
P(X = 1) = 0.2 (20%) > The first pack he buys has a 20% percent chance of giving him his desired card because each pack has a 20% chance of containing his card.
Therefore, there is a 20% chance of him only buying one pack (X = 1) AND getting the card.
P(X >/= 2) = 1  0.2 = 0.8 (80%) > Since there is a 20% chance of him getting his desired card from any pack AND from the first pack he bought, there is an 80% chance left that he will buy 2,3 or 4 packs (Considering, there is a chance he will not get it from the first pack).
Now, throughout the rest of my explanation remember that discrete probabilities need to add up to 100%:
P(X >/= 2) + P(X = 1) = 1 or 100%
Now to explain the next part I would like to reiterate the probability which we already know:
P(Hugo getting his desired card from the first, second, third OR fourth pack) = 0.2 (20%)
We can apply the multiplication rule of probability to figure out P(X = 2):
P(X = 2) is the same as saying P(X >/= 2 AND desired card from second pack)
i.e. The probability of Hugo buying 2 or more packs AND getting his desired card from the second pack. These two events will determine IF he only buys two packs (X = 2).
We multiply the probabilities together:
P(X >/= 2 AND desired card from second pack) = 0.8 * 0.2 = 0.16 (16%)
P(X = 2) = 0.16
As a result,
P(X >/= 3) = 1  (0.2 + 0.16) = 0.64 > Since we know the probabilities for X = 1 and X = 2
And if we apply the same logic for P(X = 3) again:
P(X = 3) is the same as saying, P(X >/= 3 AND desired card from third pack)
i.e. The probability of Hugo buying 3 or more packs AND getting his desired card from the third pack. Again, these events determine IF he only buys 3 packs (X = 3).
P(X >/= 3 AND desired card from third pack) = 0.64 * 0.2 = 0.128
P(X = 3) = 0.128 (12.8%)
As a result,
P(X = 4) = 1  (0.2 + 0.16 + 0.128) = 0.512 > Hugo will not purchase more than four cards so this is the probability of him buying four packs (X = 4). We do not need to consider if he gets the card from the fourth pack since we are only looking at the probability that he buys 4 packs.
I think with these types of questions we need to consider which events we need to factor into our calculation like "Hugo has only enough money to buy 4 packs" and "Hugo buys packs UNTIL he gets his favourite card" etc.
Hope this helps anyone even a little.(5 votes)  This is a geometric model. The probability is 0.8 x 0.8 x 0.8 x 0.2 = 0.1024. The 0.8s represent a failure. The 0.2s represent getting his favorite card. The probability should decrease gradually. There should be another section saying that he never reached his goal. That section should say 0.4096 which is 1 all the other sections.(3 votes)
Video transcript
 [Lecturer] Hugo plans to
buy packs of baseball cards until he gets the card
of his favorite player, but he only has enough money
to buy at most four packs. Suppose that each pack has probability 0.2 of containing the card Hugo is hoping for. Let the random variable X be the number of packs of cards Hugo buys. Here is the probability
distribution for X. So it looks like there
is a 0.2 probability that he buys one pack,
and that makes sense because that first pack,
there is a 0.2 probability that it contains his
favorite player's card, and if it does, at that
point he'll just stop, he won't buy any more packs. Now what about the probability
that he buys two packs? Well, over here they give it
a 0.16, and that makes sense, there is a .8 probability
that he does not get the card he wants on the first one, and then there's another .2 that he gets it on the second one. So 0.8 times 0.2 does indeed equal 0.16. But they're not asking
us to calculate that, they give it to us. Then, the probability that
he gets three packs is 0.128, and then they've left
blank the probability that he gets four packs. But this is the entire discrete
probability distribution, because Hugo has to stop at four, even if he doesn't get
the card he wants at four on the fourth pack, he's just
going to stop over there. So we could actually figure
out this question mark by just realizing that
these four probabilities have to add up to one. But let's just first answer the question, find the indicated probability, what is the probability
that X is greater than or equal to two? What is the probability, remember, X is the number of packs
of cards Hugo buys. I encourage you to pause the video and try to figure it out. So let's look at the
scenarios we're talking about. Probability that our
discrete random variable X is greater than or equal to two, well, that's these three
scenarios right over here. And so what is their combined probability? Well you might want to say, hey we did figure out what the probability of getting exactly four packs are, but we have to remember that
these all add up to 100%. And so this right over here is 0.2 and so this is 0.2, the
other three combined have to add up to 0.8. 0.8 plus 0.2 is one, or 100%. So just like that we
know that this is 0.8. If for kicks we wanted to figure out this question mark right over here we could just say that
look, have to add up to one. So, we could say, the
probability of exactly four is going to be equal to one minus 0.2 minus 0.16 minus 0.128. I get one minus .2 minus .16
minus .128 is equal to 0.512. Is equal to 0.512, 0.512. You might immediately say, wait, wait, this seems like a very high probability, there's more than a 50% chance
that he buys four packs, and you have to remember,
he has to stop at four. Even if on the fourth he
doesn't get the card he wants he still has to stop there. So, there's a high probability that that's where we end up. There's a little less than 50% chance that he gets the card he's
looking for before that point.