Hacker News new | past | comments | ask | show | jobs | submit login
A confusing probability question: Red and green balls in an urn (colab.research.google.com)
73 points by eigenvalue 11 months ago | hide | past | favorite | 159 comments
A Twitter post made the rounds yesterday asking the following question in the form of a poll (https://twitter.com/littmath/status/1751648838501224790):

Daniel Litt @littmath

You are given an urn containing 100 balls; n of them are red, and 100-n are green, where n is chosen uniformly at random in [0, 100]. You take a random ball out of the urn—it’s red—and discard it. The next ball you pick (out of the 99 remaining) is:

More likely to be red 22.6%

More likely to be green 37.1%

Equally likely 20.9%

Don’t know/see results 19.5%

I thought it was interesting (but not surprising) that so many people got this wrong. Basically, Bayesian thinking is really foreign to people. It's essentially similar to the famous Monty Hall problem, where the first bit of information tells you something about the world. In any case, I thought it might be illuminating to give a complete demonstration, using both exact calculations AND simulation, of the "wrong" and "right" approach, which you can see at the Colab link above.




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% probability. If these configurations were equally likely, then the probability of Red and Green on the second draw would be the same.

However, and this is the crux: we are more likely to be in a configuration which shows us what we have observed with a higher likelihood [1]; so we're more likely in configuration (1) or (2) than (3), and as (3) is the only one that favors Green for the next draw (and only by as much as (1) favors Red), the next ball being Red is more probable.

[1] Imagine, for example, that you have 100 coins, and 99 of those coins are biased so that they only show heads once every trillion tosses, while the remaining one coin is fair. If you pick a coin randomly and flip heads, which is more likely: that you got a biased coin to show a one-in-a-trillion event, or that you picked the fair coin?


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.


Why are we excluding red, green, red?


You have just highlighted the actual problem with the question. Uniform distribution.


Not really; he's hypothesizing a potential draw order, but what I was listing were the possible contents of the urn before any are drawn. Since the contents of the urn aren't ordered, they form a set, not a list, and shuffling elements doesn't add to the list of possibilities.


I don't think he/she is talking about that. I think the question is about the probabilities of each of the three options you lay out. You lay it out as though it's obvious the three are equally likely possibilities in the urn. That's only true using uniform distribution to generate the number of red(/green) in the urn.

The contents of the urn would still be a set, but if the contents were initially drawn from a binomial distribution, calling out the possible combinations is required for purposes of counting, ie figuring the probability of each combination.

People intuitively know that there are more ways to have two green and one red than three reds. That maps to most things in the real world too. This question sort of tricks people.


I thought that it was pretty clear from the part where it describes how the urn is filled:

> n of them are red, and 100-n are green, where n is chosen uniformly at random in [0, 100].

N is chosen first, and that many red balls are put in. You don't flip a coin 100 times and then determine N from how many heads you flipped, that would be a tortuous interpretation from my pov, and would violate the requirement that N is chosen uniformly, so it seems like it's right there in the question.


It is there. But it's just a detail many will breeze over and then their intuition fails them.

The way you can know this is: ask people the same question with "binomial" instead of "uniform" and see if you get a different answer. My guess is people will say the same regardless.


I think the thing that clarifies it for me is that if the balls are chosen in such a way that they have a binomial distribution, then, intuitively, the question would be implying retrocausality by saying that N was also "chosen":

> n is chosen uniformly at random

If the balls follow a binomial distribution, then your intuition would say that N wasn't the thing that was chosen; the balls were chosen, and then N was determined afterwards by counting the balls that you picked. This is because you cannot choose N and then draw balls binomially and get that many green or red balls. You'd have to choose 100 balls, see whether the number of Red matches your chosen N, and if it didn't, draw again, which is a tortuous interpretation given the phrasing, as I said above.

By saying that N was "chosen", it implies to me that N comes first, and the choice of balls comes after that, i.e. the balls are not binomially distributed.


Oh, I'm not suggesting you are wrong. I'm just saying it's easy to overlook the detail.


Sure, I guess I'm just arguing that even if you overlook that detail, then your intuition should tell you that the balls having a binomial distribution is suspect, i.e. you have to overlook a small thing and a big thing to misunderstand, and given that, I don't think the question is ambiguous. All good though.


I don't think that's right though, I don't think "chosen" implies what you are saying. An existing binomial distribution could exist and you just choose n from it. You wouldn't have to "generate" the distribution. To me "chosen" and "sampled" would mean the same, and it wouldn't be weird to say "n was sampled from a binomial distribution"


I think I see what you mean now, and I understand that that would be possible.

Wouldn't you need some extra parameters if it were a binomial distribution though? For a uniform distribution every item is equiprobable (i.e. there's only one uniform distribution for a given N) but there are many binomial distributions possible for a given N. (Disclaimer, I know very little about statistics.) So the fact that you aren't given those parameters in the question means you can't make much of a prediction if it were binomial.

Edit: I read that binomial distributions are parameterized on both the number of trials and the probability of the two outcomes, so that kind of demonstrates my point doesn't it? You're not given the probability of Red and Green for the binomial distribution, so you can't really answer the question that way. You could assume it's 50/50, but that's an assumption that isn't justified by the question.


The balls in the container are not ordered.


Because it is a trick question. That state is not in play.


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 different question than should you bet on Green or Red.

Which is obviously a different question than "would you bet on the next ball being red or green"


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, green balls, or equal number of balls" the distribution would have been very different.


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.”


But isn't that exactly how it is worded? Just showing it a bit?


Not quite. People are arguing that “more likely to be red” can be interpreted as “more likely to be red than it was last time”. I guess you could do that with this wording, but that seems like quite a stretch.


You have an urn of 50 red and 50 green balls. Roll a die and add a red ball for every pip. What is the probability of the next ball you take being red?

I say both can be a question in Statistics I where you calculate probabilities based on combinations.

So I'll say it depends on the level of education for how the question gets interpreted and saying those who never took Bayesian reasoning and consider n unknown are wrong gets elitist.


Not known, but certainly defined. It has to not be zero at least, otherwise you couldn't take out a red ball in the first place. Or at least that's how I understand this problem. You don't know what number n is, so you need statistics or simulations to grasp the probability of the color of the next ball.


Another way of making your point: it would also make the information about the distribution of n irrelevant, so it's a bad interpretation of the question.


So? There's plenty of problem statements with irrelevant data. Children are also getting taught to determine which is relevant in class.

But also, it's not irrelevant because for two cases the probability stays equal. Calculating the exact chance is still an interesting problem and it could have been dumbed down for twitter only.


In those cases presumably there's not a more interesting question that's consistent with the question and that uses that information. I'd start with the assumption that the tweet isn't a dumb trick question.


Because including some pieces of irrelevant information as red herrings in probability problems is totally unheard of?


i personally would throw out the question if i was a teacher. i still feel it's ambiguous


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 information you get from your first choice. I think this sort of reasoning is actually surprisingly useful and widely applicable in everyday life, like in investing or diagnosing the likely cause of a software bug from incomplete information.


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.


How is "more likely"I'll defined? They are two options red or green. Are you more likely to draw red or are you more likely to draw green.. how is it poorly worded?


My first interpretation of "more likely" was also "more likely than the previous ball". It makes more sense in the context of the previous sentence.

For example:

> The first time you shoot a basketball, you will almost certainly miss. The second time, you are more likely to make it.

Does the second sentence mean "more likely to make it than to miss"? No.


Great example.


Because it could be more likely red than green, or more likely red than it was likely that the first choice was red (which is where some people got confused, they thought the question was asking about the relative chances of red on the first choice v second choice), more likely green than the first one was likely to be green(same basic problem).


More likely than the other option, given the information. Getting an accurate grasp on the information is the whole point of the question.


Why is that the question? Why not "more likely than the last draw" ?


How could the next draw be more likely to be red than the draw already known to be red?


You are basically asking "how could it possibly be the wrong answer?".

Yes, under that definition of "more likely", it cannot be more likely. It can be equally likely or less likely. And then weighted it would be less likely. And that would be the answer. Which is one of the choices.


No, I'm saying "Your interpretation of the sentence is obviously wrong". With that interpretation, parts of the question are nonsense. The more straightforward interpretation does not have that problem.


1 - I said it's poorly worded, I didn't interpret it that way. I could see how people would misinterpret it (as pointed out by the parent comment) and people did misinterpret it that way. Look at the other posts here. If someone posts a question in english and a bunch of english speakers misinterpret the question, it's poorly worded by definition.

2 - Exactly what parts of the question are nonsense under that interpretation?


I had the same question but the interpretation they're considering is whether the next ball you draw will be more likely to be red than the red ball you drew was likely to be red before you drew it but after the total number of red balls was already determined.

Like: you have a box with a whole bunch of red and green balls. Would removing a red ball increase or decrease the likelihood of drawing a red ball from the box in the future?

I wouldn't buy that as a reasonable misinterpretation of the question in most cases, but I don't know what standard of analysis holds for Twitter polls.

I think it's a matter of knowing that the phrase "where n is chosen uniformly at random" means something very different in a probability question than "where n is an arbitrary value".


> How could the next draw be more likely to be red than the draw already known to be red?

Under this interpretation, the second ball is more likely to be green.


If, hypothetically, the majority of words communicated from one homo sapiens to any other homo sapiens (majority weighted by the number of homo sapiens who will hear, read, or otherwise receive the word over the course of the word's existence) were designed to be precise and unambiguous to the extent that the mean number of homo sapiens who receive the word correctly interpret the exact meaning of the word intended by the entity that chose the word is greater than 99.99%, then I would estimate a greater than 90% probability that the cumulative unique information (in the information-theoretic sense) contained in communications correctly interpreted by the receiving homo sapiens on any given day would be less than the cumulative unique information that is currently being correctly interpreted today (January 30th 2024 in the Gregorian calendar), and furthermore the reduction in information thus communicated would have a negative effect on progress towards the majority of cumulative goals implicitly created by all living homo sapiens.

Or I could just say "I think most people interpreted the tweet correctly, and it would be annoying if it was overly precise"


'What is the most likely color for the next ball selected?'.

Try this book out, it's a fun read on how minor changes in words can make big differences in readability: https://www.amazon.com/Sense-Style-Thinking-Persons-Writing-...


You don't need to think in terms of information to get the right answer, you just need to be careful of the setup.

You can easily apply frequentist probability reasoning and still get the right answer. You have to start from P(n > 50 | first pull is a red ball), and compute P(second ball red | first ball red) based on that.

Basically the mistake is computing the frequency over 100 balls, instead of computing it over the 100 possible values of n multiplied by the 100 balls.


Yes, you make a good point.


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-likely to be in there (based on our tiny amount of data after assuming they begin equally-likely) and then for each of those determine "if it's mix X, then what are the odds of our next draw", and combine the two layers of probability.

In this case, the bias towards presuming the mix is fundamentally reddish outweighs the presumption of "removing one red makes the greens the majority."


Yes, that's exactly right. Paraphrasing what another poster wrote about this on Twitter: "You would rather go fishing in a lake where you just saw someone else catch a fish."

Also, the logic continues as you draw more balls from the urn. If the second ball is ALSO red, then you have even more evidence suggesting that N was selected in such a way as to make red the overwhelmingly more likely choice. Thus the chance of the third ball being red is even higher than the 66% probability in the second draw.


To extend the fishing metaphor, the premise of ~100 balls is also important: If each lake could only sustain one (good) fish, you would actively avoid anywhere someone had already caught one from.


I guess the counterpoint to this is as the number of balls goes from 100 to infinite, it becomes increasingly harder to predict, correct?


No, the higher the count goes the closer it becomes to the single removed ball not mattering at all, so the only thing that matters is the information you got about which urn you're selecting from.


According to the original poster on Twitter:

"One cool thing is that this probability doesn’t change if you replace 100 in the statement of the problem with some other number (as long as it’s at least 2), as these arguments show."

Source: https://x.com/littmath/status/1752167731682492522?s=46


That's "what's the probability you've caught the world's meanest fish".


> 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).


I agree. This is a beautiful summary of the logic I used


Never liked the way these problems are worded.

`You take a random ball out of the urn—it’s red—and discard it.`

How normal people read it: Given this specific instance where you just discarded a red ball from this urn, what's the probability of the next ball?

How it expects you to read it: Given infinitely many random samples from the urn. For cases where you get red, remove it, then take a second sample. What's the probability of the next ball, given all the samplings?


Both of those have the same answer. Why would they not?


I would go further and say that the second reading is in fact incorrect interpretation of the problem in the English language. Being a mathematician doesn’t give some special right to gaslight people on their knowledge of English.

This problem is in a similar category as badly explained monty hall problems where the statement of the problem is so bad that it ends up changing the answer.

For example I have seen the Monty hall problem stated in popular media like this:

“There are three doors, behind two are goats and one is a car. You choose a door at random and there’s a goat behind it. You choose another door, but before opening it the host asks if you want to switch your choice. Is it more profitable to switch or to stick or does it have the same chance?”

Of course it doesn’t matter. This is actually a good way to trick inattentive mathematicians who pattern match on the problem but don’t actually read it.


Love this, can we mangle the problem some more? Like, you open one door and it’s a goat, the host then says he will open another door containing the trip to Bali. Do you want to open the other door or stay with the goat you already have?


But those two readings have the same answer?


I think the wording is also biasing the outcome. The next ball is more likely to be green than the previous ball, and a lot of people will regard that posterior probability statement as implicit. If the question had been phrased differently eg, 'what is the most likely color for the next ball selected' I suspect more people would have voted for equal likelihood.


What does the previous ball have to do with it? We KNOW the previous ball is red. Then it asks "more likely to be red" It seems pretty obvious that it is saying draw the next ball, which is more likely? Red, green, equal. Why would you think it is comparing the second pick probability to the first pick probability?


"You shoot a basketball for the first time -- you miss. The second time, you are more likely to score."

A common phrasing. It doesn't mean that scoring is more likely than missing, it means the second time is more likely than the first was.


Agreed. The first likelihood of green is 50 percent, and of the first is red then the next ball likelihood of being green is smaller than 50 percent, so the above statement makes no sense.


Calm down. I don't think that, I'm saying a lot of people will read it that way because the previous draw is the only existing point of comparison. Think about how people use language casually vs the very specific approach of a math textbook.


Yes, I think you're right about that. Just look at all the disagreement about it right here in this discussion!


And if you change the distribution, that answer is close to correct.


The mathematical term for this is a "Laplacian urn" and the probability is governed by https://en.wikipedia.org/wiki/Rule_of_succession

In this specific case, P(redOnKthSample) = (numberOfRedSamples + 1) / (totalNumberOfSamples + 2) = (1+1)/(1+2) = 66% red.

On the second draw, if the ball is green, then you get P(redOnThirdSample) = (1 + 1) / ( 2 + 2) = 50%


I find it hard to remember a ton of different rules, so I just count configurations, and I'm right on these problems basically every time. You count configurations by enumerating all possible combinations of unknowns, then "score" them by likelihood. The configuration's probability is its score divided by the total score. Then take the weighted sum of your test value, with the weights being the configuration probabilities.

There are 101 configurations (the different values of N). We know our first ball was red. So N == 0 has a score of 0 (it's impossible since we found a red), N == 6 has a score of 6 (there are six different ways we could draw a red), N == 100 has a score of 100. The sum of all the scores is 5050, so the probability that N == 100 is 100/5050 = 1.98%.

The value we're interested in is p(2nd ball == red). In the N == 100 configuration, that's 100%: it contributes 100% * 1.98% to the final "score". In the N == 6 configuration, that's 5/99 (we already drew one red), so it contributes 5/99 * 6/5050 to the final score. Add up the final scores and you get 66.67%.

As long as you can feasibly enumerate all possible configurations and score them accurately, this approach basically never fails.


This answer should go to the top.


Except it doesn’t give much intuition for why?


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.


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.


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


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?


I think with a binomial the tilt is perfectly offset by the tilt you get from taking the ball.My math isn't fresh enough to write a nice dense statement showing why.

If you change their simulation formula to pull from a binomial instead of uniform... it looks 50/50.


The probability of flipping a coin and getting heads is the same as flipping ten coins, choosing one at random, and getting heads. Since the probability is the same, you have learned nothing about the distribution of unchecked coins.

Since the coins are independently flipped, you can assume that it’s still just a binomial distribution of size n-1 and the same p.


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


If I flip three coins and use the results to decide which color balls to put in a bag, I'll have one of these distributions: RRR,RRG,RGG,GGG. If I draw a red ball, I am more likely to have drawn from RRR or RRG than RGG (or GGG), so I have learned something about the distribution more than just how it was generated.


No you haven’t :)

Let’s ignore RRG because it becomes a 50-50 anyway.

RRR has a 100% chance of yielding Red. But is 3X less likely than RGG.

RGG has a 33% chance of yielding Red but was 3X more likely.

Edit: so still 50/50 Given a draw of red, you have exactly the same probability of having been in RRR and RGG. So you were equally likely to have 100% chance or a 0% chance.


You have two coins, one is biased heads and the other biased tails.

Someone picks a coin without you knowing which one, then starts flipping.

The first toss shows heads.

Does that mean subsequent flips from the same coin will be more likely to be heads?

Yes.

Answer is only no if all coins are the same with no bias, which they are not.


I’m not clear why you posted this. This is a different problem from the one being discussed.


The problem being discussed is the same as my toy example, just extended to more coins.

You now have 101 coins, with biases ranging from 100 percent heads (or urn with only red balls) to 100 percent tails (or urn with only green).

Someone chooses one of the 101 coins randomly (each coin has equal probability of being chosen) and starts flipping it.

First flip shows heads, what is the probability the next flip is also heads?

Answer is 2/3.

The point is that knowing what was the first flip gives information about what biases a coin may have.

The original problem has a minor technical twist that balls are drawn without replacement, but it’s an irrelevant detail for N>10 total balls.


I mean, sure, what you’re describing is relevant to the original discussion, but you’ve posted it in a sub thread about how it changes if it is a 50/50 binomial distribution.

You’ve replaced it with a binomial of a uniformly selected p, which ends up being, amusingly, the same as a uniform.


As long as you think the flipper chose their coin from a bag of coins with varied biases, then first flip always gives actionable information.

It’s mostly irrelevant what kind of distribution this bag of coins comes from (except for some degenerate cases). What matters is that selecting coins from this bag gives coins of varying biases.


Yes but the question being discussed assumes they are fair. That’s why it’s a different question.


Yes.


My first thought on this is, half the time there will be more red balls in the container. IF you draw a red ball first, you are more likely to be in the half that had more red balls. Therefore you are more likely to draw a second red ball. Yes, a small percent of the time you will be in the case that there are more green balls (maybe you got unlucky and pick the 1 red ball!) So my guess is that it isn't a huge percent higher, but it is more likely to be a red ball.


In these cases it's always good to think of extremes. For example for the Monte Hall problem imagine a million doors and all but one of them are opened, all empty, in any case. Then it's clear you originally had one in a million chances of picking the right door.

Two ways to think about this (same conclusion):

- Without loss of generality, take the case of just one red ball, rest are green. If you pick the one red ball on your first draw the chances are now 100% that the next ball is green (since there aren't any red ones left) whereas before you had picked the red one you had just a 99% chance of picking a green one.

Hence after picking a red ball you are slightly more likely to pick a green ball next.

- Another way to think of it, again without loss of generality consider if there was just one green ball and 99 red, then if you pick every one of them in some order there are a hundred different positions the green one could end up as. If you consider the one where it's last, after you have picked all but one (and they were all red), now you have a 100% chance to pick the green ball, even though you started out with 1% chance on the first draw: without loss of generality in the case of drawing until you reach the green ball when it is 1 in 100, each red ball you have drawn so far increases the chance of drawing the green ball next, up to a 100% chance when it is the only one left. Visualizing the chance going from 1% to 100% in this case as you draw more red balls should drive home the point that it becomes more and more likely you'll draw a green one next, in the cases that you've made it that far drawing red ones.)


>Without loss of generality, take the case of just one red ball, rest are green. If you pick the one red ball on your first draw the chances are now 100% that the next ball is green (since there aren't any red ones left) whereas before you had picked the red one you had just a 99% chance of picking a green one.

Your reasoning can conclude that picking a green ball next time is more likely for any specific bag contents. But you can't then conclude that picking a green ball the next time is more likely, period. Picking red the first time gives you information that changes the probability distribution of likely bag contents.


This is much easier to intuit if I imagine 101 urns.

One is 0% red, one 1% red, one 2% red, etc.

If I choose one urn at random, and then the first ball I pick is red, odds are good I picked a red-heavy urn.

I’d be interested to see if the general public answers differently when it is framed more concretely.


Follow up question:

> You are given an urn containing 100 balls; n of them are red, and 100-n are green, where n is chosen uniformly at random in [0, 100]. You select 99 balls at random and find that they are all red. What is the probability the last ball is red?


This is a fantastic follow up question. The last ball is overwhelmingly likely to be red, though this is very counterintuitive. The “all-red” urn and the “all-red-but-one” urn were equally likely to be chosen at the start. But the draws have given you a lot of info about which distribution you’ve been drawing from. Were you sampling from the all-red distribution, your draws would be totally unsurprising — you would observe a run of 99 consecutive reds 100% of the time. If you were you sampling from the all-red-but-one distribution, however, you’d only have observed this outcome 1/100 times.


50%. With current knowledge N is either 100 or 99 with an equal probability.


No, the chance of it being red is much higher. If there's one green ball in the jar, than all previous draws would've needed to avoid the green one. The chances of that happening are way less than 50%.


Initially there is an equal chance that there are 99 or 100 red balls.

But if there is a green ball, it is unlikely to be the last picked. So the fact that you saw 99 red balls makes it unlikely there is a green ball.


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 one red ball. The ball we draw next is more likely to be green (since we have 49 red balls vs 50 green balls)

Is my mistake that I took the expected value of the uniform distribution before the first ball was drawn? And I should think of the expected distribution of the urn given the first ball drawn was red? If so how would I go about that probabilistically? (i.e. how would I calculate

Exp [ n given first ball is red ] )

I can see that if the first ball was red, this removes one of the possible values (all balls are green)

And I can see how from all possible urns, the more they have red balls, the higher the likelihood the first ball drawn is red. I would assume this will skew the expected value somehow.

Is it like

``` expVal = 0

for all possible n (101 possible values): # possibility of first ball being red when we have n red balls * n * probability of n?

   expVal += (n / 100) \* n \* (1/101)
```

I'm sure the above is wrong, because this will just decrease the expected value where I am expecting an increase but I'm not sure how to model it

I would appreciate any pointers/help


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.


It's not 50 red and 50 green. There are 100 total balls, but you don't know how many are red or green. The number of reds is drawn from a uniform distribution, meaning the urn is equally likely to contain 1, 10, 55, or 99 red balls.


The fact that a red ball was drawn is new information that suggests there is a higher chance (however slight) that there are actually more red balls in the urn than green balls. Therefore the next ball is likely to be red.


Not a unique explanation, but thinking about it like this might make it easier to understand the right answer and the wrong answer that was initially intuitive to me.

Imagine calculating the odds by choosing the first ball from every permutation of red and green balls. And then do the same by choosing a random ball from each permutation. The odds of getting red on the first pick in either case is 50% - but it's not the same 50%!

With an example of three balls, there are 8 permutations. If we take the first ball from each row, 1-4 have a red ball, and so from there, 1 and 2 have a second red ball, making the chance of a second red ball given a first 50%. However, if we take a random ball from each row, we are guaranteed to get a red first in 1, and more likely to get one in 2, 3, and 5 than the others. In those cases, red will be next 67% of the time. (100% for 1, and 50% for 2, 3, and 4.)

1. rrr 2. rrg 3. rgr 4. rgg 5. grr 6. grg 7. ggr 8. ggg

Like in the Monty Hall question, knowing that the first ball is red tells us something about the rest of the balls, that most of them are probably red too.


Since it kept me up, I'll update..

Let's simplify and look at three balls, whose possible permutations are

1. rrr 2. rrg 3. rgr 4. rgg 5. grr 6. grg 7. ggr 8. ggg

There are two approaches that are intuitive and wrong, and then the right approach. Specifically it depends which question you're answering.

1. What are the odds when picking two random balls over and over from the same permutation.

  - You might assume the odds of each ball are completely independent, making the odds of a first red n/100, and then a second red slightly lower at n-1/99.  This is what happens when you pick two random balls over and over from the same permutation.
2. What are the odds when picking the first and second balls from a random permutation.

  - You might assume that if you've selected a red ball first you must be in permutations 1-4, making the odds of a second red ball 50% (permutations 1-2). This is what happens when choosing the first (and second) ball in order from a random permutation.
3. What are the odds when picking a random ball from a random permutation.

  - This is what we're actually being asked to do.

  - In this case the odds of picking red first are proportional to the number of reds in the permutation.  Specifically, picking red is guaranteed when in permutation 1, and 67% likely when in permutations 2,3, and 5, but only 33% likely when in scenarios 4, 6, and 7, and impossible in scenario 8. While it is equally likely to be in permutations 4 or 5, unlike scenario 2, you're more likely to choose a red ball when in 5 than 4, and in general, you're more likely to pick a red ball first when in a permutation that has more red balls to choose from. And because it does, the second draw is more likely to be red as well.

  - Like in the Monty Hall problem, the color of the first ball is, while random, unintuitively not arbitrary, but rather an indication that there are more balls of that color to choose from in the urn, which gives you an advantage in knowing what the second draw will be.


Change it to drawing from a normal distribution... the answer will change dramatically and get very close to what one would likely consider "common sense", ie that it remains close to 50/50. I think binomial gets it to 50/50.

Humans aren't wired for uniform distribution. 100 reds seems crazy unlikely compared to 50/50, yet this trick question makes those equally likely.


How would normal distribution change the result?

I am imaging a random number generated from truncated normal distribution with mean 50, clipped 0 and 100: the answer will still lean right.

How would binomial work? You have 101 urns from which to choose.


Normal: it is very close to 50/50. It does still lean, but only just. It's close enough that in practice any guess is fine.

Binomial: it is 50/50.

The reason these change the situation dramatically is that under normal or binomial, you are waaaay more likely to be in a situation that is close to 50/50 to begin with because they are way more likely to occur. The quirk of this question is that a 0 green 100 red urn is just as likely as a 50-50 red/green urn using a uniform distribution - hence if you get red on the first draw you are much more likely to be in a heavily tilted red urn.


How would binomial work here? You’re choosing amongst 101 urns of different proportions.

How do you narrow 101 choices into two?


OK, I'm seeing it now. Generalizing, imagine N+1 jars each containing N balls. The jars are numbered 0 through N. The jar numbered k has k red balls and N-k green balls.

We have N+1 people, also numbered 0 through N. Person k is holding jar k.

We ask each person to draw a ball at random from their jar. If they draw a green ball they take their jar and leave. If they draw a red ball they stay.

We expect on average (N+1)/2 people will remain.

We now ask them to draw another ball.

The expected number of red balls on this second drawing is (N+1)/3.

The expected number of green balls on this second drawing is (N+1)/6, half the expected number of red balls.

That's because on the first drawing, the more green balls in your jar the more likely you will draw green on the first round and thus take your jar and go home. The second round is biased toward people who have jars with more red balls.

Here's the math behind those results. The probability that person k makes it to round 2 is k/N. The expect number that will make it is sum {k=0, N) = (N+1)/2.

Once in round 2 the probability they draw red is (k-1)/(N-1). The probability they draw green is (N-k)/(N-1).

The probability then that they make it to the second round and then draw red is k/N (k-1)/(N-1).

The probability that they make it to the second round and then draw green is k/N (N-k)/(N-1).

The expected number of reds we see in the second round is sum {k=1, N} k (k-1) / N / (N-1).

The expected number of greens is sum {k=1, N} k (N-k) / N / (N-1).

Use the well known formulas 1 + 2 + 3 + ... + M = M (M+1) / 2 and 1^2 + 2^2 + ... + M^2 = M (M+1) (2M+1) / 6 and simplify and you'll get the (N+1)/3 expected red and (N+1)/6 expected green I stated above.


Classical don't think too much, calculate exercise.

1. Probability to pick green after a red for a given n is p = (100-n)/99

2. For all possible n given the first ball was red -> Integral_[0..100] (100-n)/99 * p(n|red) dn

3. So you need p(n|red) which is obviously different from p(n) for instance n=0 is not possible anymore -> p(n=0) = 1/101 != p(n=0|red) = 0

4. Again don't think to much, calc ... p(n|red) = p(red|n)p(n)/p(red)

p(n) = 1/101 (1 of 101 possible n, constant due to uniform distribution), p(red)=0.5 (due to symmetry since p(n) is uniform), p(red|n) = n/100 (n of 100 balls are red) -> p(n|red) = n/5050

5. plausibility check -> sum of p(n|red) for all n should be 1 -> (0 + 1 + 2 .. 100) / 5050 = 5050/5050 = 1

6. Hardest part, the integral from step 2. -> wolfram alpha says 0.33

7. It's a don't-think-too-much-calculate result, so don't be too confident )))


Seems to be fully depending on your interpretation of "more likely". If you take that as "more likely than it was before", then the answer is obviously "more likely to be green". If you take it as "more likely to be green or red this pull", then that answer would depend fully on the unknown distribution and the closest least wrong answer would be "don't know".

Backtranslating from the interpretation/answer pairs, if this was on a test I would go with the former interpretation and answer green.


But there is no unknown distribution. There is a latent parameter (the n that's uniformly sampled) whose distribution is known; so the distribution of colors for the next draw is well defined. "Depend fully on the unknown distribution" is a statement about the distribution conditioned on that latent parameter; even in that case, the answer isn't "don't know" but "whatever the ratio of remaining balls given that parameter, and the one drawn ball, is."

"Don't know" isn't a valid answer in this case; "Don't know" would be valid if we were not told that n has that uniform distribution.

Since (unconditionally) red and green are symmetric, and the first draw is 50-50, the 'more likely/less likely' has the same meaning whether you interpret it as 'more/less than 50-50' or 'more/less than before.' This is convenient; if not for this symmetry, the answer would depend on interpretation of the 'more/less likely' language and could be ambiguous. The way the problem is stated, it is not ambiguous because either reading leads to the same result.


Let me try again. In the first interpretation the red ball drawing signals an absence of the n=0 case for the distribution, so we have a very slightly biased shift towards the red side of the potential n's, now in [0-99] vs [0-100] before the draw, so the question becomes does probabilistic gain in red bias distribution outclass the potential increase in green bias (reds now having reduced by 1 in the particular chosen n we are dealing with)?

The second interpretation says that given any selected n, the probability of drawing green of the next ball from that urn can only increase or stay the same (in the all red balls urn case) compared to drawing from that urn before.

It is the absolute vs relative interpretation of what the 'more' refers to.

I'll grant that the inclusion of 'uniform' for n in the question suggests the absolute interpretation as the relative interpretation would be independent of the uniformity of n.

The question could have eliminated ambiguity by just asking for the probability of the next ball color, but given the context of a Google recruitment test they might be more interested in how candidates reason under uncertain conditions rather than their dry probability skills.


Consider a 100 x 101 grid (101 rows and 100 columns). Each row is a possible urn (from 0 green balls to 100 green balls). The columns correspond to the 100 balls in each urn. The rows are sorted by ascending number of green balls, and the columns are sorted by red balls first. Reduced to 10 x 11, this would be:

    RRRRRRRRRR
    RRRRRRRRRG
    RRRRRRRRGG
    RRRRRRRGGG
    RRRRRRGGGG
    RRRRRGGGGG
    RRRRGGGGGG
    RRRGGGGGGG
    RRGGGGGGGG
    RGGGGGGGGG
    GGGGGGGGGG
The rows are parallel universes, each of them equally likely. When you draw the first ball, the universes each split into 100 also equally likely universes, corresponding to which of the 100 balls you drew. So each of the 10100 grid cells represents a possible universe you can find yourself in, each equally likely.

When you draw red, you know that you are somewhere in the upper left triangle of Rs, which each R being equally likely.

    RRRRRRRRRR
    RRRRRRRRR
    RRRRRRRR
    RRRRRRR
    RRRRRR
    RRRRR
    RRRR
    RRR
    RR
    R  
It’s clear that you are more likely to be in the upper half of that triangle, because it contains more Rs. In fact, because there are 5050 Rs, and the upper 30 rows have 2565 Rs (I’m applying the triangle-number formula n * (n + 1) / 2), you’re more likely to be within the upper 30 rows (urns) than the lower 70 rows (urns), and hence it is clearly more likely that the second ball you draw is again red rather than green. (Though visualizing this further split of universes would require a 3rd dimension.)


I guess I'm late to the party, but here's my take.

There are 100 balls. First the host chooses N uniformly from [0, 100] (unknown to us) and makes N of them red and 100-N of them green. But it's annoying to paint 100 balls, right? So he does it this way instead: the host takes 100 white balls and puts them all in a row. Then he takes a black ball and puts it between balls N and N+1, and he declares to himself that all the white balls to the left of the black one will be "red," and all to the right will be "green." Then he has us randomly select two white balls without replacement, and depending on which side of the black ball they were, he'll paint just those two balls red or green accordingly before showing us! Since we never see the other 98 unpainted white balls, we'll never know the difference between this setup and the original.

(I think it's intuitively obvious that this setup is mathematically equivalent to the original, i.e. generates the same distribution, so I won't try to justify that rigorously.)

Actually though, the host does it slightly differently, again without changing the underlying distribution: you see, he actually starts with 101 white balls, all in a row, and he begins by randomly selecting one of them and paints it black, and then proceeds as above.

But this gives the whole problem away: there are 101 white balls in a row, and three are drawn uniformly at random without replacement. The first one is declared "black," and the other two are red or green depending on their positions relative to the black one. All three-ball sequences are equally likely, so by symmetry, the probability that the black ball is between the second and third is exactly 1/3. The other two balls, the ones we draw, are different colors if and only if the black ball is between them, so the probability that we get two balls of the same color is exactly 2/3.

That's the answer: whatever is the color of the first ball we draw, the second one has that color with probability 2/3. Thus, the second ball is red with probability 2/3.


Very cool way to think about it, I like it.


Somewhat related is the "boy or girl paradox" ( https://en.m.wikipedia.org/wiki/Boy_or_girl_paradox ), where the answer to "Mr. Smith has two children. At least one of them is a boy. What is the probability that both children are boys?” may be 2/3 instead of 1/2. The problem is much debated.

I was made aware of this paradox by the book Bernoulli's Fallacy by Aubrey Clayton ( https://www.goodreads.com/book/show/55825328-bernoulli-s-fal... ), which I do recommend as an interesting read.


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


There are actually 10,100 equally likely situations: 101 choices of N x 100 choices of ball. When you completely discount the N=0 case, it’s because all choices of ball are green. You similarly need to almost completely discount the N=1 case, because almost all choices of ball in that situation are green, etc.


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.


It seems totally obvious that about 3/4 of "red first" cases happen with red majority urns.

I tried to think how so many people could get confused into thinking anything else.

I've read the code, and I still don't get it.


Seems that the notion of `uniformly` is the key aspect here, i.e. "the sets are ordered" in my intuitive notion.

So if the first one you've picked is red, then the only way for the next one to be green is if you started in the set of one red ball + 99 green balls; so you'd have to "pick" one specific set out of 100 possible (set of "all are green" is already impossible at this point), which is why it is very unlikely, and so you should expect the next one to be red.

And the more reds in a row you pick, the less likely you are to see a green one.


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)


The book Innumeracy that you linked: why did you call it "the Erdos book"? It is not connected to Erdős in any way, as far as I can tell.


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!).


The key is the initial assumption "n is chosen uniformly at random in [0, 100]". This is rare in real life and few people can really understand it immediately. In real life it's usually like "each ball can have certain chance to be red or green", in that case n is highly likely to be in the middle instead of equally distributed among [0,100].


One gets Bose-Einstein statistics from the same urn setup: if you draw two marbles from such an urn, the three combinations RR, RG, GG are equally likely.

An obvious visual proof: Line up 101 marbles. Choose one to be the divider; to the left is red, to the right is green. Now draw two more marbles. Or just pick three, then decide which one is the divider.


It's as ill posed as the Monty Hall problem. The issue is in what it means for the first ball to picked randomly.

Would the question be valid if the first ball was green? If not, then it's equivalent to the standard answer to the Monty Hall problem. Analyze it as if the first ball was not picked randomly (i.e. Monty intentionally picked the wrong door).


I'm not sure why you think it is ill posed. The question is, you randomly pick a ball, IF it is red then... So yeah, it is basically the same as "someone else removes a red ball" now randomly select a ball. OR Pick a ball, is the color of the second ball more likely to be the same as the first, different, or equal. That is really the question here.

edit: After thinking about it some more, it is NOTHING like handing the bag to someone else and having them remove a red ball. The whole point to the first draw is to draw the ball randomly. I think my second statement is still true. But to your original question, if the first ball isn't red, then the question is invalid (and you can't throw the ball in and choose again)


Forgive my frequentist bent, but:

When in doubt, simulate (with code). Do this N times for a large N, and take the ratio to get a probability estimate.

So the question is: How will you code it? You'll find half the people code it one way (to get one answer), and the other half will code it differently to get a different answer. That's because it is ill posed.

As an example, I would code it as:

Let n be a random number from 1 to 100 (cannot be 0!)

We throw away one red ball as we know we picked one.

Construct a list of n-1 red balls, and 100 - n green balls.

Pick a ball at random. Success if it is red.

Repeat this N times where N is large.

Take the ratio of successes with N.

When I run it, I get 50%

How would you simulate it differently?

The problems with the code in the submission:

If n==0, he continues, but still counts it as a trial (he still divides by num_trials). He should deduct the number of trials every time n==0.


The revised code here gets to correct estimate: https://news.ycombinator.com/item?id=39198581

Roughly similar to what I wrote too.


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.


Yes, but which door has the goat behind it?


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.


Interestingly, you get 2/3 no matter how many balls you have, doesn’t have to be 100.


Imagine you have to guess a random number between 0 and 255, i.e. you have to guess 8 bits. You already know that it's less than 128 so the most significant bit is 0. Can you derive any knowledge about whether the second bit is 0 or 1?


Watch out. Because your bits are indexed you have a different problem than before. The first red ball does not give you a significant bit.

Instead: Make a sample and now you know that it is greater than a random number unknown to you. Can you derive any knowledge about your next sample?


Indeed, indexing changing probabilities is very unintuitive for most people. Here's another fun one.

There's two coins on the table that you don't see. The only information provided is that

a) one of them is tails b) the left one is tails

What is the probability of both being tails?

It's 1/3 in (a) and 1/2 in (b). The reasoning being:

1. At first both HH, HT, TH and TT are all equaly likely. 2. In case (a) we discard HH as an option, but in case (b) we discard *both* HH and HT.


Yes, my fault. In fact random numbers between 0 and 255 don't have the property that number-of-set-bits have uniform distribution.


I'm stuck at the first continue statement. Doesn't that suck up one of your num_trials? This can never happen per the conditions laid out, but then you put num_trials in the denominator when returning the percent of times it was green.


Early in my career, when I first started interviewing, I used to ask a version of this to recent grads. It was never a make-or-break question, but I found it to be a great way to a.) see how people approach problem solving and probability and b.) see how they respond when you start asking whys (even if they answered/guessed 1/3). It's something that takes zero code to answer, and the intuition is easy to grok once explained.

The other part I particularly enjoyed was the people who initially guessed wrong, but then got to the answer intuitively almost always sent me code proving the answer.

For the record, my question was: "Two points are randomly and uniformly selected on a line 0.0 to 1.0. What is the most probable distance between the two points?"


  > what is the most probable distance between the two points?
  > even if they answered/guessed 1/3
1/3 is not the most probable distance, it's the expected value. The most probable distance does not exist, but PDF(d) is strictly decreasing for (d>0).


You're right. Thinking back, I think I asked "what's the average distance" not "what's most probable".


> Two points are randomly and uniformly selected on a line 0.0 to 1.0. What is the most probable distance between the two points?

Unless I am reading this wrong, I think all values between 0 and 1 have an equal probability (of 0).

The probability that a random uniform variable will equal any number between 0 and 1 is zero. It seems to follow that the probability of the difference between two uniform variables equaling any exact value would also be 0.

Have I missed something obvious? If zero really is the correct answer, that is pretty tricky.


You have two random uniform variables and the distance/difference/change between to finite points.

Put another way (and code it up if you want). Select two random uniformly distributed points between 0 and 1. Do this 10_000 times, whats the average distance between the two?

This gets to the question of "most probable" vs "expected value". A conversation I always welcomed.


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}


Off the top of my head and using my fingers the probability is:

4901:4900 in favor of red. (100*98/2 = 100*49. Plus one in favor of red)

If the number of distribution were odd, the odds would be even.

Am I right?


Where did you get 98 from?

Let's try it as a set of 3 balls. You have 3 balls in an urn, random number of red v green, the first one you pull is red, what's the likelihood that the second one you pull is also red?


Those are the distributions that perfectly mirror. There is another one that is alone that has an extra ball, 50:49.

So I added one to one side instead of 50 and 49 to the other.

So 4950:4949.

... is that right? Im pretty sure red is favored, and Im pretty sure if the number of dists were odd the odds would be even. But are the odds right?


Seems like there's some ambiguity in the problem.

"More likely to be red"

More likely than what?

"The next ball you draw from this urn is more likely to be red than green?"


I would say red because n is probably larger than 50 if the first one picked was red


Just to be clear. Red is the correct answer, right?


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.


> Intuitively, given that you picked a red ball, you should expect there to be more red balls in the urn.

This is what a math person would say, I had seen it many times in science, but is not the correct answer. The correct answer would be: "my sample is too small to carry so much information as I'm claiming that it has".

Intuitively If I walk on the street and I see a woman, I can't say anything about the proportion of men and women in the area, absolutely nothing, except: "number of women > 0". This is my result. Is dull and not publishable but also the only that I can infer about the population, because is under-sampled.

If the experiment is to take a ball from a bag, see its color and think that I can calculate the number of red balls with only this info, my goals are not realistic

I need to keep sampling. (not repeating, sampling the same population, doing ten times an experiment that provide tiny amounts of info will not generate new info about the first population from the air. The populations are independent). You need to improve the size of your sample over the same population.

Lots of the early ecology models that are flawless from a math point were basically useless when applied to the real life exactly for this.


Sure, the actual difference in probability is minute, so it essentially has 0 predictive power.

That is, statistics also tells us that P(n>50 | first ball is red) ~= P(n>50) ~= P(n<50) ~= P(n<50 | first ball is red).

Of course, the problem statement is not realistic in the slightest because it gives you too much other (critical) information as well: you are told that n has a uniform probability distribution. In reality, you never know the probability distribution a priori (even when analyzing a die or coin, you can't be a priori certain it is fair). And the conclusion in this problem, even weak as it is, depends critically on knowing the probability distribution. Not only would the conclusion be different is n was not uniformly distributed between 1 and 100, but you can't even do a similar analysis over all possible probability distributions.


You're almost there with your intuition.

You just now need to simulate drawing two balls without replacement for each of your 101 urns (from first urn with n=0 to last urn with n=100).

Then you take the conditional probability of seeing the first ball as red, and calculating the number of times you see the next ball as red.

You will find that you are more likely to get red than green.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: