• Quick note - the problem with Youtube videos not embedding on the forum appears to have been fixed, thanks to ZiprHead. If you do still see problems let me know.

A statistical question.

CFLarsen

Penultimate Amazing
Joined
Aug 3, 2001
Messages
42,371
I need a little help from the more statistically inclined of you.

There are 144 boxes.

There are seven persons.

Each person can put one ball in each box, if he wants to.

Each persons can use from 0-144 balls, as he wants to.

In the end, each box can have from 0 to 7 balls in it.

On average:

How many boxes will have 3 or 4 balls in them?

How many boxes will have 2 or 5 balls in them?

How many boxes will have 1 or 6 balls in them?

How many boxes will have 7 or 0 balls in them?

It's for an article, so you can get credit, if you want to... :)

Thanks!
 
CFLarsen said:
There are 144 boxes.

There are seven persons.

Each person can put one ball in each box, if he wants to.

Each persons can use from 0-144 balls, as he wants to.

In the end, each box can have from 0 to 7 balls in it.

Claus

I think you need to define criteria for whether or not a person puts a ball in a given box.

For example, if you say that there is always a probability of 0.5 that a person will put a ball in any given box then we can come up with some numbers. Or -- for something a little more interesting -- the probability that a person will put a ball into any given box might be a function of the number of balls already in the box.
 
It depends on the way the people choose to place the balls.

For example, if we imagine that each person makes a 50/50 choice for each box, then the statistics will be identical to flipping a coin 7 times, and counting the heads.

That said, the averages will be about:

3 or 4 balls: 79 boxes
2 or 5 balls: 47 boxes
1 or 6 balls: 16 boxes
0 or 7 balls: 2 boxes

Note that these values are rounded to the nearest integer.

Dr. Stupid
 
Good point, guys.

Nobody knows how many balls there are in the box.

We could go with 50/50, that sounds fine with me. Do the numbers then hold, Cat?

What if the chances were 25/75?
 
CFLarsen,

Nobody knows how many balls there are in the box.

We could go with 50/50, that sounds fine with me. Do the numbers then hold, Cat?

Yup.

What if the chances were 25/75?

Then the odds would be different. The probability is given by

Code:
P(n) = (1 / (a^n * (1-a)^(m-n))) * (m! / (n! * (m-n)!))

where a is the probability of the ball being put in the box (25%), n is the number of balls in the box, and m is the maximum (in this case 7).

It makes more sense if you think of it in terms of coin flips. The first expression is the probability of a single configuration of m coin flips with n heads. The second expression is the number of such configurations. In the case of a fair coin (50/50), the first expression is simply one over two to the seventh power, or 1/128. That case is simple, because all of the configurations have equal probability. When a is not 0.5, it is more complicated. Some configurations are more likely than others. But all configurations which give the same total number of heads are equally likely.

This is known as binomial statistics.

Dr. Stupid
 
What name do you want in the article?

You can use my real name if you want to (Kevin Dolan).

You don't have to, though. This is pretty basic stuff, so a simple reference to binomial statistics should be enough.

Dr. Stupid
 
It isn't basic to me! :)

Keep an eye out for the next announcement of the new issue...won't be a tick...
 
I think the question, as asked, gives the following results:

0 or 7: 25%, or 144 * 0.25 = 36
1 or 6: 36
2 or 5: 36
3 or 4: 36

Each person has complete control over the number of balls placed, and is not influenced by any other persons placements.

So, the distribution is uniform.
 
Let

1=a ball is put in a certain box by a certain person.
0=no ball is put in a box by a certain person.

If the way the balls are put in the boxes is random (50/50 chances to appear a 0 or a 1) then all possible variants have the same probability of appearance.

In the case of this problem the total number of combinations possible is:

Z=2^(7*144) (1)

Lets consider now that those 7 people put (or do not put) the balls in the first box first [respecting the order:the first person-having 0 or 1 as possibilities......the seventh person] then they move to the second box and so on until the 144-th box.

THE FIRST BOX

The total number of variants for the first box T [of the form ABCDEFG where A is what the first person put in the first box-a 0 or a 1,B is what the second person put and so on till G-what the seventh person put] is:

T=2^7 (2)

where we have:

7[C]0=7!/{(7-0)!*0!}=1 is the number of variants (of the form ABCDEFG) where in the first box there are 0 balls.
7[C]1= 7 is the number of variants (of the form ABCDEFG) where in the first box there is 1 ball.
7[C]2=21 is the number of variants (of the form ABCDEFG) where in the first box there are 2 balls.
7[C]3=35 is the number of variants (of the form ABCDEFG) where in the first box there are 3 balls.
7[C]4=35 is the number of variants (of the form ABCDEFG) where in the first box there are 4 balls.
7[C]5=21 is the number of variants (of the form ABCDEFG) where in the first box there are 5 balls.
7[C]6=7 is the number of variants (of the form ABCDEFG) where in the first box there are 6 balls.
7[C]7=1 is the number of variants (of the form ABCDEFG) where in the first box there are 7 balls.

The above possibilities can be found easier using 'Pascal''s triangle' rule.The same considerations as above are valid for all boxes till the 144-th.


Next we can calculate the number of combinations of the form:
N=N[1-x1,2-x2,.......,144-x144] ;0 <= x1 <= 7;......0 <= x144 <= 7;

N being the number of distinct variants having x1 balls in the first box,x2 balls in the second box,...,x144 balls in the 144-th box.

N=[1-x1,2-x2,.......,144-x144] ={7[C]x1}*{7[C]x2}*....*7[C]x144 (3)

where 7[C]xk=7!/{[7-xk]!*xk!}

For:

x1=x2=......=x144=3 --->

N[1-3,...,144-3]=144[C]144*{7[C]3}^144=N[144,3]

x1=x2...=x143=3;x144=0 or 1 or 2 or 4,...,7 --->

N[1-3,...,143-3,x144]=144[C]143*{7[C]3}^143*[7^(144-143)]=N[143,3]

144[C]143=144 takes into account the permutations possible.

x1=x2...=x142=3;x143=01,2,4...7,x144=0,1,2,4,...,7 --->

N[1-3,...,142-3,x143,x144]=144[C]142*{7[C]3}^142*[7^(144-142)]=N[142,3]
.
.
.
x1=3;x2=1,2,5...7;........;x143=01,2,4...7;x144=0,1,2,4,...,7 --->

N[1-3,x2,...,x144]=144[C]1*{7[C]3}^1*[7^(144-1)]=N[1,3]
-----------------------------------------------------

The number of distinct variants for which there are at least 3 balls in a single box-N[3]-is the sum of the above terms.In the same manner we can calculate N[4] but we must eliminate the variants where x=3 already taken into account.-->N'[4].
In this case the number of distinct variants for which boxes have 3 or 4 balls is N=N[3]+N'[4] (5).

At most we can calculate the following media for the average number of boxes having 3,4 balls:

M={N[144,3]*144+N[143,3]*143+..+N[1,3]*1+N'[144,4]*144+..+N'[1,4]*1}/{N[144,3]+..+N[1,3]+N'[144,4]+..+N'[1,4]}

Very difficult to make it in practice...
 
Dear metacristi,

What does what you wrote mean?

Sincerely,

S. H.
 
monte carlo anlysis

I wrote a little program to do a monte carlo analysis (statistics for dummies) on the problem.

I wanted to restate the problem to insure I understood it correctly.

Seven people are provided with 144 balls. There are 144 boxes. Each person will decide to drop a ball or not to drop a ball into each of the 144 boxes. Each person will make the decision randomly with a 50% probability for each possibility.

One would expect that on average each person would depost 72 balls or seven people in one trial would on average depost 7 * 72 balls or 504.

Results of the monte carlo simulation for 500 trials rounded to nearest tenth.

average number of boxes with 0 balls: 1.2
average number of boxes with 1 ball: 7.7
average number of boxes with 2 balls: 23.5
average number of boxes with 3 balls: 39.7
average number of boxes with 4 balls: 39.4
average number of boxes with 5 balls: 23.7
average number of boxes with 6 balls: 7.9
average number of boxes with 7 balls: 1.0

average number of balls deposited per trial: 504.2

Unfortunately, I haven't had time to see how these results square with the predictions of the people who derived equations, but I hope they are reasonably close or that perhaps I have misunderstood the problem.
 
I ran the simulation out to a 1,000,000 trials and got within a very small margin of the theoretical numbers predicted by S. Cat. So it appears he knows from whence he speaks.

results
0 balls expected: 1.125 results: 1.12575
1 balls expected: 7.875 results: 7.87477
2 balls expected: 23.625 results: 23.62587
3 balls expected: 39.375 results: 39.37825
4 balls expected: 39.375 results: 39.37425
5 balls expected: 23.625 results: 23.62606
6 balls expected: 7.875 results: 7.87468
7 balls expected: 1.125 results: 1.12518

The fact that the actual results are so close to the predicted results would seem to indicate that the random number generator in Microsoft Visual Basic works pretty well.

Edited to add:
I modified the program to keep track of the maximum number for each ball total. In 1,000,000 trials these were the results:
0 balls 9
1 balls 26
2 balls 46
3 balls 66
4 balls 66
5 balls 46
6 balls 26
7 balls 9

If anybody was interested I could make the program available. Right now, you can vary the number of trials and the probability. Other options are easily incorporated.
 

Back
Top Bottom