mardi 21 juillet 2015

Divide a whole number m into n parts such the parts such that the parts are whole numbers, each part lies between x and y

As an example. I want to randomly hand out 100 chocolates to 25 kids. I cannot give any kid more than 10 chocolates.

So here m = 100, n = 25, x = 1 and y = 12.

I have checked these questions.

Dividing a number into m parts uniformly randomly

Dividing a number into random unequal parts

They do give some idea but in these questions x and y are not specified.

So basically,

1) Total No. of Chocolates = 100

2) I can only give minimum 1 and maximum 12 chocolates to each kid

3) Chocolates should be distributed between 25 kids

4) I do not want any distribution (uniform or normal) - it should be purely random. (I am willing to exclude this condition if all else fails.)




Aucun commentaire:

Enregistrer un commentaire