How many ways to share 15 different candies to 3 people and each must have at least one candy?
This problem can be generalize to N people and M different candies
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.
First of all we calculate total number of ways of distributing the candies without the restriction that each must have at least one candy.
Since there are 15 candies ,we can give then to 3 people in 3 1 5 ways.
But in our above calculation we have included the cases in which 1 person has not got candy and when 2 persons got no candy so we need to subtract them.
Case1: Any one of them is without candy
First we select one of the person among 3 in ( 1 3 ) ways and distributed 15 candies to remaining two people in 2 1 5 ways.
Fundamental principle of multiplication yields a total number of ( 1 3 ) ⋅ 2 1 5 ways in this case.
Case2: 2 people got no candy
Select 2 people out of 3 in ( 2 3 ) ways and give all candies to remaining person which can be done in 1 way.
Number of ways in this case= ( 2 3 ) ⋅ 1
By Inclusion exclusion principle
Answer= 3 1 5 − ( ( 1 3 ) ⋅ 2 1 5 − ( 2 3 ) ⋅ 1 ) = 3 1 5 − ( 1 3 ) ⋅ 2 1 5 + ( 2 3 ) ⋅ 1 = 3 1 5 − 3 × 2 1 5 + 3 = 1 4 3 4 8 9 0 7 − 9 8 3 0 4 + 3 = 1 4 2 5 0 6 0 6