If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: High school statistics>Unit 7

Lesson 1: Probability distributions introduction

# 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?
• 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.
• 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)
• 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``
• 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.

"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!
• 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?
• I don't understand how the instructor calculated the probability of buying 2 packs at . I don't understand the logic. Can someone explain?
• 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.
• 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... :)
• 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
• 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.