Permutation problem for n coins

U have n identical coins...

How to divide it into k parts such that each part has a
maximum of M and a minimum of N?

5 Answers

62
Lokesh Verma ·

first put N coins in each of the k parts..

SO we are left with n-Nk coins...

Now divide the remaining n-Nk coins such that each part gets maximum of M coins.. how will that be done?

62
Lokesh Verma ·

Try with this hint.. or else i will tell u the full soln :)

1
Swetha Kaushik ·

sir, tell the full solution

1
Roshni Paul ·

yes sir please.

62
Lokesh Verma ·

We have to divide N coins in k parts such that each part has atleast N coins.

first put N coins in each of the k parts..(This fulfils our 1st requirement!)

Now, we are left with n-Nk coins...

Now we need to divide the remaining n-Nk coins such that each part has at maximum M coins..

now n-Nk is any number say x

So the question reduces to a simpler question divide x coins into N parts such that no one gets more than M-N=y(let) coins! (each person already has N coins)

or x=x1+x2+.......+xN

0<=x1,x2,x3....,xN<=y

Your Answer

Close [X]