Having 360 numbered balls in a box

Odylio

New member
Joined
Mar 17, 2020
Messages
4
I'm not a mathematician, but I'm confronted with the following issue:

What is the chance that, out of a box with 360 numbered balls (1-360), that I will pick (...let's say) the numbers 11, 15, 54 & 107 ?
I'm allowed to pick 13 balls..., putting back each ball after being picked.
 
So, you are selecting 13 balls from a set of 360, with replacement, and you want the probability that a specified 4 balls (at least one of each) are among the 13 that you looked at? Is that right?

I take it you don't want to learn how to do this, but just want an answer? Before I'd do that, I'd want to know the context of the question, to make sure it's appropriate. (I can't be sure that this isn't really a test question, or that your model is valid for a real-life question.)

But if you want to learn a little, you might consider the fact that the probability you want is 1 minus the probability that the 13 balls you pick are all taken from the other 356 balls.

How many ways are there to pick 13 balls out of 356, with replacement (taking order into account, to keep it simple)? How many ways are there to pick 13 balls out the the entire 360?
 
But if you want to learn a little, you might consider the fact that the probability you want is 1 minus the probability that the 13 balls you pick are all taken from the other 356 balls.

I think this statement might be wrong. For example there's a small chance that all 13 balls will be number 11. This doesn't match the requirement of the picked balls containing 11, 15, 54 AND 107. However the combination uses one of the required balls.

Note that I don't know how to answer this question myself! (Not in a quick/ elegant way.)
 
What is the chance that, out of a box with 360 numbered balls (1-360), that I will pick (...let's say) the numbers 11, 15, 54 & 107 ? I'm allowed to pick 13 balls..., putting back each ball after being picked.
Suppose we want to place thirteen identical choices into three hundred & sixty different types.
That can be done in \(\dbinom{13+(360-1)}{13} =\dfrac{(372)!}{(13)!(359)!}\)ways . That in the total number of ways.
Now how many of those contain the numbers \(\bf 11,~15,~54,~\&~107\) at least once?
Well lets go ahead and place one choice into each of those cells.
Now we place nine identical choices into three hundred & sixty different types.
That can be done in \(\dbinom{9+(360-1)}{9} =\dfrac{(368)!}{(9)!(359)!}\)ways.
Can you divide?
 
Last edited:
I'm not a mathematician, but I'm confronted with the following issue:

What is the chance that, out of a box with 360 numbered balls (1-360), that I will pick (...let's say) the numbers 11, 15, 54 & 107 ?
I'm allowed to pick 13 balls..., putting back each ball after being picked.
Here is my take on this.
The p(11,15,54,107,x,x,x,x,x,x,x,x,x) = \(\displaystyle \dfrac{(\frac{1}{360})^4(\frac{356}{360})^9}{360C13}\).

Allowing for rearrangements of the 13 balls I conclude that the answer is \(\displaystyle 13!\dfrac{(\frac{1}{360})^4(\frac{356}{360})^9}{360C13}\)
 
Here is my take on this.
The p(11,15,54,107,x,x,x,x,x,x,x,x,x) = \(\displaystyle \dfrac{(\frac{1}{360})^4(\frac{356}{360})^9}{360C13}\).

Allowing for rearrangements of the 13 balls I conclude that the answer is \(\displaystyle 13!\dfrac{(\frac{1}{360})^4(\frac{356}{360})^9}{360C13}\)


Thx for that !!
Btw, The order in which they are picked is not relevant.
But 4 of those 13 balls must be: 11, 15, 54 and 107. (With replacement)

I appreciate the answer, but I still do not understand what it means. ?
Like I said, I'm not a mathematician. (...Would love to learn some more about it though)

But in layman's terms, this would be what ? ...One in [10, 100, 1000] ?? ...Or am I being optimistic here ?
 
I don't think the above posts have the correct solution UNLESS I've made a mistake (quite possible). This problem must be very difficult since Dr.Peterson, pka and Jomo are all very clever!

I've come up with the following scenarios, with much smaller numbers, to make checking easier:-

OriginalScenario BScenario C
Balls36078
Picks1355
Required matches433
Combinations that match?18302550
Combinations total (balls ^ picks)(360^13)1680732768
Probability (#match / #total)?≈ 0.1088832≈ 0.0778198

--
Check pka's method
Orig: choose((13-4)+(360-1), 13-4) / choose(13+(360-1), 13) ≈ .00000091
scenario B: choose((5-3)+(7-1), 5-3) / choose(5+(7-1), 5) ≈ 0.060606
This doesn't agree with the computed result
--
Check Jomo's method
Orig: factorial(13)*( (1/360)^4 * ((360-4)/360)^(13-4) ) / (360^13)
scenario B: factorial(5)*( (1/7)^3 * ((7-3)/7)^(5-3) ) / (7^5) ≈ .0000067970
This doesn't agree with the computed result
--

FYI: I used this simple script to generate the above numbers. @Odylio don't try to extend this code to your scenario since it would not give an answer in your lifetime!

Python:
# The number of balls in the bag
balls=7

###########

combos_total=0
combos_match=0

# range returns values 0..6
# "a" to "e" represent 5 balls picked
for a in range(balls):
    for b in range(balls):
        for c in range(balls):
            for d in range(balls):
                for e in range(balls):
                    combos_total += 1
                    # picked numbers must match values 0,1, AND 2
                    if ( (a==0 or b==0 or c==0 or d==0 or e==0) and \
                         (a==1 or b==1 or c==1 or d==1 or e==1) and \
                         (a==2 or b==2 or c==2 or d==2 or e==2) ):
                        combos_match += 1

# combos_total ought to be (balls^5)
print combos_match,"/",combos_total
 
I think you are right.

My original hasty answer was of course wrong because I ignored cases where some, but not all, of the 4 are chosen. My taking order into account is valid, because that yields equally likely outcomes and is canceled in the division. (In fact, your program takes order into account as well, though you used the misleading word "combinations".)

I think pka's answer is wrong because he uses combinations with repetition, and those are not equally likely. (He also differs at one point from what I got when I tried the equivalent method, but that doesn't make any difference.)

Jomo is wrong, I think, because the 13 balls are not always identical, so there are not always 13! ways to arrange them.

The problem is indeed very subtle, and even my analyses of the errors may be wrong. I haven't yet found a valid way to do it, and it may well require a method for which there is not a direct formula. Probably pka will find it before I do.
 
I'm still very curious as to the correct answer of this issue... :unsure:

Is it not simply the total number of combinations that one can make with 13 balls,
and then look how many of these combinations contain all of these 4 numbers (11, 15, 54 & 107) ??
 
I'm still very curious as to the correct answer of this issue... :unsure:

Is it not simply the total number of combinations that one can make with 13 balls,
and then look how many of these combinations contain all of these 4 numbers (11, 15, 54 & 107) ??
It is; but that is not simple! Or rather, it's easy to say, hard to do.

You still haven't told us the real context of the question. But real-life questions quite often don't have simple answers.

Note that the total number of "combinations" (ignoring order) is the denominator of pka's answer,
[MATH] \dbinom{13+(360-1)}{13} =\dfrac{(372)!}{(13)!(359)!} \approx 339,000,000,000,000,000,000,000[/MATH]
Try going through all those and counting!

If you take order into account, as a program like Cubist's has to, you have to go through [MATH]360^{13} \approx 1,705,800,000,000,000,000,000,000,000,000,000[/MATH] possibilities.
 
Jomo is wrong, I think, because the 13 balls are not always identical, so there are not always 13! ways to arrange them.
You are correct about why I am wrong. Using my method would be quite difficult to fix.
 
I'm still very curious as to the correct answer of this issue... :unsure:

Is it not simply the total number of combinations that one can make with 13 balls,
and then look how many of these combinations contain all of these 4 numbers (11, 15, 54 & 107) ??
Yes, it is just what you said.
 
I've spent most of the afternoon thinking about this, and hopefully the following is correct (but it may not be the quickest way to calculate). Please feel free to check and correct my terminology! If this method makes sense I'll use it on the original problem (later)

scenario B)

Let t = the total number of balls, in this case 7
Let p = the pick size, in this case 5
Let m = number of balls to match, in this case 3

Let n1 = the number of picked balls that match ONE of the desired numbers
Let n2 = the number of picked balls that match another ONE of the desired numbers
Let n3 = the number of picked balls that match the remaining desired number
n1 ≤ n2 ≤ n3

Let x = n1 + n2 + n3, x≤p
Let a = choose(p, x) ...the ways to place x among p picks
Let b = the ways to permute the "multiset" of x matched numbers
Let c = (t-m)^(p-x) ...the number of permutations of the unmatched numbers
Let d = the ways to rearrange {n1,n2,n3} (make a new multiset out of them) eg if {1,1,2} then d=3!/2!

Code:
n1 n2 n3    x     a        b               c  d   a*b*c*d
1  1  1    3    10    x!/(1! 1! 1!)= 6   16  1      960
1  1  2    4     5    x!/2!        =12    4  3      720
1  1  3    5     1    x!/3!        =20    1  3       60
1  2  2    5     1    x!/(2! 2!)   =30    1  3       90
                                                   =====
                                                    1830

C)

switch to t=8, this changes the highlighted figures

Rich (BB code):
n1 n2 n3    x     a        b               c  d   a*b*c*d
1  1  1    3    10    x!/(1! 1! 1!)= 6   25  1     1500
1  1  2    4     5    x!/2!        =12    5  3      900
1  1  3    5     1    x!/3!        =20    1  3       60
1  2  2    5     1    x!/(2! 2!)   =30    1  3       90
                                                   =====
                                                    2550
 
I'm still very curious as to the correct answer of this issue... :unsure:

I'm curious about the source of this problem... please let us know!

Based on the method in post#17, the probability of the original scenario looks quite horrendous:
3432*(5*t^9-90*t^8+780*t^7-5460*t^6+37044*t^5-186900*t^4+540150*t^3-645660*t^2-279394*t+978385) / t^13 where t=360
≈ 0.00000097178529996
or around 1 in 1,029,034
 
I'm curious about the source of this problem... please let us know!
Based on the method in post#17, the probability of the original scenario looks quite horrendous:
3432*(5*t^9-90*t^8+780*t^7-5460*t^6+37044*t^5-186900*t^4+540150*t^3-645660*t^2-279394*t+978385) / t^13 where t=360
≈ 0.00000097178529996 or around 1 in 1,029,034
I suspect that someone just made-up this question. As written, I still maintain that there are \(\dbinom{372 }{13}\) ways to select thirteen balls numbered from 1 to 360 with replacement. Now there are \(\dbinom{368 }{9}\) of those ways which include the numbers \(11,15,54,107\) at least once.
Look at this calculation: it agrees your number above.
 
Look at this calculation: it agrees your number above.

The results are indeed close to each other, the same order of magnitude and with the same first significant digit but the next digit is different. Do you expect that your method is approximate or exact?

There was quite a lot of trial and error involved to obtain my result. So I should really test it against some extra scenarios in order to be sure (not just the two extra scenarios in post #8). Hopefully I'll get a chance in the next day or two!
 
Top