N Boxes and M babies question.

67 Views Asked by At

There are N boxes placed in a straight line. Adjacent boxes are separated by 1 unit.

The Babies which are a total of M in number decide to play in this arena of boxes by moving from one box to another. The rules that they follow while moving are as follows:

  1. At the onset of the play, all babies occupy the first M boxes, one baby per box.
  2. For the same baby the distance between two consecutive craters where baby stops is at most D units.
  3. Baby can move from only left to right. (assume that box number one is the leftmost one).
  4. In each box atmost one baby can reside.
  5. At the end of the game play all the babies must occupy the last M craters.

Calculate the number of ways the game can be played.

1

There are 1 best solutions below

0
On

The sum of their positions goes from $M(M+1)/2$ to $M(M+1)/2+M(N-M)$.
So there are between M(N-M) and M(N-M)/D moves.
The number of different moves at any time is at most $MD$.
So there is less than $(MD)^{M(N-M)}$ games.