Comments on: Looking for help with a question of probability.
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability/
Comments on Ask MetaFilter post Looking for help with a question of probability.Fri, 01 Sep 2006 13:17:37 -0800Fri, 01 Sep 2006 13:17:37 -0800en-ushttp://blogs.law.harvard.edu/tech/rss60Question: Looking for help with a question of probability.
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability
MathFilter: Okay, I've got this gumball machine, which contains an infinite amount of gumballs, evenly distributed between 100 different flavors... <br /><br /> Unfortunately, the machine is broken, and three-quarters of the time I turn the crank, I get nothing. When the machine does deliver, it has a 1 in 20 chance of giving two gumballs instead of just one.<br>
<br>
After how many cranks would I have a 50% chance of having at least one gumball of every flavor? How many for a 99% chance?<br>
<br>
Please show your work, as I'm trying to learn how to answer questions like this for myself. :)post:ask.metafilter.com,2006:site.45732Fri, 01 Sep 2006 12:47:07 -0800rifflesbymathprobabilitygumBy: forforf
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699089
I'll provide hints. Maybe somebody else will <strike> do your homework</strike> answer your question directly.<br>
How many gumballs will it take have a 50% likelihood that you will have one of each flavor?<br>
How many cranks does it take to get that many gumballs?comment:ask.metafilter.com,2006:site.45732-699089Fri, 01 Sep 2006 13:17:37 -0800forforfBy: feloniousmonk
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699095
<a href="http://www.gomath.com/htdocs/lesson/probability_lesson9.htm">http://www.gomath.com/htdocs/lesson/probability_lesson9.htm</a><br>
via <a href="http://justfuckinggoogleit.com/">http://www.google.com</a>comment:ask.metafilter.com,2006:site.45732-699095Fri, 01 Sep 2006 13:20:48 -0800feloniousmonkBy: cortex
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699098
First: the number of cranks required to get a gumball, on average.<br>
<br>
- A crank has a probability p<sub>nada</sub> = .75 chance of producing nothing.<br>
- A crank has a p<sub>ball</sub> = .25 chance of producing one or two gumballs.<br>
- p<sub>ball</sub> is broken down into p<sub>one</sub> and p<sub>two</sub>, the chances respectively of getting one gumball or two. <br>
- 1 in 20 successful (p<sub>ball</sub> = 0.25) cranks produces two balls, so p<sub>two</sub> = 0.25 * 0.05 = 0.0125, and p<sub>one</sub> = 0.25 * 0.95 = 0.2375.<br>
<br>
In summary:<br>
p<sub>nada</sub> = 0.75<br>
p<sub>one</sub> = 0.2375<br>
p<sub>two</sub> = 0.0125<br>
<br>
Now, multiply the gumballs yielded for each possibility by it's probability value p:<br>
<br>
0 * 0.75 = 0<br>
1 * 0.2375 = 0.2375<br>
2 * 0.0125 = 0.025<br>
<br>
Sum those up, and you get the long term average rate of gumballs per crank: 0.2675. To restate that as the number of cranks required to get a gumball, take the inverse of the value: 1 / 0.2675 ~ 3.738.<br>
<br>
Now you know how many cranks it takes to produce a gumball. You've safely partitioned the problem into two parts, and you can proceed to step two: how many gumballs do you need to produce to hit the 50% chance of having one of each flavor? 99%?comment:ask.metafilter.com,2006:site.45732-699098Fri, 01 Sep 2006 13:24:29 -0800cortexBy: Humanzee
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699121
I'm reluctant to provide a complete solution because this <i>does</i> smack of homework (although insanely difficult homework).<br>
<br>
Unfortunately, it isn't enough to calculate the average number of cranks per gumball, because we're talking about at least 100 gumballs, and thus on the order of 400 cranks. With that many cranks, the standard deviation will be high. If you want to get the correct number of cranks exactly, you will have to account for the distribution of cranks.<br>
<br>
Thus you must ask, what is the probability of getting N gumballs with C cranks, and multiply that by the probability of getting at least one of each type given that you have N total. Since N is a free variable, you must then sum this answer over N, and see this sum meets your threshold probabilities.<br>
<br>
This problem is quite challenging if it is a homework assignment. Although there is the possibility of there being a closed-form solution, it would be far faster to have a computer check this out numerically (i.e. calculate the probability for a given number of cranks, and see if it's sufficient), than it would be to try to find a formula that spits out the answer.comment:ask.metafilter.com,2006:site.45732-699121Fri, 01 Sep 2006 13:42:00 -0800HumanzeeBy: vacapinta
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699129
This doesn't make a good "learning probability" question. What Humanzee said above, plus the second part of finding the number of gumballs needed to give you an X% probability of having found them all is not an easy problem, relying on messy sums of permutations.comment:ask.metafilter.com,2006:site.45732-699129Fri, 01 Sep 2006 13:52:07 -0800vacapintaBy: rifflesby
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699143
<i>I'm reluctant to provide a complete solution because this does smack of homework (although insanely difficult homework).</i><br>
<br>
Nope, I'm well out of school. This is a restatement of a mechanic I'm working on for the online game I write for, and I wanted to get some solid numbers to see if I might need to tweak the rate at which the "gumballs" drop.<br>
<br>
Incidentally, can anyone recommend a good textbook on probability? Preferably one I can order from Amazon?comment:ask.metafilter.com,2006:site.45732-699143Fri, 01 Sep 2006 14:03:47 -0800rifflesbyBy: leapfrog
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699157
This leaves me to wonder about the probability that carefully watching your Ask Mefi questions can help advance my KoL character when the new content hits. (likely very, very small.)comment:ask.metafilter.com,2006:site.45732-699157Fri, 01 Sep 2006 14:20:41 -0800leapfrogBy: Humanzee
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699160
Oh, so your homepage <i>really is</i> the Kingdom of Loathing?<br>
<br>
Since this is just for a game, I'm assuming that rough approximations should be good enough for now, in which case one <i>can</i> approximate that the number of cranks is just N times the averge number of cranks per gumball.<br>
<br>
Some further approximations yield a decent rough formula:<br>
<br>
Cranks = 3.7 * log(1 - Prob^.01) / log .99<br>
where Prob is the threshold you set (.5 or .99)<br>
<br>
If you decide to mess with your formula to make it easier to get meat-flavored gumballs, or whatever, the .01 is just 1/ #types, and the .99 is 1 - 1/#types, so alter them accordingly.comment:ask.metafilter.com,2006:site.45732-699160Fri, 01 Sep 2006 14:25:53 -0800HumanzeeBy: jessamyn
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699278
<small>[few comments removed, take speculations about homework to metatalk or email]</small>comment:ask.metafilter.com,2006:site.45732-699278Fri, 01 Sep 2006 16:46:04 -0800jessamynBy: teleskiving
http://ask.metafilter.com/45732/Looking-for-help-with-a-question-of-probability#699547
FWIW I knocked up a quick MATLAB script to simulate your machine and the results from this do correspond well with Humanzee's expression.comment:ask.metafilter.com,2006:site.45732-699547Sat, 02 Sep 2006 04:23:56 -0800teleskiving