# Number of ways to place subset of balls between balls

If there are $$5$$ balls : $$b_1, b_2, b_3, b_4, b_5$$ that have been randomly arranged, what is the probability

1. $$1$$ ball occurs between $$b_1$$ and $$b_2$$
2. three balls occur between $$b_1$$ and $$b_2$$

Here is my attempt :

1. There are $$5!$$ ways to arrange $$5$$ balls. $$b_3$$, $$b_4$$ or $$b_5$$ can be between $$b_1$$ and $$b_2$$. Therefore, the probability $$1$$ ball occurs between $$b_1$$ and $$b_2$$ is $$\frac{5!}{3}$$
2. There are $$5!$$ ways to arrange $$5$$ balls. $$b_2$$, $$b_3$$ or $$b_3,b_4$$ or $$b_3,b_2$$ or $$b_4,b_3$$ or $$b_2,b_4$$ or $$b_4,b_2$$ can be between $$b_1$$ and $$b_2$$. Therefore, the probability $$2$$ ball occurs between $$b_1$$ and $$b_2$$ is $$\frac{5!}{6}$$

Is my logic correct ? Can this be generalized to number of probability of $$n$$ balls occurring between $$b_1$$ and $$b_2$$?

• I don't follow your reasoning on the first part. Why are you dividing by $3$? Note, too, that you can have $b_1Xb_2$ or $b_2Xb_1$. Also worth noting that your probabilities are both much greater than $1$.
– lulu
Oct 5 '18 at 12:15
• I suggest: If this question is too hard, start with an easier one. Suppose there were only $3$ balls. Work that one explicitly. Then try $4$.
– lulu
Oct 5 '18 at 12:19
• b1Xb2--. Take it as one and this can be slotted in three ways, b1 and b2 can be permuted in two way, X can be chosen in 3 ways and the other two can be permuted in 2 ways to a total of 36. Further, the five letter can be permuted in $5!$ ways to a total of 120. Thus the probability is $\frac{36}{120} = \frac{3}{10}$ Oct 5 '18 at 15:57
• Please typeset your work using MathJax. Oct 6 '18 at 10:58

There are $${5\choose2}=10$$ pairs of balls. Given any two slots $$\{s_1,s_2\}\subset\{1,2,3,4,5\}$$ the probability that these slots will be occupied by the pair $$\{b_1,b_2\}$$ therefore is $${1\over10}$$, by symmetry.

(i) The probability that one of the pairs of slots $$\{1,3\}$$, $$\{2,4\}$$, $$\{3,5\}$$ is occupied by $$\{b_1,b_2\}$$ is $${3\over10}$$.

(ii) The probability that the pair of slots $$\{1,5\}$$ is occupied by $$\{b_1,b_2\}$$ is $${1\over10}$$.

• A very nice approach. Oct 6 '18 at 20:12

Your answers are larger than $$1$$, so they cannot be probabilities. To calculate the probabilities, you must divide the number of arrangements satisfying the stated condition by the number of possible arrangements of the five balls.

You answered a different question in the body of the question than in the statement of the question, so I will discuss all the cases.

Five balls $$b_1, b_2, b_3, b_4, b_5$$ are randomly arranged in a row. What is the probability that there is exactly one ball between $$b_1$$ and $$b_2$$?

As you determined, there are $$5!$$ ways to arrange the five balls in a row.

If there is exactly one ball between balls $$b_1$$ and $$b_2$$, the block of three balls with $$b_1$$ at one end and $$b_2$$ at the other end must begin in one of the first three positions in the row.
$$\underbrace{\blacksquare \square \blacksquare}_{\text{block}} \square \square$$ $$\square \underbrace{\blacksquare \square \blacksquare}_{\text{block}} \square$$ $$\square \square \underbrace{\blacksquare \square \blacksquare}_{\text{block}}$$ There are $$2!$$ ways to arrange balls $$b_1$$ and $$b_2$$ at the ends of the block. There are $$3!$$ ways to arrange the remaining three balls in the remaining three positions in the row. Hence, the number of arrangements in which balls $$b_1$$ and $$b_2$$ have exactly one ball between them is $$3 \cdot 2! \cdot 3!$$, which agrees with the result Satish Ramanathan found in the comments.

Hence, the probability that exactly one ball is between balls $$b_1$$ and $$b_2$$ is $$\frac{3 \cdot 2! \cdot 3!}{5!}$$

Five balls $$b_1, b_2, b_3, b_4, b_5$$ are randomly arranged in a row. What is the probability that there are exactly two balls between $$b_1$$ and $$b_2$$?

If there are exactly two balls between balls $$b_1$$ and $$b_2$$, the block of four balls with $$b_1$$ at one end and $$b_2$$ at the other end must begin in one of the first two positions in the row.

$$\underbrace{\blacksquare \square \square \blacksquare}_{\text{block}} \square$$

$$\square \underbrace{\blacksquare \square \square \blacksquare}_{\text{block}}$$

There are $$2!$$ ways to arrange balls $$b_1$$ and $$b_2$$ at the ends of the block. There are $$3!$$ ways to arrange the remaining three balls in the remaining three positions. Hence, there are $$2 \cdot 2! \cdot 3!$$ favorable cases. Thus, the probability that there are exactly two balls between balls $$b_1$$ and $$b_2$$ is $$\frac{2 \cdot 2! \cdot 3!}{5!}$$

Five balls $$b_1, b_2, b_3, b_4, b_5$$ are randomly arranged in a row. What is the probability that there are three balls between $$b_1$$ and $$b_2$$?

If there are three balls between balls $$b_1$$ and $$b_2$$, then balls $$b_1$$ and $$b_2$$ must be at the ends of the row. There are $$2!$$ ways to arrange balls $$b_1$$ and $$b_2$$ at the ends of the row. There are $$3!$$ ways to arrange the remaining three balls in the three positions between them. Hence, there are $$2!3!$$ favorable cases, so the probability that there are three balls between balls $$b_1$$ and $$b_2$$ is $$\frac{2!3!}{5!}$$

Five balls $$b_1, b_2, b_3, b_4, b_5$$ are randomly arranged in a row. What is the probability that balls $$b_1$$ and $$b_2$$ are adjacent?

Since there are no balls between $$b_1$$ and $$b_2$$, the block containing $$b_1$$ and $$b_2$$ must begin in one of the first four positions. $$\underbrace{\blacksquare \blacksquare}_{\text{block}} \square \square \square$$

$$\square \underbrace{\blacksquare \blacksquare}_{\text{block}} \square \square$$

$$\square \square \underbrace{\blacksquare \blacksquare}_{\text{block}} \square$$

$$\square \square \square \underbrace{\blacksquare \blacksquare}_{\text{block}}$$

Balls $$b_1$$ and $$b_2$$ can be arranged within the block in $$2!$$ ways. The remaining three balls can be arranged in the remaining three positions in $$3!$$ ways. Hence, the number of favorable cases is $$4 \cdot 2! \cdot 3! = 4!2!$$.

Another way to see this is that we have to arrange four objects, the block containing balls $$b_1$$ and $$b_2$$ and the other three balls. The four objects can be arranged in $$4!$$ ways. The balls can be arranged within the block in $$2!$$ ways. Hence, there are $$4!2!$$ favorable cases.

Thus, the probability that balls $$b_1$$ and $$b_2$$ are adjacent is $$\frac{4!2!}{5!}$$

Check: Since these four cases are mutually exclusive and exhaustive, their probabilities should add to $$1$$. You should verify that $$\frac{4!2! + 3 \cdot 2!3! + 2 \cdot 2!3! + 2!3!}{5!} = 1$$

Think of it as three slots. one on the left one on right and one in the middle. Now in the left and right b1 and b2 can be arranged in 2! ways and in the middle slot you place three balls and they can be arranged in 3! ways so it should be total of 2! x 3! ways to arrange that now the probability is the desired outcome divided by all possible outcomes and all possible outcomes are 5!. so the answer is (2! x 3!)/5! . Same for the other part you just imagine those slots differently. Hope this helps.

• Which part are you answering? Oct 5 '18 at 20:16