View Full Version : Science A little help in probability and stats?

Rain Man

09-17-2012, 05:04 PM

Man, I'm out of touch on this stuff.

I have 100 orbs*, 50 of which are red and 50 of which are white. I draw 10 of them out randomly without replacement.

How many total combinations can be drawn, and how many of them occur in each of the 10 potential outcomes (e.g., 0 red and 10 white, 1 red and 9 white, etc.)

I need to do this calculation to save the earth from being hit by a large asteroid, so quick help would be appreciated. If we survive, I'll give you rep.

* - I'm not going to say balls because it'll divert the thread.

Bowser

09-17-2012, 05:06 PM

Colored balls? That's racist.

Bowser

09-17-2012, 05:08 PM

And just off the top off my head, isn't the answer either 10,000 or 10,000,000 possible combinations? Or somewhere inbetween?

I take cashier checks or PayPal for the rep.

DaFace

09-17-2012, 05:12 PM

Well, there are only 11 possible combinations, so that part's easy. (0/10, 1/9, 2/8, etc.) In notation, that'd be C(2,10) I think.

As for the probability of each combination being drawn, I'd have to dig back to remember how to do that part.

Saul Good

09-17-2012, 05:13 PM

There are 11 combinations. I don't understand the second part of your question.

Rain Man

09-17-2012, 05:46 PM

I know there are 11 different combinations if you ignore order (2 red, 8 white, etc). What I'm trying to get at is the number of actual different draws you can have (e.g. 1 red followed by 9 whites// 1 white, then 1 red, then 8 more whites//2 white, then 1 red, then 7 more whites, etc.)

I apologize for not having the terms down right.

I want to build a graph that says if you draw every possible combination in every possible order, how many times does each final combination appear?

For example, if I only draw 4 balls out of the 100, my possible pulls are:

WWWW

RWWW

WRWW

WWRW

WWWR

RRWW

RWRW

RWWR

WRRW

WRWR

WWRR

RRRW

RRWR

RWRR

WRRR

RRRR

So I can count the following

1 instance of 0 reds

4 instances of 1 red

6 instances of 2 red

4 instances of 3 red

1 instance of 4 red

I need to do this again, but with 10. I don't remember the equation to figure it out, and don't remember the nomenclature to even look it up. There's an 82 percent probability that I'm screwed.

Third Eye

09-17-2012, 05:59 PM

This is pretty easy, give me a sec.

Third Eye

09-17-2012, 06:04 PM

There are 100C10 possible outcomes, which is a big number, roughly 1.73e^13. It will take a minute do the breakdown by type.

Third Eye

09-17-2012, 06:11 PM

Actually, you probably need a more exact number, so 17,310,309,456,440 is the total number of combinations. Ok, back to breaking it down by type.

AustinChief

09-17-2012, 06:22 PM

The term you are looking for is permutations. (solve using factorial)

Third Eye

09-17-2012, 06:26 PM

For 0 W, 10 R: 10,272,278,170

For 1 W, 9 R: 125,271,685,000

For 2 W, 8 R: 657,676,346,250

This is taking a minute longer than I thought it would, having to use a calculator on the PC as my TI-83 rounds at a certain point.

Third Eye

09-17-2012, 06:27 PM

The term you are looking for is permutations. (solve using factorial)

Actually, he's looking for combinations since order doesn't matter. At least I hope he is.

Red Beans

09-17-2012, 06:27 PM

The answer is 7 miles per hour. You can thank me later.

AustinChief

09-17-2012, 06:34 PM

Actually, he's looking for combinations since order doesn't matter. At least I hope he is.

ah, i just looked at his example showing order and thought he needed ordered. my bad.

Now that I have gone back and read what he is asking, it's actually even more complicated due to the fixed set he is working with if he is asking for a statistical comparison.

Man, I'm out of touch on this stuff.

I have 100 orbs*, 50 of which are red and 50 of which are white. I draw 10 of them out randomly without replacement.

How many total combinations can be drawn, and how many of them occur in each of the 10 potential outcomes (e.g., 0 red and 10 white, 1 red and 9 white, etc.)

I need to do this calculation to save the earth from being hit by a large asteroid, so quick help would be appreciated. If we survive, I'll give you rep.

* - I'm not going to say balls because it'll divert the thread.

Hey Rain Man,

That's the hypergeometric distribution. Excel has a function hypergeomdist() for that.

Here's the Wolfram link on the hypergeometric distribution:

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

--Dan

Saul Good

09-17-2012, 06:38 PM

You guys are making this too hard. The fact that there are 100 balls doesn't factor into the equation because we're looking for possibility, not probability. If I understand the question correctly, it's two to the tenth power.

Third Eye

09-17-2012, 06:41 PM

For 3 W, 7 R: 1,957,734,240,000

For 4 W, 6 R: 3,659,628,210,000

For 5 W, 5 R: 4,489,143,937,600

From here, you have everything you need. There are the same number of 4 W and 6 R as there are 6 W and 4 R.

Third Eye

09-17-2012, 06:46 PM

Hey Rain Man,

That's the hypergeometric distribution. Excel has a function hypergeomdist() for that.

Here's the Wolfram link on the hypergeometric distribution:

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

--Dan

This is absolutely right if all he needs is the probability of drawing any particular number. Since he asked for the number of combinations, I gave them to him.

AustinChief

09-17-2012, 06:49 PM

Hey Rain Man,

That's the hypergeometric distribution. Excel has a function hypergeomdist() for that.

I was just looking online for a calc for it.. this is the best I could find http://stattrek.com/online-calculator/hypergeometric.aspx

Should be able to run it for each possible outcome and get your statistics.

(unless I'm not understanding what he is asking for)

AustinChief

09-17-2012, 06:56 PM

Ok here should be the solution if I understand what you need.

obviously, 11 combinations

red,white - prob.

0,10 - 0.000593419672585829

1,9 - 0.00723682527543693

2,8 - 0.0379933326960439

3,7 - 0.11309643221148

4,6 - 0.211413217031686

5,5 - 0.259333546225535

6,4 - 0.211413217031686

7,3 - 0.11309643221148

8,2 - 0.0379933326960439

9,1 - 0.00723682527543693

10,0 - 0.000593419672585828

Pitt Gorilla

09-17-2012, 06:56 PM

You guys are making this too hard. The fact that there are 100 balls doesn't factor into the equation because we're looking for possibility, not probability. If I understand the question correctly, it's two to the tenth power.I thought this initially, as he simply asked for the possible outcomes. HOWEVER, he also noted that he's sampling 10 (ostensibly pulling one at a time) without replacement. The without replacement part wouldn't matter if he was only interested in possible outcomes.

We needed a clearer description of the actual problem, IMO.

AustinChief

09-17-2012, 06:59 PM

I thought this initially, as he simply asked for the possible outcomes. HOWEVER, he also noted that he's sampling 10 (ostensibly pulling one at a time) without replacement. The without replacement part wouldn't matter if he was only interested in possible outcomes.

We needed a clearer description of the actual problem, IMO.

yeah, I'm kinda guessing at what is wanted in regards to the probabilities. If he even wants probabilities.

Third Eye

09-17-2012, 07:01 PM

I thought this initially, as he simply asked for the possible outcomes. HOWEVER, he also noted that he's sampling 10 (ostensibly pulling one at a time) without replacement. The without replacement part wouldn't matter if he was only interested in possible outcomes.

We needed a clearer description of the actual problem, IMO.

The problem is plenty clear, and has been answered both in number of combinations and probability. Both answers are correct as well.

You good, RainMan?

There are 100*99*98*...*91 = 100! / 90! = 100! / (100-10)! ways to draw 10 balls from 100, denoted P(100,10), if we could distinguish the balls apart. That's the total number of elementary outcomes. Given that we can't distinguish among the white balls or among the red balls, then we can group all these elementary outcomes into 2 ** 10 distinct outcomes where the order would matter.

Here for example, is one of those

WRWRR RRRRW

The above permutation of repeated objects has 3 white orbs and 7 red orbs. Given that I could get 3 white orbs in any of P(50,3) ways from the urn of 50 white balls and I could get 7 red orbs in any of P(50,7) ways, there are

P(50, 3) * P(50, 7 ) ways that I could generate that particular permutation from the elementary outcomes.

Now suppose that I want to group all of the permutations together according to how many unique white balls it has. In other words, I no longer care about the order in which those white ball appear.

Well, each permutation has the same number of elementary possiblities, P(50, 3) * P(50, 7). Note that I could identify a permutation by the location of the white balls. So, for 3 white balls out of 10, there are P(10,3) / 3! distinguishable locations, which we can denote as C(10,3) combinations. So that means that there are C(10, 3) * P(50, 3) * P(50, 7) elementary outcomes that result in a total of 3 white balls out of 10.

If we want to compute the probability of getting 3 white balls out of 10, you just divide the total number of elementary possibilities that yield 3 white balls,

C(10,3) * P(50,3) * P(50, 7) by the total number of elementary possiblities,

P(100, 10 ).

That's how you get the probability mass function for the hypergeometric. It simplifies very nicely to the formula that is expressed simply using combinations, the formula you'll see in authoritative sources.

I hope you kept that asteroid from hitting us. If you break that rock down a little bit and send it toward the Chiefs front office, I'd appreciate it. ;)

Baby Lee

09-17-2012, 07:32 PM

http://www.r-project.org/

Came late to the discussion, but between this bit of open source and the discussions on the site, assuming a baseline of knowledge in P&S, you solve not only this question but any others that come up for you.

http://www.r-project.org/

Came late to the discussion, but between this bit of open source and the discussions on the site, assuming a baseline of knowledge in P&S, you solve not only this question but any others that come up for you.

That's a great product. Lots of cool stuff you can do with that freeware!

Third Eye

09-17-2012, 07:47 PM

If we want to compute the probability of getting 3 white balls out of 10, you just divide the total number of elementary possibilities that yield 3 white balls,

C(10,3) * P(50,3) * P(50, 7) by the total number of elementary possiblities,

P(100, 10 ).

If you don't mind me asking, why wouldn't you just do 50C3*50C7/100C10?

Sorry for the different notation, that's just the way I've always seen it.

AustinChief

09-17-2012, 07:53 PM

http://www.r-project.org/

Came late to the discussion, but between this bit of open source and the discussions on the site, assuming a baseline of knowledge in P&S, you solve not only this question but any others that come up for you.

Nice, had never seen that!

If you don't mind me asking, why wouldn't you just do 50C3*50C7/100C10?

Sorry for the different notation, that's just the way I've always seen it.

I don't mind the question. Starting from the number of elementary outcomes and then grouping them together leads to the same formula, but laying out each step and and using standard terms along the way could be helpful to a reader who wonders where the formula comes from or why there are different terms for related concepts, like permutations and combinations, possibilities and probabilities.

Spongeblack Bobtard

09-17-2012, 08:02 PM

It's kind of funny that "Rain Man" is asking for help with numbers and stats....

Train B will arrive in Syracuse before Train A.

Rain Man

09-18-2012, 09:25 AM

Sorry for the late response, but I was at a meeting that went until about 10:30 last night.

DanT, that hypergeom.dist function is the perfect tonic for what ails me. I never would've found it myself, but once I figured out how it works, it's really, really nice and easy. Love it. My numbers match austinchief's numbers, so I think I'm good.

The one thing I'm still having trouble with is the number of permutations. I've taken a quick look at DanT's formulae and for some reason I'm not getting Third Eye's numbers. It may be pilot error right now since I'm not familiar with the nomenclature, so I'll work on it a little more. I may have another question later about that part.

[Playful punch to the upper arm] You guys are the greatest! [/Playful punch to the upper arm]

Sorry for the late response, but I was at a meeting that went until about 10:30 last night.

DanT, that hypergeom.dist function is the perfect tonic for what ails me. I never would've found it myself, but once I figured out how it works, it's really, really nice and easy. Love it. My numbers match austinchief's numbers, so I think I'm good.

The one thing I'm still having trouble with is the number of permutations. I've taken a quick look at DanT's formulae and for some reason I'm not getting Third Eye's numbers. It may be pilot error right now since I'm not familiar with the nomenclature, so I'll work on it a little more. I may have another question later about that part.

[Playful punch to the upper arm] You guys are the greatest! [/Playful punch to the upper arm]

I just noticed a typo in the first line of my longish post, which I've corrected. There are indeed 100*99*...*91 elementary outcomes, which equals 100! / 90!. I incorrectly had typed 100! / 10! in my original post. Sorry about that!

Rain Man

09-18-2012, 10:20 AM

I just noticed a typo in the first line of my longish post, which I've corrected. There are indeed 100*99*...*91 elementary outcomes, which equals 100! / 90!. I incorrectly had typed 100! / 10! in my original post. Sorry about that!

Oh, that'll make a difference, I bet. I was seeing some really big numbers.

Rain Man

09-18-2012, 12:32 PM

You good, RainMan?

There are 100*99*98*...*91 = 100! / 90! = 100! / (100-10)! ways to draw 10 balls from 100, denoted P(100,10), if we could distinguish the balls apart. That's the total number of elementary outcomes. Given that we can't distinguish among the white balls or among the red balls, then we can group all these elementary outcomes into 2 ** 10 distinct outcomes where the order would matter.

Here for example, is one of those

WRWRR RRRRW

The above permutation of repeated objects has 3 white orbs and 7 red orbs. Given that I could get 3 white orbs in any of P(50,3) ways from the urn of 50 white balls and I could get 7 red orbs in any of P(50,7) ways, there are

P(50, 3) * P(50, 7 ) ways that I could generate that particular permutation from the elementary outcomes.

So most of this is assuming that we care about which white ball is in which order, right? So there are

50!/47! * 50!/43! = 5.92x10^16 combinations that are possible with 3 white orbs and 7 red orbs, assuming that each orb has a particular identity?

Now suppose that I want to group all of the permutations together according to how many unique white balls it has. In other words, I no longer care about the order in which those white ball appear.

Well, each permutation has the same number of elementary possiblities, P(50, 3) * P(50, 7). Note that I could identify a permutation by the location of the white balls. So, for 3 white balls out of 10, there are P(10,3) / 3! distinguishable locations, which we can denote as C(10,3) combinations. So that means that there are C(10, 3) * P(50, 3) * P(50, 7) elementary outcomes that result in a total of 3 white balls out of 10.

If we want to compute the probability of getting 3 white balls out of 10, you just divide the total number of elementary possibilities that yield 3 white balls,

C(10,3) * P(50,3) * P(50, 7) by the total number of elementary possiblities,

P(100, 10 ).

So the number of elementary possibilities if I don't care which white ball or red ball lands somewhere is

100!/90! = 6.29x10^19?

Wait. Shouldn't this be smaller than the number I calculated above?

And in this case, the number of possibilities of a 3/7 split is

50!/47!/3! *50!/47! * 50!/43! = 1.16*10^21?

Wait a minute. I've got something wrong. The second number can't be bigger than the first number. What am I messing up?

That's how you get the probability mass function for the hypergeometric. It simplifies very nicely to the formula that is expressed simply using combinations, the formula you'll see in authoritative sources.

I hope you kept that asteroid from hitting us. If you break that rock down a little bit and send it toward the Chiefs front office, I'd appreciate it. ;)

I'm working on it. Astronomically speaking, the front office is rather small so I might have to obliterate most of Kansas City to get it, but it might be a reasonable tradeoff.

So most of this is assuming that we care about which white ball is in which order, right? So there are

50!/47! * 50!/43! = 5.92x10^16 combinations that are possible with 3 white orbs and 7 red orbs, assuming that each orb has a particular identity?

That calculation would describe how many different ways you could use 50 white balls and 50 red balls to come up with a specific ordered sequence like this one:

WRWRR RRRRW

And there are 120 ordered sequences of length 10 that have 3 white balls in them, so the total number of elementary outcomes that have 3 white balls and 7 red balls is 120 * ( 50! / 47! ) * ( 50! / 43! ) = 7.10 x 10^18 .

In Excel, the formula would be

= combin(10,3) * permut( 50, 3 ) * permut( 50, 43 ) .

So the number of elementary possibilities if I don't care which white ball or red ball lands somewhere is

100!/90! = 6.29x10^19?

Wait. Shouldn't this be smaller than the number I calculated above?

Actually, it's 6.28x10^19. That's the total number of elementary outcomes. The total number of elementary outcomes should be at least as big than the total number of elementary outcomes that satisfy any particular condition. After all, the total number of elementary outcomes goes into the denominator when computing probabilities, so it needs to be at least as big as what goes into the numerator.

So if we want to compute the probability of getting a "3/7 split", that would be the total number of elementary outcomes with 3 white balls in them divided by the total number of elementary outcomes, which is ( 7.10 * 10^18 )/ ( 6.29 x 10^19 ), about 11.3% . In Excel, the formula would be

=HYPGEOMDIST(3,10,50,100)

Nickel D

09-18-2012, 02:45 PM

I was just looking online for a calc for it.. this is the best I could find http://stattrek.com/online-calculator/hypergeometric.aspx

Should be able to run it for each possible outcome and get your statistics.

(unless I'm not understanding what he is asking for)

Went to that site to crunch the numbers and came up with the final answer of 9.1 million light years.

Hold on a sec...typo found in the site's name: http://startrek.com

Uhmmmmm...nevermind.

vBulletin® v3.8.0, Copyright ©2000-2014, Jelsoft Enterprises Ltd.