Your roommate, who's a bit of a slacker, is trying to convince you that money can't buy happiness, citing a Harvard study showing that only 10% of happy people are rich.
After giving it some thought, it occurs to you that this statistic isn't very compelling. What you really want to know is what percent of rich people are happy. This would give a better idea of whether becoming rich might make you happy.
Bayes' Theorem tells you how to calculate this other, reversed statistic using two additional pieces of information:
The percent of people overall who are happy
The percent of people overall who are rich
The key idea of Bayes' theorem is reversing the statistic using the overall rates. It says that the fraction of rich people who are happy is the fraction of happy people who are rich, times the overall fraction who are happy, divided by the overall fraction who are rich.
So if
40% of people are happy; and
5% of people are rich
And if the Harvard study is correct, then the fraction of rich people who are happy is:
(10%) * (40%)/(5%) = 80%
So a pretty strong majority of rich people are happy.
It's not hard to see why this arithmetic works out if we just plug in some specific numbers. Let's say the population of the whole world is 1000, just to keep it easy. Then Fact 1 tells us there are 400 happy people, and the Harvard study tells us that 40 of these people are rich. So there are 40 people who are both rich and happy. According to Fact 2, there are 50 rich people altogether, so the fraction of them who are happy is 40/50, or 80%.