The law of total probability, how does it work?
It breaks up probability calculations into distinct parts.
We use it to find the probability of an event occurring when we don’t know enough about the probabilities of an event to calculate it directly. Because of that, we take a related event and use that to calculate the probability of A.
Or more formally:
And putting the two of those together you get this:
P(A) = ∑P(A∩Bₓ) = 0 + P(A∩B₂) + P(A∩B₃) + P(A∩B₄) + P(A∩B₅) + 0
Looking at the oval above, this might seem a little silly and rather obvious, but an example will help illustrate its usefulness.
Let’s say one day you’re walking down the street, and a somewhat shady-looking grandmother approaches you and asks if you’d like to play a game.
Your instinct is to run in the other direction, but you remind yourself that she’s a grandmother and that you’re much too old to be afraid of grandmothers.
She puts four coins out in front of you.
She tells you if you flip heads, you win a shiny nickel.
If you flip tails, though, she says you owe her your house.
You try to interject, but she puts her finger on your mouth. She then looks down towards her waist at what appears to be a loaf of bread and whispers the word gun to you.
Anyhow, she’s a fair woman, so she wants you to know the coins are loaded.
She tells you that:
Suppose you flip one coin at random, as in you don’t know whether you selected coin A, B, C, or D, and you flip heads. What’s the probability that you selected coin A, B, C, or D?
Well, given the info above, the probability of flipping heads for each coin can be written as the following:
Since there are four coins, there’s an equal chance of picking up each coin, meaning we can write the probability of selecting each coin like this:
Now all you have to do to figure out the overall probability of flipping heads is plug each value into the equation:
P(H) = P(H|A) * P(A) + P(H|B) * P(B) + P(H|C) * P(C) + P(H|D) * P(D)
P(H) = P(H|A) * P(A) + P(H|B) * P(B) + P(H|C) * P(C) + P(H|D) * P(D)
P(H) = P(H|A) * P(A) + P(H|B) * P(B) + P(H|C) * P(C) + P(H|D) * P(D)
Then we bring in a little Bayes’ Theorem:
And we get the following (rounded to two decimal places):
Or to put it more simply, if you flip heads:
Now the question becomes, just what pray tell should you do with this information?
Damned if I know, but I'm guessing avoiding shady-looking grandmothers would be a good start.