73 points · by eigenvalue · 2y ago · 159 comments
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.
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?
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"
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.
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.”
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.
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.
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.
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."
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.
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).
`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?
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.
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.
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%
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.
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.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
If you change their simulation formula to pull from a binomial instead of uniform... it looks 50/50.
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.
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.
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.)
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.
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.
> 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?
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.
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
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.
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.
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.Humans aren't wired for uniform distribution. 100 reds seems crazy unlikely compared to 50/50, yet this trick question makes those equally likely.
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.
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 do you narrow 101 choices into two?
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.
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 )))
Backtranslating from the interpretation/answer pairs, if this was on a test I would go with the former interpretation and answer green.
"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.
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.
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.)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.
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.
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
> 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.
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.
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.
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):
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.
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).
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)
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.
Roughly similar to what I wrote too.
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.
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.
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?
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.
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).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.
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.
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}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?
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?
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?
"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?"
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.
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.
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.
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 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.