Live data from Hacker News

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

colab.research.google.com

131–140 of 169 posts

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

#131

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.

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

#132
post #83

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 ex…

> 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 equalin…

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.

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

#133
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…

Why are we excluding red, green, red?

The balls in the container are not ordered.

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

#134
post #36

Earlier quoted context omitted.

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.

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

#135
post #42
post #36

Earlier quoted context omitted.

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.

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.

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

#136
post #135
post #42

Earlier quoted context omitted.

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

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.

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

#137

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.

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

#139

Earlier quoted context omitted.

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.

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

#140
post #139

Earlier quoted context omitted.

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.

Post reply on HN