# Conditional probability of being in a certain group of students

Assume that the class consists of 45 percent freshmen, 5 percent sophomores, 40 percent juniors, and 10 percent seniors. Assume further that 45 percent of the freshmen, 40 percent of the sophomores, 20 percent of the juniors, and 30 percent of the seniors plan to go to medical school. One student is selected at random from the class.

(1) What is the probability that the student plans to go to medical school?

(2) If the student plans to go to medical school, what is the probability that he is a junior?

### Progress

I keep getting $.5125$ for number one and can't figure out why the computer system keeps telling me it's wrong. I really need help on this. Thank you in advance for your help!

You asked about the first question, so I'll respond to that one only. The second one is a different question. Use what you know about conditional probability for that one.

It's a good idea to always do a sanity check on your result. This is easy to do with probabilities.

For (1), your result is 0.5125. Note that this corresponds to 51.25%. But none of the groups of students want to go to medical school that badly! The largest proportion of wannabe doctors is among the freshmen --- 45%. It's lower for the other groups. So if you pick one student out of the high school, then the probability of picking a student that wants to go to medical school can't be more than 45%. So 51% is way too high, so it's wrong.

The right way to do that computation is using the linearity of expectation. Read about the details. What it boils down to is that you'll want to multiply and add the probabilities like this:

\begin{align} P = &(\text{probability student is a freshman}) \cdot (\text{probability freshman wants to go to medical school})\\ &+ (\text{probability student is a junior}) \cdot (\text{probability junior wants to go to medical school})\\ &+ \ldots\\ &+ (\text{probability student is a senior}) \cdot (\text{probability senior wants to go to medical school}). \end{align}

So:

$P = 0.45 \cdot 0.45 + 0.05 \cdot 0.40 + 0.40 \cdot 0.20 + 0.10 \cdot 0.30 = 0.3325$

Perform your own sanity check. Does this look reasonable? Look at the proportions of the students. 40% the students are juniors, but only 20 percent of them want to go to medical school. Otherwise, 45% of the students are freshmen, 45% of whom want to go to medical school. Those are 85% of the students. The average percent that wants go to medical school is somewhere in the low 30's. The other 15% want to go to medical school between 30 and 40%. So a low-30 answer can be expected. So $0.3325 = 33.25%$ sounds reasonable.

to be comprehended, I'll introduce $A1$ the event "He is a freshman", $A2$ "He is a sophomore", $A3$ "He is a junior", $A4$ "He is a senior" and $X$ "he goes to medical school". Informations you have : $P(X\vert A1)=0.45$, $P(X\vert A2)=0.4$, $P(X\vert A3)=0.2$ and $P(X\vert A4)=0.3$. And by the way, you know $P(A1)$, $P(A2)$, $P(A3)$ and $P(A4)$.

You first question is to determine $P(X)$, you can then use : $P(X)=\sum\limits_{i=1}^{4}P(X\vert Ai)P(Ai)$

For you second question, you have to determine $P(A3\vert X)$ and for this, you can use the Bayes' theorem (or formula).