# Thread: Find the probability mass function

1. ## Find the probability mass function

Four balls are randomly, and independent from each other, placed in one out of N boxes (there may be more than one ball in a single box). The boxes are then searched in order from 1 to N. Let X be the number of boxes that have to be searched before all balls are found. Find the probability mass function for X.

If $\displaystyle X_i$ is the number of boxes that have to be searched to find one of the balls, then I figured that $\displaystyle X = max(X_1, X_2, X_3, X_4)$ is the number of boxes you need to search to find all of them. That gives us the following distribution for X: $\displaystyle F_X(x) = F_{X_1}(x) F_{X_2}(x) F_{X_3}(x) F_{X_4}(x)=F_{X_1}(x)^4$.

I thought that the PMF for one ball would be $\displaystyle Pr(X=k)=(1-p)^{k-1}p$, but this is not giving me the right result (using p = 1/N).

EDIT: The PMF for one ball is of course $\displaystyle p_X(k)=1/N$ for $\displaystyle k=1,2,...,N$ since all the boxes have the same probability of having the ball in them.

The PMF can then be found like this: $\displaystyle p_X(k)=F_X(k)-F_X(k-1)$ for $\displaystyle k=1,2,...,N$

2. ## Re: Find the probability mass function

I for one have only a vague idea what your post means.
Please try to simplify and clarify this description.
Are the balls identical or distinct?
Take this example: there are two balls in box 1, one ball in box 4 and one ball in box 10. (10 boxes in all).
What happens if
1) balls are identical
2) balls are distinct?

3. ## Re: Find the probability mass function

I don't really understand your question. You place one ball randomly in a box, and then repeat this three more times for a total of four balls. Each ball is placed independently from the other balls. For example, if you place two balls in the first box, one ball in the second box and one ball in the 10th box, you would need to search 10 boxes in order to find all four balls.

I managed to solve the problem using the method I outlined above.

4. ## Re: Find the probability mass function

Originally Posted by Ridley
Four balls are randomly, and independent from each other, placed in one out of N boxes (there may be more than one ball in a single box). The boxes are then searched in order from 1 to N. Let X be the number of boxes that have to be searched before all balls are found. Find the probability mass function for X.

If $\displaystyle X_i$ is the number of boxes that have to be searched to find one of the balls, then I figured that $\displaystyle X = max(X_1, X_2, X_3, X_4)$ is the number of boxes you need to search to find all of them. That gives us the following distribution for X: $\displaystyle F_X(x) = F_{X_1}(x) F_{X_2}(x) F_{X_3}(x) F_{X_4}(x)=F_{X_1}(x)^4$.

I thought that the PMF for one ball would be $\displaystyle Pr(X=k)=(1-p)^{k-1}p$, but this is not giving me the right result (using p = 1/N).

EDIT: The PMF for one ball is of course $\displaystyle p_X(k)=1/N$ for $\displaystyle k=1,2,...,N$ since all the boxes have the same probability of having the ball in them.

The PMF can then be found like this: $\displaystyle p_X(k)=F_X(k)-F_X(k-1)$ for $\displaystyle k=1,2,...,N$
The probability that they are all found on or before the $\displaystyle k$th box is examined is $\displaystyle P(k)=(k/N)^4$. So the probability that the fourth ball is found in the $\displaystyle k$th box is:

$\displaystyle PP(k)=P(k)-P(k-1)$

(I wait with baited breath expecting someone will point out the error in the above )

CB

5. ## Re: Find the probability mass function

The event of finding the fourth ball in the k:th box is independent from the events of finding the other balls, so the probability for that is just $\displaystyle P(k)=k/N$.

The probability of having found all the four balls after you've searched the k:th box is (using your notation) $\displaystyle PP(k)=P(k)-P(k-1)$. The answer in the book is $\displaystyle P(X=k)=(k/N)^4 - \left(\frac{k-1}{N}\right)^4$

If you know the distribution $\displaystyle F_X(k)$, then the PMF can be found like this: $\displaystyle P(X=k)=F_X(k)-F_X(k-1)$ for $\displaystyle k=1,2,...,N$

6. ## Re: Find the probability mass function

Originally Posted by Ridley
The event of finding the fourth ball in the k:th box is independent from the events of finding the other balls, so the probability for that is just $\displaystyle P(k)=k/N$.

The probability of having found all the four balls after you've searched the k:th box is (using your notation) $\displaystyle PP(k)=P(k)-P(k-1)$. The answer in the book is $\displaystyle P(X=k)=(k/N)^4 - \left(\frac{k-1}{N}\right)^4$

If you know the distribution $\displaystyle F_X(k)$, then the PMF can be found like this: $\displaystyle P(X=k)=F_X(k)-F_X(k-1)$ for $\displaystyle k=1,2,...,N$
You are there then, I have fixed earlier post

CB

7. ## Re: Find the probability mass function

I've been thinking about how the problem would be changed if you change it so that only one ball may be present in each box. What would the PMF look like then? I don't think the placement of the balls would be independent from each other any longer.