5

We have a box containing b black balls and r red balls which we will take out one at a time by placing them on the table in front of us. Before each extraction we write the color of the majority of the balls not yet extracted on a sheet of paper and only in the event of a tie between black and red can we write a random color (black or red). So, once the ball has been extracted, we can establish whether or not its color corresponds to the one written on the sheet. On average, how many times does the color written on the piece of paper coincide with the color of the ball drawn?

Driven by curiosity, I simulated this game 1000 times considering a box containing b=26 black balls and r=26 red balls, obtaining an expected value approximately equal to 30. I was wondering if a closed formula could be written. Thank you!


Thanks to Parcly Taxel's answer I was able to go back to the original problem whose solution is by John Henry Steelman, Indiana University of Pennsylvania, Indiana, PA (valid for $b \ge r$):

$$ \mathbb{E}(b,r) = b + \sum_{k=0}^{r-1}\binom{b+r}{k}/\binom{b+r}{r} $$

from which:

$$ \mathbb{E}(r,r) = r - \frac{1}{2} + \frac{2^{2r-1}}{\binom{2r}{r}}; \quad \mathbb{E}(26,26) = \frac{3724430600965475}{123979633237026} \approx 30.040664774713895\,. $$

Monster
  • 249
  • 2
    This is not clear. I suggest taking a precise example, like $(b,r)=(3,2)$ and writing out what you mean. – lulu Feb 21 '23 at 14:33
  • No idea what this means ! "Before seeing the ball, however, it's necessary to write the color of most of the balls not present on the table on a sheet of paper; only in the event of a tie between black and red is it possible to try to guess the color of the ball just drawn. " – true blue anil Feb 21 '23 at 14:47
  • 1
    I think the question might be rephrased as: say a ball drawn from the box is plausible if its colour was the more prevalent one in the box at that time. If there’s a tie, spin a coin to determine if that ball was plausible. What’s the expected number of plausible balls overall? It’s a good question I think – Laska Feb 21 '23 at 14:53
  • By reccurrence, I think it is possible to build a close formula. Start with only 1red+1blue. – Lourrran Feb 21 '23 at 15:00
  • 1
    My first inclination when seeing this is that when $b = r$, it feels Catalan-ish. A quick peak at Parcly Taxel's answer suggests that there is a connection, but I haven't read it yet. – Brian Tung Feb 22 '23 at 07:52
  • This was asked yesterday? Wow, I asked the same question a month ago with a plot- and this has 5 upvotes and mine was marked as the duplicate? https://math.stackexchange.com/questions/4624398/flip-a-card-from-an-2n-sized-deck-and-guess-the-color-drink-every-time-you-ar – Dylan Madisetti Feb 22 '23 at 15:53

1 Answers1

4

This is the question's process clarified. Start with $0$ correct guesses and repeat this process until no balls remain in the bag:

  • Write down the majority colour among the bag's remaining balls. If there is a tie write either colour arbitrarily (since the probability of getting the next step right will always be $\frac12$).
  • Draw a ball uniformly at random from the bag, add $1$ to the correct guesses if it matched the colour written down, then set that ball aside.

The expected number of correct guesses $E(M,m)$ from a position with $M$ majority-colour balls and $m$ minority-colour balls (the process has a colour symmetry) satisfies this recurrence: $$E(M,0)=M$$ $$E(M,M)=\frac12+E(M,M-1)$$ $$E(M,m)=\frac{M(1+E(M-1,m))+mE(M,m-1)}{M+m}\qquad\text{ if }M>m$$ Using this we calculate $$E(26,26)=\frac{3724430600965475}{123979633237026}=30.04066\dots$$ in close agreement with the OP's simulation.


Empirical expressions for $E$ are $$E(M,m)=M-(-1)^m\sum_{k=1}^m\frac{k(-2)^{k-1}\binom mk}{M+m-k+1}$$ $$E(M,m)=M-\frac{m(-1)^m}{M+m}{}_2F_1(1-m,-M-m;1-M-m;2)\qquad(m>0)$$

$E(M,M)$ happens to be OEIS A322755/A322756 and is equal to $M-\frac12+2^{2M-1}/\binom{2M}M$.

Parcly Taxel
  • 103,344