*Author

QuantumT

  • Guest
An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205094#msg205094
« on: November 20, 2010, 08:33:23 am »
Introduction

So, I see a lot of statements getting thrown around. "Oh, if only I'd drawn this." and "You only won because you were lucky." etc. Sometimes it's correct, but frequently it isn't.

So I decided that I would put up a little primer on how probability works.

The general approach to finding the probability of a certain event happening is to find how many ways that event can happen and dividing it by how many total ways the system can occur. Let's demonstrate this with an example.

Let's say I wanted to find the probability of rolling exactly one 6 when I roll two dice. Here's a table of all of the possibilities:

1st\2nd123456
11,11,21,31,41,51,6
22,12,22,32,42,52,6
33,13,23,33,43,53,6
44,14,24,34,34,54,6
55,15,25,35,45,55,6
66,16,26,36,46,56,6
So there are 10 rolls that give exactly one 6. We can find the total number of possible rolls with 6^2, because there are 6 things each die can be and I roll 2 dice. This means the total probability of rolling exactly one 6 is 10/36.

This example was simple enough that we could look at all the possibilities by hand. Most of the time though, the number of possibilities would be so large that doing this would be impossible. So we'll have to do something else.

Enter hypergeometrics. Many of you have probably seen various hypergeometric calculators online but not really understood how they actually worked. They use the same principle described above, it's just that a general formula is needed to do it.

Definitions

In order to describe the equations, I will need to define some things first.

n! is the factorial function and what is means is that you multiply all the numbers between n and 1 together. In math notation:

n!=n*(n-1)*(n-2)*...*3*2*1

The other thing we will need is what's called the nCr function. This function is a combination of factorials and what it does is count how many ways I can choose r things from n things, the final order not mattering. This is what it looks like.

ncr(N,n) = N!/(n!*(N-n)!)

First Example

So lets look at another example. Suppose I want to know the chance of rolling 3 heads in 10 coin flips. This is simple enough that it could be done by hand but let's do it with our new tools instead.

So we want to see how many ways we can pick out 3 heads out of 10 total flips. Using our handy ncr function:

ncr(10,3) = 10!/(3!*7!) =120

To find the probability, we divide by the total number of possibilities, which in this case is 2^10, 10 coin flips and 2 ways each one could go.

Probability of flipping 3 heads=120/2^10=.1171875~12%

So there is approximately a 12% chance that you will flip 3 heads in 10 flips.

Elements

Now let's get on to what you've all been waiting for. How can this be applied to elements?

There are several different ways that this can be applied to elements, but the biggest one by far is based on drawing specific things.

So lets say I have 6 of a card (we'll call it card A) in my 30 card deck. What are the chances that I have 2 of them in my opening hand? (we'll ignore mulligan for now, just pretend my deck has no 0 cost cards in it)

There will be ncr(6,2) ways that you could pick out 2 of your 6 'card A's, and ncr(24,5) ways you could choose the remaining 5 cards (30-6 leaves 24 cards that are not card A, and the 5 is the remaining number of cards you need to draw).

This means there are

ncr(6,2)*ncr(24,5)=637560

total hands where I start with 2 of card A. This sounds like a really big number, but to find the probability we have to divide by the total possible number of hands. Here we just go back to our ncr function.

Total number hands=ncr(30,7)=2035800

To find the probability we divide the two:

probability of having 2 of card A in first 7 cards=637560/2035800~.3132~31%

So the chance is about 31%.

The way this formula will generalize for 1 desired result is:

Quote
Suppose a population consists of N items, k of which are successes. And a random sample drawn from that population consists of n items, x of which are successes. Then the hypergeometric probability is:

P(N,n,k,x)=ncr(k,x)*ncr(N-k,n-x)/ncr(N,n)
The first term is how many ways I can the card that I want, the second is the number of ways there are to get the remaining cards, and the last is the total number of hands.

Mulligan

In decks that are 1/3 pillars, the chance for a mulligan is under 5%, even for a 60 card deck, so it can generally be ignored and you'd still be pretty close. But let's try and take it into account.

If I want to see what my chances are of starting with 2 pillars in hand, I can get a start by just using the same equation as before.

Here N=30, n=7, k=10, x=2

P(30,7,10,2)=ncr(10,2)*ncr(20,5)/ncr(30,7)~.34

However, if I get 0 pillars in my hand I get a second chance for this 34%. So now I have to find the chance of a mulligan.

P(30,7,10,0)=ncr(10,0)*ncr(20,7)/ncr(30,7)~.04

If I get the mulligan, than I get a second chance at the 34%. So the final probability is:

P2~.34+.04*.34~.354

So the mulligan has an effect here, but it's not very large.

Generalizations

To generalize the above equation further to more than one desired card.

Quote
Suppose a population consists of N items, of which there are j & k of two separate desirable items. And a random sample drawn from that population consists of n items, x of which are 'j's and y of which are 'k's. Then the hypergeometric probability is:

P(N,n,k,x)=ncr(j,x)*ncr(k,y)*ncr(N-j-k,n-x-y)/ncr(N,n)
Conclusion

So next time you're thinking about how lucky/unlucky something was, you'll now have the tools at your disposal to tell exactly how lucky it was.

Comments?

*Summary/TLDR to be added soon, along with further information on generalizations.*

kobisjeruk

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205134#msg205134
« Reply #1 on: November 20, 2010, 11:45:39 am »
i guess people are reluctant to comment/response to this wall of texts as to not paint themselves as fools*

i say shenanigans
i go with my guts and my guts never failed me (except the times when it did)
so hah! hypergeosomething something, i fart in your general direction

Demut

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205173#msg205173
« Reply #2 on: November 20, 2010, 01:58:00 pm »
I had to go google factorial function and nCr function because your explanations were kind of muddled.

And then your placing of ncr(10,3) made me think somehow you were trying to multiply nCr by (10,3)before I thought about how the heck you would go about multiplying that and decided that you must have typoed.

Then I spent about twenty minutes trying to figure out how you got (6,2)*(24,5)=637560

Then I remembered factorial function, and.... that didn't help me. Still trying to figure out how to use N!/(n!*(N-n)!)

I had to trial and error it.

6!/(2!*(24!-5!)!)

I mentally factorial functioned 6 getting 720

2 got me 2.

I had to a calculator with 24, but my calculator doesn't have a factorial function but I eventually got 620,448,401,733,239,439,360,000

5 got me 120

720/(2*(620,448,401,733,239,439,360,000-120)!)

Distributive property.

1240896803466478878720000-240=1240896803466478878719976

Lets just say that this far from helped.

So back to this.

ncr(6,2)*ncr(24,5)=637560

Multiplying them all together only got me 1,440.

So suffice to say I need further elaboration on this to understand it.

Offline jumpoffduck

  • Jr. Member
  • **
  • Posts: 151
  • Reputation Power: 2
  • jumpoffduck is a Spark waiting for a buff.
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205472#msg205472
« Reply #3 on: November 20, 2010, 07:54:51 pm »
6!/(2!*(24!-5!)!)
^ Your problem.

(6,2)*(24,5) =
6!/(2!*4!) * 24!/(5!*19!) =
637560

Offline Dragoon1140

  • Hero Member
  • *****
  • Posts: 1984
  • Reputation Power: 23
  • Dragoon1140 is a Mummy waiting to discover the path to glory.Dragoon1140 is a Mummy waiting to discover the path to glory.Dragoon1140 is a Mummy waiting to discover the path to glory.Dragoon1140 is a Mummy waiting to discover the path to glory.
  • New to Elements
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205475#msg205475
« Reply #4 on: November 20, 2010, 07:59:21 pm »
Coinich already solved this problem with the "Hyper-Geometric Probability and You!" thread.
Else known as "JonTheBon"

I also make videos and stuff.

Phoenixrain

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205600#msg205600
« Reply #5 on: November 20, 2010, 10:19:47 pm »
I learned this in my algebra 2 class last year. Also, this only proves that unlucky draws can happen, not frequently but still some.

QuantumT

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205634#msg205634
« Reply #6 on: November 20, 2010, 10:51:17 pm »
Coinich already solved this problem with the "Hyper-Geometric Probability and You!" thread.
I suppose to an extent. He didn't really explain how it worked though.

I learned this in my algebra 2 class last year. Also, this only proves that unlucky draws can happen, not frequently but still some.
This is just an attempt to be able to put numbers on things.

stereosound

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205761#msg205761
« Reply #7 on: November 21, 2010, 02:10:42 am »
I think your definition of hypergeometric distributions is a bit muddled -- essentially the goal is expand upon nCr's where the population you're choosing from is dependent upon the the chooses made by the nCr process.

A bit more clear, an nCr of (20,4) is looking at the probability of pulling a specific 4 from a group of 20, so it considers every possibility (like the OP's nice table) to chug out a probability, however in reality once you choose the first object, you're now looking at (19,3), and so on. Hypergeometric distributions account for this, and require a population, sample (or amount you're drawing), number you require in the sample and the percentage chance that they're found in the population. From this, you have enough information to calculate the rolling "card deck" total.

QuantumT

  • Guest
Re: An Introduction to Probability https://elementscommunity.org/forum/index.php?topic=16010.msg205791#msg205791
« Reply #8 on: November 21, 2010, 03:04:17 am »
I think your definition of hypergeometric distributions is a bit muddled -- essentially the goal is expand upon nCr's where the population you're choosing from is dependent upon the the chooses made by the nCr process.

A bit more clear, an nCr of (20,4) is looking at the probability of pulling a specific 4 from a group of 20, so it considers every possibility (like the OP's nice table) to chug out a probability, however in reality once you choose the first object, you're now looking at (19,3), and so on. Hypergeometric distributions account for this, and require a population, sample (or amount you're drawing), number you require in the sample and the percentage chance that they're found in the population. From this, you have enough information to calculate the rolling "card deck" total.
That doesn't work, because it places importance on the order that the cards are drawn in. You end up overcounting for various things.

nCr(20,4) is telling you how many ways you can pull any 4 things from 20, with order not mattering.

 

anything
blarg: