Ball and slot combination

53 Views Asked by At

I have 32 slots and 8 balls.

A slot can have minimum 0 balls and maximum 1 ball.

All the 8 balls can be present in any slots, or it can be less than 8. It is also possible that no balls are present in any slot.

For example -

Slot    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Cmbn 1  B 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
Cmbn 2  B B B B B B B B 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
Cmbn 3  0 B B B B B B B B 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0   
Cmbn 3  0 0 B B B B B B B B  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0   
Cmbn 4  B 0 B B B B B B B 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0   
Cmbn 5  B 0 0 B B B B B B 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0   
Cmbn 6  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  B  B  0  0  B  B   
Cmbn 7  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  B  B  0  B  B  0  0  B  B   
Cmbn 8  0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  B  B  B  B  B  B  B  B  0  0  0  0  0  0  0
Cmbn 9  B 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  B  B  B  B  B  B  B  B  0  0  0  0  0  0  0
Cmbn 10 0 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
...

How many such combinations are possible?

What is the formula applicable for this scenario?

Thanks.

1

There are 1 best solutions below

0
On BEST ANSWER

$$\sum_{i=0}^8 \dbinom{32}{i} = 15,033,173$$

What this formula means: $\dbinom{32}{0} = 1$ is the number of ways to choose zero slots to have balls, $\dbinom{32}{1} = 32$ is the number of ways to choose exactly $1$ slot to have a ball, $\dbinom{32}{2} = 496$ is the number of ways to choose two of the $32$ slots to have balls...

In general: $$\dbinom{n}{k} = {_n}C_k = \dfrac{n!}{(n-k)!k!}$$

Example: $\dbinom{32}{8} = \dfrac{32!}{24!8!} = \dfrac{32\cdot 31\cdot 30\cdot 29\cdot 28\cdot 27\cdot 26\cdot 25}{8\cdot 7\cdot 6\cdot 5\cdot 4\cdot 3\cdot 2\cdot 1} = 10,518,300$