Undergrad Finding the average time with given probability

Click For Summary
The discussion revolves around estimating the maximum number of draws when drawing balls from a box with a known probability of drawing red and white balls. It is clarified that there is theoretically no maximum number of draws since one could continuously draw red balls. The average number of draws can be estimated using simulations, with a specific example showing an average of about 3.01993 for a probability of p=0.006659. However, it is noted that if p is less than 1/3, the game will end with certainty, while for p greater than 1/3, the expected number of draws can be infinite. The conversation also references a related puzzle, suggesting that the problem has been studied in similar contexts.
KFC
Messages
477
Reaction score
4
Hi all,
I am thinking a problem of drawing a ball in a sealed box. Assuming there is a box, contains plenty red and white balls, the number of red and white balls are unknown but let's assume there will be ##p## chance to draw a red ball and ##q=1-p## chance to get a white one. Those probability is constant throughout the calculation. Let assume that at beginning we start the game by picking one ball out of the box, if it is a red one, there will be 3 more draws given; otherwise, game over.

For each draw out of 3, if you get a red ball, 3 more draws added other wise, use up one chance until all draws used up. I wonder if there is any way to estimate the maximum draws could be at the given ##p## and ##q##?

I can estimate the average draws to be about 3.01993 if #p=0.006659#. But how to find the maximum possible number of draws? I write a program to simulate this process for billions times and I see that in some game I could get up to 21 draws. Is it any way to compute this number in theory? Thanks.
 
Physics news on Phys.org
KFC said:
But how to find the maximum possible number of draws?
There is no maximum possible. You could possibly draw a red ball each time.
 
Last edited:
In your scenario there is no maximum on the number of draws.
You make things complicated. Easier: flip a coin many times. There is a nonzero probability for all heads, no matter how many times you flip.
 
KFC said:
Hi all,
I am thinking a problem of drawing a ball in a sealed box. Assuming there is a box, contains plenty red and white balls, the number of red and white balls are unknown but let's assume there will be ##p## chance to draw a red ball and ##q=1-p## chance to get a white one. Those probability is constant throughout the calculation. Let assume that at beginning we start the game by picking one ball out of the box, if it is a red one, there will be 3 more draws given; otherwise, game over.

For each draw out of 3, if you get a red ball, 3 more draws added other wise, use up one chance until all draws used up. I wonder if there is any way to estimate the maximum draws could be at the given ##p## and ##q##?

I can estimate the average draws to be about 3.01993 if #p=0.006659#. But how to find the maximum possible number of draws? I write a program to simulate this process for billions times and I see that in some game I could get up to 21 draws. Is it any way to compute this number in theory? Thanks.

I think you are probably asking for a lot more than you think / want here.

For starters, either your specification of the problem, or your code seems to be buggy. It would also be prudent to explicitly state that you are sampling with replacement from the box, or instead, tossing a coin.

My understanding is that this can be interpreted as starting with a score of ##0##. If we get a white ball, our score has ##-1## added to it. If we get a red ball, the score is incremented by ##+2##. We stop whenever our score is ##=-1##.

If my understanding is correct, this maps to a simulation (and analytical result) that is markedly different than what you have stated for ##p=0.006659## -- i.e. it gets you ##\approx 1.0203842## draws on average until the game ends. This is the associated code:

Python:
import numpy as np
import numba
# in Python 3.x

@numba.jit(nopython= True)
def do_sim(p_red, n_trials):   
    total_counter = 0
    for trial in range(n_trials):
        local_counter = 0
        score = 0
        while score > -1:
            my_random_num = np.random.random()
            if my_random_num <= p_red:
                score += 2
            else:
                score -= 1
            local_counter += 1
        total_counter += local_counter
    return total_counter / n_trials

do_sim(p_red = 0.006659, n_trials = 10000000)
It's worth pointing out that if you play this game and ##p \leq \frac{1}{3}##, the game will end with probability one. If ##p \gt \frac{1}{3}## your stopping time is actually a defective random variable -- i.e. ##\infty## has positive probability.

In the case of ##p = \frac{1}{3}## the game ends with probability one, but the expected draws until ending ##= \infty##. For ##p \lt \frac{1}{3}##, you can use Wald's equality and recover that the expected draws until ending is ##\frac{1}{1-3p}##.

As mentioned by others, you can't put a hard bound on any finite natural number of draws. However, for ##p \lt \frac{1}{3}##, you can use tools like Markov's inequality to get a (loose) probabilistic bound on the number of draws.

Your problem actually seems to be a variant of a recent Riddler Classic puzzle going under the name of micro-organism multiplication. The solution is found here under the title "Solution to last week's riddler classic"

https://fivethirtyeight.com/features/can-you-rule-riddler-nation/
 
The standard _A " operator" maps a Null Hypothesis Ho into a decision set { Do not reject:=1 and reject :=0}. In this sense ( HA)_A , makes no sense. Since H0, HA aren't exhaustive, can we find an alternative operator, _A' , so that ( H_A)_A' makes sense? Isn't Pearson Neyman related to this? Hope I'm making sense. Edit: I was motivated by a superficial similarity of the idea with double transposition of matrices M, with ## (M^{T})^{T}=M##, and just wanted to see if it made sense to talk...

Similar threads

  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 29 ·
Replies
29
Views
4K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K