Balls and Boxes gone crazy. Part-I

Five balls are to be places in three boxes. Each can hold all the five balls. In how many different ways can we place the balls so that no box remains empty, if balls and boxes are all different?


The answer is 150.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Pawan Kumar
Apr 2, 2015

Total ways of placing 5 5 balls in 3 3 boxes = 3 5 = 3^5

Total ways in which 1 1 box is empty = 3 × 2 5 = 3 \times 2^5

Total ways in which 2 2 boxes are empty = 3 = 3

Using principle of inclusion and exclusion:

Total ways of placing balls so that no box remains empty = 3 5 3 × 2 5 + 3 = 150 = 3^5 - 3 \times 2^5 + 3 = 150

Why are you adding the 3 at the end? Shouldn't we be subtracting it because 2 boxes are left empty? I put the answer as 144 because of that...

Rmflute Shrivastav - 6 years, 2 months ago

Log in to reply

That is so because this case has been subtracted twice when we considered the ways in which 1 box is empty. Hence we need to compensate.

In terms of sets:

A B = A + B ( A B ) |A \cup B| = |A| + |B| - |(A \cap B)|

Notice that we subtract ( A B ) (A \cap B) and not add it. Hope it helps...

Pawan Kumar - 6 years, 2 months ago

Log in to reply

I understand now! Thanks!

Rmflute Shrivastav - 6 years, 2 months ago

please explain another way. I don't understand this way.

Shohag Hossen - 5 years, 8 months ago

In other words, we have to divide 5 distinct balls to 3 distinct boxes such that no box is remained empty. Possible configuration for boxes are: permutations of (2,2,1) and (3,1,1) .

So, total number of ways of doing (2,2,1) divisions is (5!/2! 2! 1!)/2!. Now, this is to be arranged in 3 boxes, so total number of ways 15 * 3! = 90

Similarly, total number of ways of doing (3,1,1) divisions is (5!/3! 1! 1!)/2!. Now, this is to be arranged in 3 boxes, so total number of ways 10 * 3! = 60

So, by Fundamental principle of counting, total number of ways = 90+60 = 150

You Kad
Jan 14, 2017

We want to compute the number of surjections (since no box ought to remain empty) from the set 1 , 5 ⟦1,5⟧ of numbered balls to the set 1 , 3 ⟦1,3⟧ of numbered boxes.

And it is well known that the number of surjections from 1 , n ⟦1,n⟧ to 1 , m ⟦1,m⟧ (with n m n≥m ) is

m n cardinal of 1 , m 1 , n ( k = 1 m ( 1 ) k 1 ( m k ) ( m k ) n cardinal of i = 1 m E i , where E i is the set of functions of 1 , m 1 , n that don’t take the value i ) \underbrace{m^n}_{\text{cardinal of } ⟦1,m⟧^{⟦1,n⟧} } - \Bigg( \underbrace{ \sum\limits_{k=1}^m (-1)^{k-1} \binom{m}{k} (m-k)^n }_{ \text{ cardinal of } \bigcup\limits_{i=1}^m E_i \, \, , \text{ where } E_i \text{ is the set of functions of } ⟦1,m⟧^{⟦1,n⟧} \text{ that don't take the value } i } \Bigg)

Hence the wanted number is :

3 5 3 × 2 5 + 3 × 1 = 150 3^5 - 3 \times 2^5 + 3 \times 1 = 150

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...