# Conditional Probability - Bayes' Theorem

The following question is based on conditional probability. I have been told that it requires an application of Bayes' theorem, which I understand only slightly. If possible, could someone explain the necessary steps that are required to reach the answer.

A stock market analyst examined the prospects of the shares of a large number of corporations when the performance of these stocks was investigated one year later, it turned out that 25% performed much better that the market average, 25%, much worse and the remaining 50%, about the same as the average. Forty percent of the stocks that turned out to do much better than the market were rated good buys by the analyst, as were 20% of those that did about as well as the market and 10% of those that did much worse. What is the probability that a stock rated a good buy by the analyst performed much better than the average?

• Why not apply the approach from math.stackexchange.com/questions/745646/…, I intentionally did not answer the second question, it is exactly the same, no? Commented Apr 9, 2014 at 20:05

So the first thing is to think about, and start to understand Bayes' Theorem.

You can try reading here for a start

http://en.wikipedia.org/wiki/Bayes%27_theorem

Theres lots of detail, and an example given.

It deals with conditional probability, so that is, that probability of somehthing happening, A say, given that B has already happened.

In equation form, it is writen $$P(A|B) = \frac{P(B|A) * P(A)}{P(B)}$$ which is read,

"The probability of A happening, given that B has already happened, is the probability of B happening, given that A has already happened, multiplied by the probability of A happening, all divided by the probability of B happening"

I usually try to think about these problems 'backwords', that is, start from the event we are interested in and the given condition, and then try to calculate what would be needed for that event to happen.

To think about a simple classic example. Whenever I get confused about this stuff, I always go back to this problem to set me thinking correctly.

Imagine you have three drawers, each of which has two coins inside.

Let one of the drawers have 1 silver coin, and 1 gold coin. Let one of the drawers have 2 silver coins. Let the third drawer have 2 gold coins. We don't know which drawer has the two gold coins.

Then say I tell you that I open a drawer at random, and remove a coin, at random, and that the coin turned out to be a gold coin.

Then my question is, what is the probability that I took that coin out of the drawer which had two gold coins?

That is to say, what is the probability that the coin in my hand came from the third drawer, in those described above, given that it is gold.

Well, firstly, let's think about the fact that it cannot have possibly come from the second drawer, aggreed?

So that leaves us with two options for a drawer.

Now, the easiest thing to do in these problems when there are only a finite number of outcomes is to write all possible events out.

So to get a gold coin in my hand, one of three different things could have happened.

Firstly, I could have opened the first drawer, and then picked the single gold coin, yes?

Alternatively I could have opened the third drawer, and picked one of the coins in it, the one on the left for arguements sake, yes?

Or finally, I could have opened the third drawer, and picked the other coin in that drawer, the one on the right for arguements sake, yes?

So we see that one of three things had to happen, given that I have a gold coin in my hand.

But two of those things came from the event that I am interested in, namely my coin came from the drawer that had two gold coins inside of it.

Thus we conclude that the probability is 2/3. At first, a supprising result, no!

Does that make sense?

Hopefully you understand what we go about doing better now.

Next, lets move on to your original question.

So, here we want the probability that Stock did better than average, given that it was rated a good buy.

This is the same as asking, "what fraction of those that were rated good did better than average".

So again, lets look at all the posibilities.

There are thee things that can happen to a Stock which was rated as good. It can either

a) have been rated good, and done better

or

b) have been rated good, and done average

or

c) have been rated good, and done worse

Lets say we have N Stocks. Then the cases a), b) and c) happen for (I assume you understand basic probability, yes?)

a) $$0.40 \times 0.25 N = 0.1N$$ Stocks, or b) $$0.20 \times 0.50 N = 0.1N$$ Stocks, or c) $$0.1 \times 0.25 N = 0.025 N$$ Stocks.

Thus summing these, a total of $0.225N$ Stocks were rated good.

Then those that did better were $$0.40 \times 0.25 N = 0.1N$$ of the Stock. so given that they were rated good, our probability is, $$P = \frac{0.1 N}{0.225N}$$ or $$P = \frac{4}{9} = 0.44444$$

So to recap, what we did, and the method that you should follow, is work out all the possibilties for your given condition, in this case, 'was rated good', and then take the fraction of events that you are interested in, in this case 'did better than average'.

This way of thinking will lead to far less mistakes than blindly trying to use the formula.

I hope this helps!

This is my first answer, and you said you wanted an explination of each step, so I hope I didn't go on for too long!