hypergemometric distribution help

Esperr

King
Joined
Jun 22, 2012
Messages
868
So, I need help with calculating the odds of drawing cards from a deck of cards, long ago I understood hypergeometric distribution quite well, but it is now lost to me.

Ill keep it real, essentially im attempting to calculate the odds of drawing cards in magic the gathering, and the math I seem to be coming up with is conflicting with what im finding people posting online, so im trying to get a sure answer from someone more mathematicaly inclined. So heres my dilemma, I have just drawn my first hand of 7 out of sixty cards, my hand has no lightning bolts in it, while there are four left in the deck. Next turn I will draw a single card, im trying to calculate the odds of drawing a lightning bolt. I remember the formula thusly,

H (n) = C (X, n) * C (Y - X, Z - n) / C (Y, Z)

x is the number of a certain card in the deck(lightning bolt, in this case x=4)
y is the number of cards left in the deck(y=53)
z is the number being drawn(z=1)
n is the number you are checking for(also equals one)

Now, to the best of my knowledge, because im only drawing one card and checking one card, the equation can be simplified to,
y-x=p, then p/y=the probability of now drawing the lightning bolt(which will inevitably give me the odds of drawing it as well), so in this case,
53-4=49, then 49/53=93~ % chance of not drawing the lightning bolt, or a 7~ chance of drawing it. But ive seen sources and websites with charts and spreadsheets say this is wrong and give different numbers. Can somebody clarify how to calculate this for me, it would be greatly appreciated.
 
There are four lightning bolts out of an original deck of 60. Right?

You've removed 7 cards, leaving 53, of which 4 are still lightning bolts.

You now want the odds of the next card drawn being a lightning bolt.

The answer has to be 4/53, doesn't it?

What am I missing?

I don't understand anything else of what you've written. I especially have no idea what hypergemometric (sic) distribution might be.
 
There are four lightning bolts out of an original deck of 60. Right?

You've removed 7 cards, leaving 53, of which 4 are still lightning bolts.

You now want the odds of the next card drawn being a lightning bolt.

The answer has to be 4/53, doesn't it?

What am I missing?

I don't understand anything else of what you've written. I especially have no idea what hypergemometric (sic) distribution might be.

Yes for one card, which comes out to about 7 percent, the point of framing it in an hypergeometric algorithm is to better understand the mathematical concept so that it can be applied to drawing multiple cards at once, or drawing multiple cards and excluding certain types and so on and so forth. Which is why I was looking for someone more confidant in there math skills then I.
 
Oh right. There is such a thing, then. But why is it called hypergeometric distribution?
 
So, I need help with calculating the odds of drawing cards from a deck of cards, long ago I understood hypergeometric distribution quite well, but it is now lost to me.

Ill keep it real, essentially im attempting to calculate the odds of drawing cards in magic the gathering, and the math I seem to be coming up with is conflicting with what im finding people posting online, so im trying to get a sure answer from someone more mathematicaly inclined. So heres my dilemma, I have just drawn my first hand of 7 out of sixty cards, my hand has no lightning bolts in it, while there are four left in the deck. Next turn I will draw a single card, im trying to calculate the odds of drawing a lightning bolt. I remember the formula thusly,

H (n) = C (X, n) * C (Y - X, Z - n) / C (Y, Z)

x is the number of a certain card in the deck(lightning bolt, in this case x=4)
y is the number of cards left in the deck(y=53)
z is the number being drawn(z=1)
n is the number you are checking for(also equals one)

Now, to the best of my knowledge, because im only drawing one card and checking one card, the equation can be simplified to,
y-x=p, then p/y=the probability of now drawing the lightning bolt(which will inevitably give me the odds of drawing it as well), so in this case,
53-4=49, then 49/53=93~ % chance of not drawing the lightning bolt, or a 7~ chance of drawing it. But ive seen sources and websites with charts and spreadsheets say this is wrong and give different numbers. Can somebody clarify how to calculate this for me, it would be greatly appreciated.

Isn't this a probability issue? (but keep in mind that probability theory in such games' setting- a sub-branch of probability theory is game theory- is not producing exact results given it uses the notion of limit to infinity, as in a near- infinite pool of cards you would tend to have this probability).

The above means that while you can use game theory to have a math result, that result is going to be an estimate and in game setting (moreso due to the overall amount of cards being very little, just double digits) it can vary hugely. Ie you might draw a lighting bolt in one go, and in the exact later draw to have again a lighting bolt.

As for game theory, i will note down some formula/explanation in the case of your cards, if you want to. Just a bit later, and if others have not yet/have not by then posted the same, cause it is very simple really in that game theory. :)
 
Isn't this a probability issue? (but keep in mind that probability theory in such games' setting- a sub-branch of probability theory is game theory- is not producing exact results given it uses the notion of limit to infinity, as in a near- infinite pool of cards you would tend to have this probability).
This is a question of combinatorics, and everything is discrete so the probabilities are easy to calculate exactly. I would consider drawing cards to be entirely an exercise in probability, game theory would be making claims about strategies in the game, and is likely part of Essper's end goal, but has nothing to do with the question per se.
Also note that the probability space is finite, so there should be no applications of limits anywhere in a solution.


The above means that while you can use game theory to have a math result, that result is going to be an estimate and in game setting (moreso due to the overall amount of cards being very little, just double digits) it can vary hugely. Ie you might draw a lighting bolt in one go, and in the exact later draw to have again a lighting bolt.
That literally is what probability describes:confused: The variance in number of lightning bolts across several draws might be fairly high, but that is predicted exactly by the math. Not a weakness in them.

Essper: Perhaps you can expand on why you didn't declare victory after the calculations in the OP? This isn't a hard problem and it certainly isn't one that should be the subject of debate...
 
This is a question of combinatorics, and everything is discrete so the probabilities are easy to calculate exactly. I would consider drawing cards to be entirely an exercise in probability, game theory would be making claims about strategies in the game, and is likely part of Essper's end goal, but has nothing to do with the question per se.
Also note that the probability space is finite, so there should be no applications of limits anywhere in a solution.



That literally is what probability describes:confused: The variance in number of lightning bolts across several draws might be fairly high, but that is predicted exactly by the math. Not a weakness in them.

Essper: Perhaps you can expand on why you didn't declare victory after the calculations in the OP? This isn't a hard problem and it certainly isn't one that should be the subject of debate...

I did not declare victory cause i am a very modest and angelic human being? :) (but apparently not modest/angelic enough to parapraxis-style not read that this was addressed to another poster! ).

As for probability theory being discrete or theoretical and tied to vast numbers of available outcomes:

In some settings the outcome is tied to the exact situation. Eg if you ask how many different sets i can create out of X numbers of objects, arranged in Y numbers of pattern, the answer is very set and not tied to any variation regardless of the number (real) of events.

On the other hand, if you ask about cards, or dice or similar, the answer is not tied to the reality of the outcome, cause for a finite (and moreso small) amount of events the probability can be in reality anything. Eg (to use the simplest example) : If we throw a coin for 10 times, the real outcome is not going to be set as 5 times for heads and 5 for tails. The prob is still half for head and half for tails, but that is supposed for a vast number of throws, and generally for a limit to infinity.
 
I did not declare victory cause i am a very modest and angelic human being? :) (but apparently not modest/angelic enough to parapraxis-style not read that this was addressed to another poster! ).
:D

As for probability theory being discrete or theoretical and tied to vast numbers of available outcomes:

In some settings the outcome is tied to the exact situation. Eg if you ask how many different sets i can create out of X numbers of objects, arranged in Y numbers of pattern, the answer is very set and not tied to any variation regardless of the number (real) of events.

On the other hand, if you ask about cards, or dice or similar, the answer is not tied to the reality of the outcome, cause for a finite (and moreso small) amount of events the probability can be in reality anything. Eg (to use the simplest example) : If we throw a coin for 10 times, the real outcome is not going to be set as 5 times for heads and 5 for tails. The prob is still half for head and half for tails, but that is supposed for a vast number of throws, and generally for a limit to infinity.
In the probability of a single event the notion of variance makes no sense. Variance only comes into play when considering the mean, as in your coin example.
In both cases it would take an infinite number of throws to experimentally verify the probability, but that is hardly a weakness of probability theory or an indication of a problem. The probability is what we calculated the result could be anything, but that is very much consistent with the notion of probability.

As for the coin example, we can use a binomial distribution since flipping a coin is a bernoulli trial. Which allows us to easily calculate, the expected value (5 heads), the probability of any particular number of heads, the variance, etc.

Probability is stating and quantifying an uncertainty, when low probability events happen that is a feature not a flaw or a problem with the math.
 
^Utterly agree, of course. Might be down to the greek terms for prob theory too, but that is what i meant too ;)

In regards to 'real result' and 'probability', this of course also is an issue due to this part of math having a quasi-appliance to real settings, eg dice throwing or cards appearing. And math is by itself in a set field which is formed by absolute notions not there in the 'real' world, eg 'equal', 'smallest/singular', 'infinite', and tied notions such as symmetry between the outcomes in the geometric (eucleidian or hyperbolic/other) field or a 2d axis (eg Cartesian), so bounded math itself is not tied to the 'real' world in such a way (including such card/dice games).

(ok, sounded intelligent again, so i am ending this post here).
 
You don't need hypergeometric distribution if you're interested only on the card you are about to draw. In this case the probability is just
(number of good cards in the deck) / (number of all cards in the deck).
In your case 4/53, just like you calculated.

You would need the distribution if you hadn't drawn any cards yet and were thinking "what are the probabilities that the 7th card I will draw is a lightning bolt".
 
First, we need to know the Counting Principle:
http://www.regentsprep.org/regents/math/algebra/APR1/Lcount.htm
Next, we need to understand Combinations:
http://mathforum.org/library/drmath/view/56120.html

Here's an online tool for calculating combinations: http://ncalculators.com/statistics/permutation-combination-calculator.htm



Ok so let's try to calculate the chance of drawing at least one lightning bolt in the next 4 cards.

So how can we figure this out? The easiest way is to look at it as a set of 53 cards, and we are taking out four cards from it.

The first two questions we need to ask are: 1. Does order matter? 2. Is there replacement? The answers are no, and no. The answer to question 1 means we are using combinations, the answer to question 2 affects how we approach the problem.

Let me define our formula for combinations: when taking C(n,r) = n!/(r!(n-r)!)

Next, how do we figure out at least one lightning bolt? Well, the easiest way would be to figure out the chance of not finding a single lightning bolt, and subtracting that from one, which is 1-49/53*48/52*47/51*46/50, or 27.64%. But let's figure it out in a more revealing way, so let's instead find it by looking at all possible ways of choosing 4 cards from 53 that have exactly 1, 2, 3, or 4 lightning bolts

First, we calculate the number of ways to choose 4 cards from 53, which is C(53,4), which is 292,825 ways.

Then we need to know the number of ways to choose 4 cards with exactly 1 lightning bolt. This means, we need 3 non-lightning bolts, and 1 lightning bolt. How many ways are possible? This means asking the distinct questions:

1. How many ways can we choose 3 non-lightning bolts from a selection of 49 non-lightning bolts?

2. How many ways can we choose 1 lightning bolt from a selection of 4 lightning bolts?

The answers are C(49,3) and C(4,1), which are 18424 and 4, respectively.

When asking how many ways are there of having 1 lightning bolt and 3 non-lightning bolts, because these two sets have no overlap, we can apply the Counting Principle and simply multiply them, for a total of 73,696 ways. So, there's 73,696 ways of creating a combination of 4 cards from this deck with exactly 1 lightning bolt, and there's 292,825 ways of creating combinations of 4 cards from this deck (Note - all cards are considered distinct in these calculations). So the probability of getting exactly 1 lightning bolt in the next 4 cards is 73,696/292,825 or 25.2%. Similarly, we can calculate the number of ways of getting 2, 3, or 4 lightning bolts from the next 4 cards, which are:
C(49,2)*C(4,2)+C(49,1)*C(4,3)+C(49,0)*C(4,4) = 7056+196+1=7253.

So our chance of getting at least 1 lightning bolt in the next 4 cards is (73,696+7056+196+1)/292,825 = 27.64%, which is the same result we got at the beginning.

More generally, with these variables,

Population:
Size N (N is an integer >=0)
K successes (K is an integer, 0<=K<=N)
N-K failures

Sample:
size n (n is an integer, 0<=n<=N)

Without replacement, we use the hypergeometric distribution. With replacement, we use the binomial distribution.

What is the probability of k successes and n-k failures in n draws?
Hypergeometric: C(N-K,n-k)*C(K,k)/C(N,n).
Binomial: C(n,k)*(K/N)^k*((N-K)/N)^(n-k)
 
Back
Top Bottom