# Probabilities, 7 items, 4 containers

Homework Helper

https://www.physicsforums.com/forumdisplay.php?f=73

There are 7 items, and 4 containers. A 4 sided die (tetrahedron) is used as a random number generator and is thrown 7 times. After each toss, an item is dropped into a container corrersponding to the bottom side of the die.

There are (n+r-1)c(r) = 10c7 = 120 possible outcomes. Here is a table showing the possible outcomes. Each digit of each 4 digit number represents the number of items in a container:

0007 0016 0025 0034 0043 0052 0061 0070 0106 0115
0124 0133 0142 0151 0160 0205 0214 0223 0232 0241
0250 0304 0313 0322 0331 0340 0403 0412 0421 0430
0502 0511 0520 0601 0610 0700 1006 1015 1024 1033
1042 1051 1060 1105 1114 1123 1132 1141 1150 1204
1213 1222 1231 1240 1303 1312 1321 1330 1402 1411
1420 1501 1510 1600 2005 2014 2023 2032 2041 2050
2104 2113 2122 2131 2140 2203 2212 2221 2230 2302
2311 2320 2401 2410 2500 3004 3013 3022 3031 3040
3103 3112 3121 3130 3202 3211 3220 3301 3310 3400
4003 4012 4021 4030 4102 4111 4120 4201 4210 4300
5002 5011 5020 5101 5110 5200 6001 6010 6100 7000

Out of these 120 outcomes, (7-1)c(4-1) = 6c3 = 20 of them have no empty containers.

1114 1123 1132 1141 1213 1222 1231 1312 1321 1411
2113 2122 2131 2212 2221 2311 3112 3121 3211 4111

The goal here is to determine the probability of occurrence for each of the 120 possible outcomes.

One method that could be used to calculate the probablities would be to consider the total number of possible outcomes of the 7 throws of the 4 sided die as a 7 digit number in base 4, going from {0,0,0,0,0,0,0} (all items in first container), to {3,3,3,3,3,3,3} (all items in last container), so total number of cases = 47 = 16384.

A program could cycle through all 16384 cases, creating a histogram for the 120 possible outcomes. For examples of the output of using such a program, each of the 4 permutations for {0,0,0,7} occurs in 1 of the 16384 cases, each of the 4 permutations of {1,1,1,4} occurs in 210 of the 16384 cases, each of the 12 permutations of {1,1,2,3} occurs in 420 of the 16384 cases, and each of the 4 permutations of {1,2,2,2} occurs in 630 of the 16384 cases.

I'm wondering if this is a valid approach for determining the probabilities of the outcomes.

Last edited:

Beware: not all distributions are equally likely. For example, (1,1,1,4,0,0,0...) is less likely than (1,1,2,3,0,0,0,...).

You can find this type of problem all worked out in Feller, "An Introduction to Probability Theory", Volume 1, 3rd edition, section II.5. He has an example which is very similar to your problem.

Homework Helper
Beware: not all distributions are equally likely. For example, (1,1,1,4,0,0,0...) is less likely than (1,1,2,3,0,0,0,...).
I have {1,1,1,4} => 210/16384, {1,1,2,3} => 420/16384, so it's 1/2 as likely using my method.

You can find this type of problem all worked out in Feller, "An Introduction to Probability Theory", Volume 1, 3rd edition, section II.5.
I see if I can find this book in a library.

The main concern is if my approach was OK.

I have {1,1,1,4} => 210/16384, {1,1,2,3} => 420/16384, so it's 1/2 as likely using my method.

I see if I can find this book in a library.

The main concern is if my approach was OK.
Your approach will work, at least if you count the number of occurrences correctly, but you are in for some very long run times if you increase the number of items or containers by much.

Homework Helper
Your approach will work, at least if you count the number of occurrences correctly, but you are in for some very long run times if you increase the number of items or containers by much.
I realise this, there's an expansion series that can be used to count the number of ways to get

7 items into 4 (non-empty) containers:
(4c4) ( (4c4)(47)) - (4c3)(37) + (4c2)(27) - (4c1)(17) ) = 8400.

7 items into 3 containers:
(4c3) ( (3c3)(37) - (3c2)(27) + (3c1)(17) ) = 7224.

7 items into 2 containers:
(4c2) ( (2c2)(27) - (2c1)(17) ) = 756

7 items into 1 container:
(4c1) ( (1c1)(17) ) = 4

You can also use a variation on probability to calculate the number of ways to produce vidual patterns, for each of the the 4 permuations of {1 2 2 2}, number of ways = (7!) / (1! 2! 2! 2!) = 630, for each of the 4 permutations of {1 1 1 4}, number of ways = (7!) / (1! 1! 1! 4!) = 210, ...

Keeping the size of the problem small enough to generate historgrams with a program allowed me to verify that the formulas I use corresponded to the program's results. The numbers match, but the main concern is using permutations instead of combinations to determine probability of patterns (or number of ways for a specific pattern versus number of ways for all patterns).

Last edited: