Bayes'rule exercise with discrete random variable: 100 high-school graduates

E

ele

Guest
There are 100 graduates from a high school. Each of them decides, with a constant probability of 0.9 and independently of others, to proceed to university. Suppose that each graduate, among those who decide to enroll in a degree course, enrolls to the Computer Science course with probability 0.75 and independently of others.
Let:
X = "number of graduates that enroll at university"
Y = "graduates that enroll at the Computer Science course".

1) Find p1 = P(X = i), i ∈ [0, ..., 100]
2) Find p2 = P (Y = j), j ∈ [0, ..., 100]
3) Find p3 = P (Y = j | X = i)
4) Find p4 = P (Y = j, X = i)
5) Find p5 = P (X = i|Y = j)

My attempts:

1) For a given i (number of graduates), find the probability of them being enrolled at University: 0.9*i
2) For a given j (number of graduates), find the probability of them being enrolled at the Computer Science university: 0.9*0.75*j = 0.675*j
3) For a given j (number of graduates), find the probability of them being enrolled at computer science university given that i are enrolled at university: Bayes' rule: P(Y|X) = P(X|Y)*P(Y) / P(X) = I can't go on
4) Find probability of the event (there are Y C.S. students ∩ there are X university students): I don't know how to find this
5) Assuming there are j C.S. students, find the probability of having i studentds enrolled at university: P(X|Y) = P(Y|X)*P(X) / P(Y) = same as above

Thanks for the time and the help!


Elle
 
Hi Elle,

Unfortunately, I think you're not quite off to the right start. The probability that 'i' of the graduates will enrol in university cannot be 0.9*i. For example, suppose that all 100 of them enrolled. So this would be the case where i = 100. But 0.9*100 = 90. A probability cannot be equal to 90. It has to be a number between 0 and 1.

Remember that probabilities of independent events multiply together. So the probability that 'i' graduates would enrol in university would be 0.9^i. However, there could be many different ways of choosing i out of 100 graduates in this scenario. So you'd have to multiply the 0.9^i by the number of distinct ways of choosing i out of a set of 100.

The answer for how to properly do this is given by the binomial probability distribution. Have you learned about it?

https://en.wikipedia.org/wiki/Binomial_distribution
 
Hello j-astron, thanks for replying.
For probabilities 1) and 2) I confused "^" and "*", so it would be 0.9^i and (0.9*0.75)^j.
I don't understand why should I multiply p1 by C(100,i) and (I assume) p2 by C(100,j). The ones with Bayes' rule (if it's correct to use this method), are right?

-Elle
 
For the first point, is it possible to apply binomial distribution:

C(100,i) * 0,9^i * 0,1^100-i

?
 
Hi Elle,

Sorry for the delay in responding,

Hello j-astron, thanks for replying.
For probabilities 1) and 2) I confused "^" and "*", so it would be 0.9^i and (0.9*0.75)^j.

That looks right, in terms of what to multiply, because you're given, for a single graduate:

P(enrol in university) = 0.9
and
P(computer science | university) = 0.75

Therefore P(university AND comp. sci.) = P(comp. sci.|university)*P(university) = 0.75*0.9 = 0.675

and now (for p2) you just need to apply the binomial distribution to figure out what the probability is of getting "j" successes out of 100 independent trials, each with probability of success 0.675.

I don't understand why should I multiply p1 by C(100,i) and (I assume) p2 by C(100,j)

Okay, maybe this example will help explain that. Suppose you flip 3 fair coins in a row. You want to know, what is the probability of getting \(\displaystyle i\) heads? Suppose we want to know the answer for \(\displaystyle i = 2\). In this case we can just count all possible outcomes:

TTT
TTH
THT
THH
HTT
HTH
HHT
HHH

I count that 3/8 = 0.375 of the possibilities have two heads in them. Now suppose we used your method to compute the probability, without the C(3,i) term. We would get:

\(\displaystyle \displaystyle (0.5)^i \cdot (0.5)^{3-i} = (0.5)^2 \cdot (0.5)^1 = 0.25 \cdot 0.5 = 0.125 \)

That's the wrong answer. We computed a 1/8 chance of getting 2 heads and a tail, because we neglected to take into account that there are several ways to choose which of the coins are the two heads and which of the coins are the one tail. In fact there are (3 choose 2) = 3 ways of assigning the two heads. We need to add up all three of these mutually-exclusive possibilities to get 1/8 + 1/8 + 1/8 = 3/8. So the answer would be given by:

\(\displaystyle \displaystyle C(3,i)\cdot(0.5)^i \cdot (0.5)^{3-i} = C(3,2)\cdot(0.5)^2 \cdot (0.5)^1 = 3\cdot 0.25 \cdot 0.5 = 3\cdot 0.125 = 0.375 \)

I hope that helps explain what the binomial distribution is doing.

For the first point, is it possible to apply binomial distribution:

C(100,i) * 0,9^i * 0,1^100-i

?

Yes, as explained above, this is exactly what you need to do.
 
j-astron thanks for the reply, now I understood pretty well. My difficulty is, for a given exercise regarding the use of discrete distribution, which distribution to use.
To sum it up:


\(\displaystyle p_1=\binom{100}{i}\cdot0.9^{i}\cdot0.1^{100-i}\)
\(\displaystyle p_2=\binom{100}{j}\cdot0.675^{j}\cdot0.325^{100-j}\)
\(\displaystyle p_3=\frac{\binom{j}{i}\cdot0.75^{i}\cdot0.25^{j-i}\cdot\binom{100}{j}\cdot0.675^{j}\cdot0.325^{100-j}}{\binom{100}{i}\cdot0.9^{i}\cdot0.1^{100-i}}\) using Bayes' rule: \(\displaystyle P(Y=j|X=i)=\frac{P(X=i|Y=j)P(Y=j)}{P(X=i)}\)
\(\displaystyle p_4=\binom{100}{i}\cdot0.9^{i}\cdot0.1^{100-i}\cdot\binom{100}{j}\cdot0.675^{j}\cdot0.325^{100-j}\)
\(\displaystyle p_5=\frac{\frac{\binom{j}{i}\cdot0.75^{i}\cdot0.25^{j-i}\cdot\binom{100}{j}\cdot0.675^{j}\cdot0.325^{100-j}}{\binom{100}{i}\cdot0.9^{i}\cdot0.1^{100-i}}\cdot\binom{100}{i}\cdot0.9^{i}\cdot0.1^{100-i}}{\binom{100}{j}\cdot0.675^{j}\cdot0.325^{100-j}}\) using Bayes' rule: \(\displaystyle P(X=i|Y=j)=\frac{P(Y=j|X=i)P(X=i)}{P(Y=j)}\)

What do you think? I'm pretty sure \(\displaystyle p_1\) and \(\displaystyle p_2\) and maybe \(\displaystyle p_4\) are correct :confused:
 
Top