Urn extraction with replacement and order of the extraction

109 Views Asked by At

Suppose we have an urn with 5 balls: 3 green and 2 red. What is the probability of extracting green-red-green (in this order, putting back each ball after the extraction)? Is it different or the same as the probability of extracting 2 green and 1 red (again, putting the ball back in after each extraction)?

I would compute one of these two probabilities as just $3/5\times 3/5 \times 2/5$, but I'm not sure which.

1

There are 1 best solutions below

0
On

It seems you may not understand the combinatorial approaches. Maybe a simulation (in R) will help:

Let Green=1 and Red = 2. Let urn=c(1,1,1,2,2). Use the sample procedure in R to sample three balls from the urn with replacement, and note whether the sequence was exactly 121

samp = sample(urn,3,rep=T); samp
[1] 1 2 1
samp==c(1,2,1)
[1] TRUE TRUE TRUE
sum(samp==c(1,2,1)) == 3
[1] TRUE   # YES, we got '121'

samp = sample(urn,3,rep=T); samp
[1] 2 1 2
samp==c(1,2,1)
[1] FALSE FALSE FALSE
sum(samp==c(1,2,1)) == 3
[1] FALSE # NO, not `121`

Iterate a million times. The fraction of TRUEs is almost exactly $18/125,$ as in the first formula.

set.seed(2022)
# Denote G = 1; R = 2
urn = c(1,1,1,2,2)
grg = replicate(10^6, 
       sum(sample(urn,3,rep=T)==c(1,2,1))==3)
mean(grg)
[1] 0.14406
18/125
[1] 0.144

If we iterate again, noting just whether we got two green balls (regardless of order), we get almost exactly $18/125$ as in the the second formula.

two.g = replicate(10^6, 
        sum(sample(urn,3,rep=T)==1))
mean(two.g==2)
[1] 0.432297
54/125
[1] 0.432

Alternatively, if you know about binomial distributions, the second formula gives a binomial probability.

Dpecifically, if $G$ is the number of green balls in $n=3$ draws with replacement from an urn with $p = 3/5$ green balls, then $G \sim \mathsf{Binom}(n,p).$ And by the binomial PDF the answer is the same.

dbinom(2, 3, 3/5)
[1] 0.432