Live data from Hacker News

A confusing probability question: Red and green balls in an urn

colab.research.google.com

111–120 of 169 posts

Re: A confusing probability question: Red and green balls in an urn

#111
post #101

Greetings Unfortunately my probability skills are quite bad and i easily get confused, could someone explain where my reasoning fails? I assumed since we have a uniform distribution of red to green balls, then the expected value would be 50 red balls. So I assumed I can use this expected distribution to figure out the probability the question asked in an urn where there is 50 red balls and 50 green balls, and we draw…

Yes, it’s a mistake to take the expected value before the ball is drawn, because the drawn ball adds information, disproportionately changing the expected value.

Consider an alternate game, where I flip a hidden coin… if it is heads, I let you pick from an urn with 99 red and 1 green; if it is tails, I let you pick from an urn with 1 red and 99 green. The expected number of red is still 50, and the chance of drawing that first red is still 50%. But once that red is drawn, your expectation of what the next draw will be should change significantly.

Re: A confusing probability question: Red and green balls in an urn

#112
post #12

I think this is less about Bayesian thinking and more about misinterpreting the question, as another poster mentions: https://twitter.com/farrwill/status/1751788706355392639 ie i think many of the More Likely to be Green people are doing the math of if you pull from an urn with n/100 odds of getting red, your second pull will have odds (n-1)/99, which is less than n/100 for all n except n=100. Which is obviously a di…

[dead]

Re: A confusing probability question: Red and green balls in an urn

#113

Answer is impossible to know without knowing n. If there are n=0 red balls probability of having a red ball is 0%. If n=100 red balls is 100% If the idea is to repeat the experiment until reaching a limit the probability of choosing each number must be taken in account and included, and then we could take an average of all possible results.

There are 9900 possibilities for the state of the urn after the first ball is picked:

1. n = 1, you can pick any of 99 green balls 2. n = 2, you can pick any of 98 green balls and a red ball 3. ... 100. n = 100, you can pick any of 99 remaining red balls

If you count the situations in which you will pick a red ball next, you'll see that there are more than the ones where the next ball is green.

Intuitively, given that you picked a red ball, you should expect there to be more red balls in the urn. And the effect of having more red balls than green ones outweighs the effect from removing just one ball.

Re: A confusing probability question: Red and green balls in an urn

#114
Hm I'm not sure if it's correct but here's my logic (here on mastodon https://social.ciaranmc.com/@ciaran/111850662374227629)

There are N-1 red balls out of 99 remaining, so the probability the next ball is red is (N-1/99).

The possible values of N are evenly distributed [1...100] (we discount the N=0 case because we drew a red ball)

The total probability that the next ball is red is the sum of the individual probabilities divided by cases:

P = SUM[1...100](n-1/99) / 100 = SUM[1...100](n-1) / 99 * 100 = SUM[0...99](n) / 99 * 100 = 4950 / 9900 = 5.0

So red or green are equally likely

Re: A confusing probability question: Red and green balls in an urn

#116
since everyone is sharing code, why not? I feel this is a simpler way of sharing reasoning anyway. (in k; ! is iota, % is divide and +/ sums up a list)

    wa:!101 / world amplitudes given we picked red (i.e relative probability)
    wp:wa%+/wa / convert amplitude to probability
    np:(wa-1)%99 / probability of next pick being red for each world

    +/wp*np / sum the conditional probabilities
of course, if you wanted to golf this, you'd end up with {2%3}

Re: A confusing probability question: Red and green balls in an urn

#117

Hm I'm not sure if it's correct but here's my logic (here on mastodon https://social.ciaranmc.com/@ciaran/111850662374227629 ) There are N-1 red balls out of 99 remaining, so the probability the next ball is red is (N-1/99). The possible values of N are evenly distributed [1...100] (we discount the N=0 case because we drew a red ball) The total probability that the next ball is red is the sum of the individual probab…

Your mistake is here:

> The possible values of N are evenly distributed [1...100] (we discount the N=0 case because we drew a red ball)

These probabilities over N are not actually even anymore; the fact that you drew a red ball means that higher values of N are more likely.

Re: A confusing probability question: Red and green balls in an urn

#118
P(r2 | r1) = P(r1 ∩ r2) / P(r1) = 2P(r1 ∩ r2) = 2∑P(n ∩ r1 ∩ r2) = 2∑(1/101 * n/100 * (n-1)/99) = 2/3.

Just expand conditional probabilities and use the law of total probability.

Intuitively, first pick red means the urn is more likely to be filled with red.

Re: A confusing probability question: Red and green balls in an urn

#119
post #3

To try to put it into words: We don't actually know the mix-rate of what's in the urn. It's possible we just pulled the only red ball and all the others are green... However the fact that our first n=1 sample happened to be red (and not something else) gives a small (and varying) amount of confidence towards red-heavier mixes rather than the red-scarce ones. We can use that to figure out which mixes are slightly more…

> However the fact that our first n=1 sample happened to be red (and not something else) gives a small (and varying) amount of confidence towards red-heavier mixes rather than the red-scarce ones.

I wouldn't characterize this as a small amount of confidence, as conditional distribution of the mix-rate after the first sample drastically differs from the prior.

Originally each mix-rate has 1/101 probablity. After the sample having a mix with n reds in it has the probablity 2n/(100101).

Re: A confusing probability question: Red and green balls in an urn

#120
In general for N total balls (N>1):

Pr(R,R) = 2 / ( (N+1) (N) (N-1) ) * N^3 / 3

The N^3 / 3 is just the integral of N^2 evaluated from 0 to N.

As N gets large, then Pr(R,R) approaches (2/3) because the cubic terms in numerator and denominator cancel out.

This means that no matter what N is, probability of red,red will always be greater than probability of red,green.

Post reply on HN