etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 2nd, 2014 at 3:53:06 PM permalink
If there are ten marbles in an opaque bag, nine of which are red and one of which is green, and I replace the marble each time after randomly picking it, the odds of picking the green one in my first ten tries are 1-(9/10)^10, or 65.132%. My question is, what are the odds I will pick the green marble exactly three times in ten tries? What are the odds I will pick the green marble at least three times in ten tries? How did you arrive at this conclusion?

Thanks!
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
February 2nd, 2014 at 4:16:56 PM permalink
This sounds like a homework assignment.
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 2nd, 2014 at 4:56:33 PM permalink
It's actually not a homework assignment. I am trying to figure out how to do this type of problem so that I can estimate how long it will take certain independent events to happen in video games. For example, if there's a 1/64 chance of something happening every time you do something in a game, I can do whatever it is twice per minute, and I want it to happen ten times, I want to be able to estimate how long it will take for me to be able to get it to happen 50% of the time.

Edit: Using an old SNES game called EarthBound as an example (because it's the first one that comes to mind), there's an enemy that drops an item called the Star Pendant 1/256 of the time (technically 1/128, but 1/256 in practice). It is optimal to obtain three Star Pendants in this manner. If I were to fight 400 of these enemies, what are the odds that they will drop at least three Star Pendants? How many of them would I have to fight to reach 50% odds? This sort of problem has always tripped me up, since I never learned how to do it.

To put it in a gambling perspective, if your odds of getting dealt a Royal Flush in Jacks or Better is .0025%, or 25/1000000, and you played 50000 hands, what are the odds that you will get at least two Royals in those 50000 hands?
tringlomane
tringlomane
  • Threads: 8
  • Posts: 6284
Joined: Aug 25, 2012
February 2nd, 2014 at 5:34:00 PM permalink
Quote: etony33

If there are ten marbles in an opaque bag, nine of which are red and one of which is green, and I replace the marble each time after randomly picking it, the odds of picking the green one in my first ten tries are 1-(9/10)^10, or 65.132%. My question is, what are the odds I will pick the green marble exactly three times in ten tries? What are the odds I will pick the green marble at least three times in ten tries? How did you arrive at this conclusion?

Thanks!



Why not ask the actual question though instead? But, to be honest, the marble example is more clear though. :)

Your answer lies in "binomial distribution":

http://en.wikipedia.org/wiki/Binomial_distribution

http://mathworld.wolfram.com/BinomialDistribution.html

Note: C(x,y) is the binomial coefficient: http://mathworld.wolfram.com/BinomialCoefficient.html
C(x,y) = x!/(x-y)!/y!, where x! = x*(x-1)*(x-2)*.....*1

So to get exactly 3 marbles:

P(3/10) = C(10,3) x (1/10)^3 x (9/10)^7 = 120 x 0.001 x 0.4782969 = 0.057395628

To get "at least three" you need to sum P(0/10) + P(1/10) + P(2/10)

P(0/10) = C(10, 0) x (1/10)^0 x (9/10)^10 = 1 x 1 x 0.3486784401 = 0.3486784401

P(1/10) = C(10, 1) x (1/10)^1 x (9/10)^9 = 10 x 0.1 x 0.387420489 = 0.387420489

P(2/10) = C(10, 2) x (1/10)^2 x (9/10)^8 = 45 x 0.01 x 0.43046721 = 0.1937102445

Probability of two or less marbles: 0.3486784401 + 0.387420489 + 0.1937102445 = 0.9298091736

So the probability of three or more marbles is: 1 - 0.9298091736 = 0.0701908264


As for the >50% question, it is better that you calculate all the probabilities of the distribution and sum them up until you get beyond the 50% point.

Fortunately, spreadsheet programs like microsoft excel can do that for you. And the "cumulative" flag does the summing for you automatically.

http://support.microsoft.com/kb/827459
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 2nd, 2014 at 6:01:10 PM permalink
Thank you!
paisiello
paisiello
  • Threads: 21
  • Posts: 546
Joined: Oct 30, 2011
February 2nd, 2014 at 6:17:10 PM permalink
Quote: etony33

...what are the odds I will pick the green marble exactly three times in ten tries?


This is simply a Bernoulli trial with probability of success p=1/10 =.1:
P(s=3) = C(n,s)(p)^s(1-p)^(n-s)
= (10!)/(3!(10-3)!)(.1)(1-.1)^(10-3)
= (120)(.001)(.478)
= 5.7%

Quote: etony33

...what are the odds I will pick the green marble at least three times in ten tries? How did you arrive at this conclusion?


P(s>=3) = 1 - P(s=0) - P(s=1) - P(s=2)
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 2nd, 2014 at 7:19:57 PM permalink
Another question: what about when you start dealing with a large number of events? Using my Royal Flush (getting two Royals in 50000 hands, assuming .0025% odds) example, it would be
(50000!/[50000-2]!/2!)*.000025^2*.999975^49998

50000! is a number that is extremely large, to the point that most calculators won't even deal with it. Is there any way to break it down into numbers that are small enough to punch into a calculator?
tringlomane
tringlomane
  • Threads: 8
  • Posts: 6284
Joined: Aug 25, 2012
February 2nd, 2014 at 7:32:58 PM permalink
Quote: etony33

Another question: what about when you start dealing with a large number of events? Using my Royal Flush (getting two Royals in 50000 hands, assuming .0025% odds) example, it would be
(50000!/[50000-2]!/2!)*.000025^2*.999975^49998

50000! is a number that is extremely large, to the point that most calculators won't even deal with it. Is there any way to break it down into numbers that are small enough to punch into a calculator?



Yes.

50000!/(50000-2)!/2! = 50000*49999*49998!/49998!/2! = 50000*49999/(2*1) = 1,249,975,000
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 3rd, 2014 at 6:32:29 AM permalink
"The odds of something's happening exactly x times out of y chances, when the odds of it happening are z, the formula is (y!/x!(y-x)!)*z^x*1-z^1-x"

Is this statement ALWAYS true, or are there exceptions?
kubikulann
kubikulann
  • Threads: 27
  • Posts: 905
Joined: Jun 28, 2011
February 3rd, 2014 at 7:37:47 AM permalink
Quote: etony33

"The odds of something's happening exactly x times out of y chances, when the odds of it happening are z, the formula is (y!/x!(y-x)!)*z^x*1-z^1-x"

Is this statement ALWAYS true, or are there exceptions?

This statement is NEVER true. The formula actually gives the probability, not the odds! (and also considering z to be a probability, not odds)
Reperiet qui quaesiverit
etony33
etony33
  • Threads: 5
  • Posts: 23
Joined: Feb 2, 2014
February 3rd, 2014 at 7:57:21 AM permalink
Okay. Well, if I replace the word odds with the word probability, then is it always true?
kubikulann
kubikulann
  • Threads: 27
  • Posts: 905
Joined: Jun 28, 2011
February 4th, 2014 at 2:02:36 AM permalink
Yes it is.
Reperiet qui quaesiverit
  • Jump to: