Balls and Boxes Complicated Problem

  • Thread starter Thread starter DavidSmith
  • Start date Start date
  • Tags Tags
    Balls
DavidSmith
Messages
23
Reaction score
0
Consider a set box boxes. Say we have 30 boxes.

And then we have x number of black balls and y number of white balls

And these balls are stacked in the boxes. The total nuber of ways of stacking them is easy to find, but a much harder problem is to find the probability that for anyone of the 30 boxes the ratio of black balls to white balls exceeds a certain value donoted as say 'p' where the number of black balls must exceed another variable denoted 'q' for this ratio to be valid.

For example if you have 10 black balls 5 white balls and 30 boxes find the probability that in anyone of those boxes there will be twice as many black balls than white balls assuming that there must be greater than 2 blacks balls in tat particular box. The balls are randomly placed in the boxes and the placement of one ball has no affect on the placement of another.
 
Physics news on Phys.org
Order of stacking within the boxes does not matter. You know that for a given number of white balls and black balls in a given box (say 4 and 2), the number of ways that you could have those appear in that box is the same as the number of ways that you could arrange 6 black balls and 3 white balls in the remaining boxes. Add up the total ways for each number of white or black balls that satisfies the ratio and the minimum number of black balls, and divide by the total number of ways. I couldn't tell you if this is the quickest way to approach the problem, but it should work eventually.


Edit: Since I'm learning Haskell, I tried this as an exercise
Code:
prob w b s min r = satisfy w b s min r / total w b s min

satisfy w b s min r = sum [countall (w - y) (b - x) (s - 1) | x <- [min..b], y <- [0..w], (y == 0 && x > 0) || x / y > r]

total w b s min = countall w (b - min) s

fac 0 = 1
fac n = n * fac (n - 1)

a `choose` b = fac a / (fac (a - b) * fac b)

countall w b s = ((w + s - 1) `choose` w) * ((b + s - 1) `choose` b)
This seems to work, but I haven't tested it much. For your example, r = 2, min = 3 (i.e. greater than 2), s = 30, w = 5, b = 10, prob gives a probability of about 0.98, which sounds about right.
 
Last edited:
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Thread 'Detail of Diagonalization Lemma'
The following is more or less taken from page 6 of C. Smorynski's "Self-Reference and Modal Logic". (Springer, 1985) (I couldn't get raised brackets to indicate codification (Gödel numbering), so I use a box. The overline is assigning a name. The detail I would like clarification on is in the second step in the last line, where we have an m-overlined, and we substitute the expression for m. Are we saying that the name of a coded term is the same as the coded term? Thanks in advance.
Back
Top