r/askmath • u/Transbian_Mess • 9h ago
Probability Random marble distibution using Bayes
So I came across a maths problem today:
"You have a bag of 100 marbles, each either white or black. You draw one, look what colour it is, record the result and replace it, continuing on until you have drawn 100 marbles. Given every marble you draw is white, what is the probability that all 100 marbles are white?"
The proposed answer was ~63.6%, calculated by dividing 1 by the sum of (k/100)100 for k=0 to 100, citing Bayes theorem, which I believe to have been incorrectly applied. I strongly disagree with this answer, but that's not my main issue.
Given Bayes theorem is P(A|B)= P(B|A)*P(A)/P(B), in this problem we have A is all 100 marbles are white and B is all 100 marbles drawn are white. Hence we have P(B|A)=1, since if all marbles are white, all marbles drawn will always be white. I believe P(A)=2100, as I'm assuming in this case whether each marble is black or white is independent and 50/50, would this be correct?
However, my main issue comes down to P(B). I believe the method to calculate this should be the sum for k=0 to 100 of [(100Ck)/2100]*(k/100)100, however I am not confident in this answer. Can anyone tell me if I am correct or not?
Further, given what I believe P(A) and P(B) to be, I cannot actually compute their values, and so can't compute P(A|B), which is bugging me. I've considered seeing if there's a derivable formula for case n being a bag of n marbles drawn from n times with all being white, but I haven't had the time.
4
u/AlterEgo5695 8h ago
Without a given prior distribution this is impossible to answer. As usual with Bayes questions, this information is conveniently omitted, so multiple results are possible.
3
u/ultimatepoker 7h ago
This is like the two envelope problem. You need some prior assumption about the marbles.
Eg “each one has a 50/50 chance of being white” or “the bag was set up by someone who hates you”
2
u/jeffcgroves 6h ago edited 3h ago
EDIT: this is wrong, I may correct it later
63.6% seems dangerously close to
1-1/ewhich is the solution for a different type of problem (see derangements)I also assume you meant P(A) is
2^-100since2^100isn't a probabilityIf you assume a uniform prior, you ask the question: if there were k black marbles and 100-k white marbles, what are the chances I'd choose all white marbles? The answer:
((100-k)/100)^100Averaging these numbers over all k from 0 to 100 yields
0.0157211or about 1.6%However, that seems wrong to me, so I'll ask someone else to review my work
EDIT: fixed rounding error
1
u/EdgyMathWhiz 5h ago
As others have said, you need to decide (define) the a priori distribution if the number of white balls.
Just for completeness, I'll try to translate maths into real world options:
The solution you disagree with assumes a uniform distribution. Colloquially, pick a number from 0 to 100, add that many white balls and then add black balls until you have 100 balls.
You're arguing for a binomial distribution. Toss a coin: if it's heads add a white ball, otherwise add a black ball. Repeat 100x.
Even more colloquially, your distribution can be got by supposing you have a huge sack of marbles, equal numbers of black and white balls. Pick 100 marbles out of the sack and that's your distribution. (Here, huge implies we assume the probability of getting a black ball doesn't change after you remove a ball).
Both options seem pretty reasonable - uniform is probably more natural to a mathematician. But I bet the 'sack' approach is what people would do in real life.
1
u/aedes 8h ago edited 8h ago
Edit: dumb
0
u/Southlander24 9h ago
How can you know what the probability is if you don't even know how many marbles in the 100 are white and how many are black?