Finding density and distribution functions

74 Views Asked by At

I have been trying to understand probability by attempting past paper question and I have been stuck on this question all day and night. I am not quite sure how to go about finding the functions needed. Can anyone assist me?

There are two red balls and five green balls in a box. Three balls are selected simultaneously and at random. A random variable X is defined as the number of red balls selected.

(a) Find the density and distribution functions of X.

(b) Given a random variable U uniformly distributed on [0,1), describe how to construct the sequence vi distributed as X.

(c) Explain how you would simulate 100 draws of three balls from the box and find the average number of red balls drawn.

1

There are 1 best solutions below

0
On BEST ANSWER

The number of ways to draw $k$ objects out of a bag of $n$ total objects is $\binom{n}{k}$. For instance, $\binom{4}{2} = \frac{4!}{2!2!} = 6$ counts the number of ways to draw two objects out of a bag of four objects. If the objects were A, B, C, and D, you could draw AB, AC, AD, BC, BD, or CD.

If you have two bags, with $n_1$ and $n_2$ objects, and you draw $k_1$ and $k_2$ objects out of those two bags, respectively, then the number of ways you can do that is given by the product of the two binomials: $\binom{n_1}{k_1}\binom{n_2}{k_2}$. So, for example, there are

$$ m_1 = \binom{2}{1}\binom{5}{2} = 2 \cdot 10 = 20 $$

ways to draw one of the two red balls and two of the five green balls. Do the same for the two other combinations of three balls ($m_0$ for zero red and three green, and $m_2$ for two red and one green). The total number of ways to draw three balls from seven balls is $M = \binom{7}{3} = 35$. So then the probability distribution $p_x = P(X = x)$ of the number of red balls drawn is given by

$$ p_x = \frac{m_x}{M} $$

You should validate your answers for $m_0$ and $m_2$ by checking that $m_0+m_1+m_2 = M$.

Part (b) can then be answered by checking to see which range your random number $U$ falls in. If it's in the range $[0, p_0)$, then generate $0$; if it's in the range $[p_0, p_0+p_1)$, then generate $1$; and if it's in the range $[p_0+p_1, 1)$, then generate $2$.

I'm not sure I understand part (c). Just generate a hundred random numbers according to part (b), above, and tabulate the total number of red balls drawn, and divide by $100$. Is there something I'm missing?