Finding the average time with given probability

Click For Summary

Discussion Overview

The discussion revolves around a probabilistic problem involving drawing balls from a sealed box, where participants explore the average and maximum possible number of draws based on the probabilities of drawing red and white balls. The scope includes theoretical analysis, simulation results, and interpretations of the game mechanics.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes a game where drawing a red ball allows for additional draws, while drawing a white ball ends the game, and seeks to estimate the maximum number of draws based on probabilities ##p## and ##q##.
  • Another participant argues that there is no maximum number of draws, as it is possible to draw a red ball each time.
  • A different participant simplifies the problem by comparing it to flipping a coin, noting the nonzero probability of getting all heads regardless of the number of flips.
  • One participant suggests that the original problem statement or the code may contain errors and emphasizes the need to clarify whether sampling is with replacement.
  • Another participant provides a detailed explanation of a scoring system related to the game, suggesting that the average number of draws until the game ends can differ significantly from the initial estimate.
  • It is noted that if the probability ##p## is less than or equal to ##1/3##, the game will end with probability one, while for ##p## greater than ##1/3##, the expected number of draws can be infinite.
  • Participants mention the use of probabilistic tools like Markov's inequality to provide bounds on the number of draws for certain values of ##p##.
  • One participant references a similar problem from a Riddler Classic puzzle, suggesting a connection to the current discussion.

Areas of Agreement / Disagreement

Participants express disagreement regarding the existence of a maximum number of draws, with some asserting that it is theoretically infinite while others propose probabilistic bounds under certain conditions. The discussion remains unresolved on the maximum number of draws and the implications of different probabilities.

Contextual Notes

There are potential limitations in the problem specification and assumptions regarding sampling methods. The discussion also highlights the complexity of the game mechanics and the varying interpretations of the scoring system.

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/
 

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 18 ·
Replies
18
Views
4K
  • · Replies 29 ·
Replies
29
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
3
Views
2K