Live data from Hacker News

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

colab.research.google.com

41–50 of 169 posts

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

#41
post #31
post #22

Earlier quoted context omitted.

Why would n be "uniformly randomly chosen" but then suddenly be known? I would mark this mis interpretation simply as wrong if I was a teacher.

That's definitely fair, and I assuming in a classroom setting you'd be very consistent and precise about what that means. But this is a twitter poll, and I doubt people are that consistent. Ultimately I'm just pushing back on the conclusion that this is because "Bayesian thinking is really foreign to people." I think if the question had instead been "would you bet on the urn having started out with more red balls, gr…

That question is quite a bit of handholding. A closer analogue would be “would you bet the next ball is red / green / they’re equally likely?”.

Personally I’d word it as “The next ball is… more likely to be red than green / more likely to be green than red / equally likely to be red or green / I don’t know.”

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

#42
post #36

Uniform n is what drives a lot of the interesting properties here. Other distributions can behave differently. For example if balls were inserted into the urn with their colors determined independently by coin flips, then instead of n being uniform it would be binomial. In that case, observing the color of a previously drawn ball would tell you nothing about the next one.

Is that true? You'd still have evidence that the distribution of balls tilts one way, wouldn't you?

Flip three coins. First one lands heads. Does that mean the rest are more likely to be heads? No.

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

#43
post #37

It’s not Monty Hall. Monty Hall does not open doors randomly. To think about this problem right you need to acknowledge that it could have gone the other way with some probability but it didn’t, and so that tells you something more about the state of things. If monty opens doors randomly, and shows you a goat, you do not benefit from switching. Edit: assuming he doesn’t open your door of course

This is not about Monty Hall or his doors.

ROT13: Gur zber erqf, gur zber yvxryl lbhe svefg chyy vf erq.

No one is making changes based on your actions, like Monty did.

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

#44

Earlier quoted context omitted.

I'd argue that it's not so much a difference of opinion than it is just a reasoning error given the question as stated. That's sort of the whole point of this post-- this is a case where "doing the math" in the expected way gives the wrong answer, because the state of the system is cast in stone (in terms of the ratio of red/green balls in the urn) when you first start out, so it's all about leveraging the informatio…

It's definitely a poorly worded question. "More likely" is ill-defined. More likely than what? Than the last draw? Than drawing the other color just on this pick?

Yes, it's a bit of a pet peeve of mine to use the word "more" while leaving vague the point of comparison. Especially in something like a twitter poll -- twitter isn't exactly renowned as a place where people think closely about things before clicking.

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

#45
post #43
post #37

It’s not Monty Hall. Monty Hall does not open doors randomly. To think about this problem right you need to acknowledge that it could have gone the other way with some probability but it didn’t, and so that tells you something more about the state of things. If monty opens doors randomly, and shows you a goat, you do not benefit from switching. Edit: assuming he doesn’t open your door of course

This is not about Monty Hall or his doors. ROT13: Gur zber erqf, gur zber yvxryl lbhe svefg chyy vf erq. No one is making changes based on your actions, like Monty did.

That is… what I said

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

#46
Having to understand probability problems like this by writing code is like having to count the dots to multiply. It's functional innumeracy. Not something to be shamed, but something that needs to be fixed.

What is 3 x 2?

. . .

. . .

1, 2, 3, 4, 5, 6 . . . six?

Edit: To add to that, check out the Erdos book from the 90s on innumeracy (here's Wikipedia instead of an AMZN affiliate link):

https://en.wikipedia.org/wiki/Innumeracy_(book)

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

#47
post #38

I think this is easiest to see if you imagine the urn is filled with three balls. You draw one, and it's red. The possibilities are that the urn originally contained: 1. Red, Red, Red 2. Red, Red, Green 3. Red, Green, Green (The Green, Green, Green case is impossible because you drew one Red.) Drawing a Red from urn configuration (1) was a 100% probability; from (2) was a 66% probability, and from (3) was a 33% proba…

And the underlying cause of people's intuition failing them is caused by those configurations being equally likely, which is a quirk of the question.

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

#48
post #37

It’s not Monty Hall. Monty Hall does not open doors randomly. To think about this problem right you need to acknowledge that it could have gone the other way with some probability but it didn’t, and so that tells you something more about the state of things. If monty opens doors randomly, and shows you a goat, you do not benefit from switching. Edit: assuming he doesn’t open your door of course

Yes, you're right-- I mispoke in that I meant that they were both examples of getting information that should revise your world view, not that they were exact analogues.

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

#49
post #46

Having to understand probability problems like this by writing code is like having to count the dots to multiply. It's functional innumeracy. Not something to be shamed, but something that needs to be fixed. What is 3 x 2? . . . . . . 1, 2, 3, 4, 5, 6 . . . six? Edit: To add to that, check out the Erdos book from the 90s on innumeracy (here's Wikipedia instead of an AMZN affiliate link): https://en.wikipedia.org/wiki…

The purpose of the code was to make it clearer what is happening here. If someone is confused by the direct calculation, then they can also look at the simulation and maybe things will become clearer. Also, you do need to have some actual insight into the problem to solve it directly with calculations, whereas you just have to model the situation to brute force a simulation and arrive at essentially the same answer (with a lot more compute used, but that's basically free now!).

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

#50
Super confusing! Through different reasoning I get different answers:

1. More likely to be red because the urn has a greater chance of having more red balls

2. Equally likely by considering all remaining urn possibilities to be equally likely

3. More likely to be green because obviously there is one less red ball than before

I wrote a Python program to simulate the problem. It tells me that the correct answer is (2) - it's equally likely that the next ball is red or green.

I wonder if I've made a mistake, or if that's really the real answer!

    #!/usr/bin/python
    import random
    from collections import Counter
    
    def experiment():
        urn = random.choices(["R", "G"], k=100)
        if urn.pop() != "R":
            return
    
        return urn.pop()
    
    results = (experiment() for i in range(1_000_000))
    results = (result for result in results if result is not None)
    print(Counter(results))
EDIT: I did make a mistake! The above produces a binomial distribution of urns with red/green. As in, the most common urn is one with an equal number of reds and greens, and the least common is all reds or all greens. Whereas they should have equal probability. To actually match the question:

    #!/usr/bin/python
    import random
    from collections import Counter
    
    def experiment():
        num_red = random.randint(1, 100)
        num_green = 100 - num_red
        urn = ["R"] * num_red + ["G"] * num_green
        random.shuffle(urn)
        if urn.pop() != "R":
            return
    
        return urn.pop()
    
    results = (experiment() for i in range(1_000_000))
    results = (result for result in results if result is not None)
    print(Counter(results))

The answer is indeed (1) More likely to be red.
Post reply on HN