# Get the probability mass function while RV denote the number of white balls with n balls chosen for each trial

An urn contains seven white balls and five black ones. Suppose $n$ balls are chosen at random. Let the random variable $X$ denote the number of white balls in the sample. What is the probability mass function of $X$ if the $n$ balls are chosen(a) without replacement?(b)with replacement?

I am basically not able to get a start for this question, like I am not sure how to define the sample space for this question. Again, it this question about using conditioned random variable function or using multinomial coefficent to get the possible ways of arranging the white balls?

• Try to consider what the outcomes are in each case. The first can be solved with elementary counting principles; the second will follow a reasonably common distribution (hint: the balls are replaced, so each one is independent of the others). – platty Aug 9 '17 at 4:00

$X$ is the count of white balls among a sample of size $n$ selected with/without replacement or bias from a population of $7$ white and $5$ black balls.
Your sample space is the outcomes of selecting $n$ from $12$ balls.   Your favoured event is the outcomes of selecting $k$ from $7$ white balls and $n-k$ from $5$ black balls .
All outcomes are equally probable, so divide and calculate $\mathsf P(X{=}k\,; n)$ for any given argument $k$ and parameter $n$ that are possible for the two selection techniques (with/without replacement).
• When the balls are chosen with replacement, we have: $P(X = x) = \binom{n}{x}(\frac{7}{12})^{x}(\frac{5}{12})^{n-x}$
• When the balls are chosen without replacement, we have: $P(X = x) = \begin{cases} \frac{\binom{7}{x}\binom{4}{n-x}}{\binom{12}{n}} , \quad \qquad n\leq 12 \land x\leq 7 \land n-x\leq 4 \\ P(W = x) = 0, n> 12 \lor x> 7 \lor n-x> 4 \end{cases}$