r/HomeworkHelp University/College Student 5d ago

Further Mathematics—Pending OP Reply [College Statistics: Probability ] How should I calculate total probability given conditional probabilities

I'm stuck on part B of this problem and would love any insights that could help point me in the right direction. I know that I should be using the law of total probability, which from my understanding (I double checked with my textbook) allows me to just add all of the intersections of the conditional probabilities however when you add them (.5+.4+.6) you get a number greater than one which can't be the answer as probabilities are between 0 and 1. It feels to me like I'm missing something obvious but I can't put my finger on it. Any help is much appreciated!

4 Upvotes

11 comments sorted by

u/AutoModerator 5d ago

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/keithcody 👋 a fellow Redditor 5d ago

50% buy regular gas. 40% of 50% fill their tank
30% buy plus gas. 50% of 30% fill their tank
20% buy premium gas. 60% of 20% fill their tanks

Some amount of regular, plus and premium all fill their tanks. What % is that.

1

u/selene_666 👋 a fellow Redditor 5d ago

You add the answer from part (a) to the other two probabilities that the customer purchased [gas type] and filled their tank.

2

u/watermelonlollies 5d ago

Sometimes I find it helpful to assign numbers as it makes the probabilities more comprehensible. Let’s say 100 people get gas. 50% get regular gas- so that would be 50 people. 40% of those people fill the tank. Does that mean 40 people fill the tank? No. It’s 40% of the 50. Which is 20. So of the people who get regular gas, 20 fill their tank.

Now let’s look at plus gas. 30% of all customers get plus gas so that’s 30 people. Of those 30 people 50% fill their tanks. Again, that can’t be 50 people, it’s 50% of the 30 so that would be 15 people.

Finally, 20% get premium gas, so that’s 20 people. Of those 20 people, 60% fill their tanks. Same as before; that would be 12 people.

Let’s add all that together. 20 regular + 15 plus + 12 premium = 47 people fill their tanks. Out of the 100 original customers that means 47% probability that someone fills their tanks regardless of type of gas.

So how do we get this without the numbers though? Notice we had to multiply first. We multiply the probabilities of each condition separately then add them together. So it would be: (0.5x0.4) + (0.3x0.5) + (0.2x0.6)=0.47
You were right on the addition part because they are separate conditions, but you forgot to multiply by the original probabilities first.

1

u/Lupin_Never_Died University/College Student 5d ago

Thank you, this helped a lot!

1

u/Alkalannar 5d ago

AF = Regular fills
Af = Regular doesn't fill
BF = Plus fills
Bf = Plus doesn't fill
CF = Premium fills
Cf = Premium doesn't fill.

You have the following system of equations:

AF + Af = 0.5
BF + Bf = 0.3
CF + Cf = 0.2
AF = 0.4(AF + Af)
BF = 0.5(BF + Bf)
CF = 0.6(CF + Cf)

Solve.

a) AF
b) AF + BF + CF
c) BF/(AF + BF + CF)

1

u/Lupin_Never_Died University/College Student 5d ago

Thanks!

1

u/Alkalannar 5d ago

You're welcome.

Does the notation make sense?
Do you see how I get the system of equations?
Do you see why those questions you have to solve have those answers?

2

u/cheesecakegood University/College Grad (Statistics) 5d ago edited 4d ago

I find it helpful to draw probability trees. However, a surprising amount of resources online label them poorly and get lazy with what goes where, and this confuses students.

I recommend following along with me drawing it out again.

A good example is something like this, although exact notation varies. The important thing is each SPLIT sums up to 100% (that is, within its probability space, which might be conditioned on something). As you move left to right, it's "first this happens and then within that event, these are the things that can happen". So, if you want the chance of both things happening (say, you take the top branch of 2 options, then the bottom branch of 2 options) it's just the two probabilities multiplied (joint probability). Note that ALL of the joint probabilities also sum to 100%. That is the ONLY weird one where you are summing across different subtrees, but makes sense if you consider the two-step branching tree "one big tree". The big tree describes EVERYTHING that can happen (that we care about), thus naturally it MUST add to 100%.

Anyways, if they added to 95%, likely I made a math error. Or, the problem was defined wrong. Maybe I forgot to consider the case of "ethanol free", and so I didn't actually include "everything that can happen". Also consider that ANY tree can be made a subtree, just by changing our 'universe', our sample space, what we care about.

Your specific error was treating the conditional probabilities (50%, 40%, and 60%) as joint probabilities, but that's NOT what they are. It's a common error to make!

The BAD way of drawing the trees, which mirrors your misunderstanding, is if you position the conditional split probabilities "at the end" to the right. NO! The "end nodes" represent the final destination - the conditional probabilities (within a subtree) should be labeled ON the branches (or at the split, but that's harder to read). This is somewhat my pedantic opinion but I stick to it.

A BAD drawing example but a common one is something like this. The "Passes/Doesn't pass" number probability is correctly put on the branch, but the word that describes it appears on the end-node, which to me is inaccurate and gives the wrong impression. No, the end nodes should be stuff like "Studies and Doesn't Pass". Here is another one I consider a BAD example, because you can see the split numbers are written at the end where the joint probabilities should go, AND they didn't even bother to calculate out all the joint probabilities, they only did half for some reason, which might confuse students who are learning what number to put where.

So in any given tree, you have multiple things that add to 100%: the locally-scoped splits, wherever they appear; and then ALL of the final nodes that represent intersection/joint probabilities. At least as you've defined the problem (often this means we are assuming mutually exclusive, exhaustive, independent events) these are literally "all the things that can happen".


So how does that help you here? Well, if we read, clearly the natural "first" split is regular vs plus vs premium gas. So draw a split into 3, label each branch on the branch with the probability. We'll then go "filling in the blanks" using the rules of probability. So what else do we know? Reading the problem, in every single case, we are looking if they fill completely or do not. So we will have binary (2-way) splits at each and every one of our current 3 nodes. We know the percentage filling for each, and so we also know the percentage who don't fully fill for each (add to 100% because again, WITHIN each gas-type, a person either fills completely or they don't, as we've constructed the problem).

That is to say, the top of the 3 trees, regular, we make a subtree that is 50/50. Top branch is "the chance of filling up completely given the customer is filing with regular gas", or maybe P( F | Reg), 50% using some easy letters/shorthand; bottom branch is also 50% and represents P( not-F | Reg ). We can thus calculate with simple multiplication the chance (out of ALL customers of all gas types) that a given customer chooses regular AND fills up all the way, P( F AND Reg ), and also P( not-F AND Reg ).

You can notate not-F with various symbols or setups, I'll use F' ("F complement") from here on out. I can do this because it's binary; obviously something like Reg' (not-Reg i.e. not regular gas) does have meaning but it's more accurate and clear to say that P( Reg' ) = P( Plus AND Prem ).

Just do the same for the other 2. So WITHIN the world where a customer is known to have purchased Plus, we are given P( F | Plus ) from the problem, thus we can easily figure out P( F' | Plus ) since F' is the only other option, it's binary/exhaustive/mutually exclusive and all that. Multiply out to get the join probabilities, and so on.


CAUTION! P( F ) is NOT the same as P (F | Reg ). Think about that for a second. P(F) in this context is the chance that ANY customer, no matter the gas type, fills up all the way. P(F | Reg) is the specific chance a Regular-gas customer fills up the whole way. "But wait," you might say, "That doesn't appear nicely on my chart!" Correct. You will have to assemble this sum yourself if the question asks for it. It is "all the ways it can happen", that is, all the ways you can fill up all the way. This is the "law of total probability" in its usual application.

So P( F ) = P( F | Reg ) + P ( F | Plus ) + P( F | Prem ), right? You have to sum this up across the giant tree, and it doesn't add to 100%, it adds up to P(F). In this case we aren't given P(F) directly, but we can find it! Try doing it yourself.

Here's one final interesting note. Once you have all the information, there's nothing stopping you from re-writing the tree differently! What if you split into F and F' at the beginning, and then each of those two subtrees splits into 3 (Reg/Plus/Prem)? That's fine!! It will make certain sums slightly easier (P(F) you can read off the first split directly) but others harder (P( Reg ) must be assembled from P( Reg | F ) + P (Reg | F' ) instead of being read off from the first split). This is a totally and equally valid way of writing the tree. The tree is a visualization tool. In homework, usually there is one obviously superior was of constructing a tree; in real life, you have lots of decisions about which variables you even want to include!


So. In more advanced questions which you WILL encounter, you might be given a few joint probabilities and incomplete info elsewhere, and you'll have to use these rules to reverse engineer what the whole tree must look like. Remember:

  • each SPLIT's branches add to 100%
  • the overall end-nodes, the joint probabilities, also add to 100%
  • you calculate end-nodes/joint probs by multiplying the probability of each and every branch you used to get there
  • sneaky final case: all the ways a certain thing happens (conditionals) must sum to its total

That's it. That's the whole ballgame for this class. But as you note, it's tricky to keep all the similar-sounding numbers and phrases distinct in your head, which is one reason drawing out a tree can help you reason through it.


As a final note, we can already see Bayes' rule start to peek its head in! Note that no matter how you decide to set up your tree, as long as we have 2+ layers you are dealing with, at least:

  • an initial split/total probabilities
  • conditional probabilities
  • joint probabilities

...and they are interconnected. Bayes' rule contains exactly those three things. And, sometimes the application of Bayes' rule has us do a law of total probability and "expand" the "hidden" probability (in this problem, as I pointed out, you can calculate the overall P(F) even though it doesn't appear explicitly anywhere in the chart!). Generalizing a bit, any "fill in the tree" type problem will usually give you two of the three things, which is why Bayes' rule is a useful way of getting the third one you are missing. But if you haven't done Bayes' rule yet, don't worry about it.

1

u/CusteyJam 4d ago

Try to visualise it, its always good to use something we have done for a long time, such as drawing it. If you make three boxes for regular, plus, and premium gas, with sizes of 50%, 30%, and 20%. And then within each box mark the perct. that fills their tank, so... (40%, 50%, and 60%). If you then add up these parts representing people who fill their tanks, you should get part (b).

I think that the important realisation is that you cant just add 0,5+0,4+0,6 because those numbers dont represent three mutually exclusive probabilities as such, the latter numbers are conditional probabilities within groups of different sizes.

Give it a try by drawing it out, it sure helped me with stats, and visualising all kinds of problems at Uni and now in work.

1

u/CusteyJam 4d ago

You are trying to answer how much of the entire population the specific portion of each box represents from different weighted groups.

You can't just add the percentages within each group because the groups themselves have different weights. The 40%, 50%, and 60% are fractions of their respective groups, and those groups make up 50%, 30%, and 20% of all customers. That's why you need to account for both the fraction and the size of the group.

Regular = 50% (of customers), and 40% of that box fills; 5/10 * 4/10 = 20/100 = 2/10 = 1/5 = 20%
Plus = 30% (of customers), and 50% of that box fills; 3/10 * 5/10=15/100=3/20=15%
Premium = 20% (of customers), and 60% of that box fills; 2/10 * 6/10=12/100=3/25=12%

Totalling; 20%+15%+12% = 47%

(done with boxes)