Google Answers Logo
View Question
 
Q: HARD Combinatorics/probability question about drawing cards from a deck ( No Answer,   4 Comments )
Question  
Subject: HARD Combinatorics/probability question about drawing cards from a deck
Category: Science > Math
Asked by: cronodas-ga
List Price: $30.00
Posted: 12 Oct 2005 17:49 PDT
Expires: 11 Nov 2005 16:49 PST
Question ID: 579562
I have a 60 card deck of Magic: the Gathering cards. 
Some number L of those cards are "land" cards. The rest are "spell" cards.

At the begining of the game, you draw an opening hand of seven cards
from the deck, without replacement. What are the following
probabilities:

The chances of having at least M1 land cards in your opening hand?
The chances of having at least M1 land cards and M2 spell cards in
your opening hand?
What if the opening hand had N cards instead of seven?
What if the deck has D cards instead of 60?

Now let's make things more complicated. The land cards are divided
into three categories:
"White" land cards
"Red" land cards
"Pink" land cards that count as both white and red

Given that a 60 card deck has L1 white land cards, L2 red land cards,
and L3 pink land cards, what is the probability of having at least M1
land cards in the seven card opening hand, at least W of which count
as white and R of which count as red?

For example, if M1 = 2, W = 2, R = 1, and N = 7, then an opening hand
of five spell cards, one pink land, and one white land would be
acceptable, as would an opening hand of three spell cards, two white
land cards, and two red land cards.
 
Putting it all together, if you have an N card opening hand drawn from
a D card deck with L1 white land cards, L2 red land cards, L3 pink
land cards, and D-(L1+L2+L3) spell cards, and that hand must have at
least M2 spell cards and at least M1 total land cards (of which at
least W land cards count as white and R land cards count as red), what
is the probability of that N card hand meeting all the criteria
specified?

(You can give an iterated algorithm - or source code in the
programming language of your choice - as an answer, as I suspect any
explicit formula will be way too complicated to type. I also know what
"n choose k" means, so feel free to use that notation in your answer
without having to define it. Also, the only assumptions you get to
make is that all paramaters are non-negative integers and that N <= D.
If your solution doesn't say that you have a zero probability of
drawing at least eight land cards in a seven card hand, your solution
isn't correct.)
Answer  
There is no answer at this time.

Comments  
Subject: Re: HARD Combinatorics/probability question about drawing cards from a deck
From: robertborgersen-ga on 04 Nov 2005 07:09 PST
 
I love this question.  I'm a combinatorics masters student, and a MTG
player.  I'm going to work on it myself.

Rob
Subject: Re: HARD Combinatorics/probability question about drawing cards from a deck
From: ruien-ga on 16 Nov 2005 00:35 PST
 
I certainly can't answer this conclusively (I'm an EE). It has to do
with hypergeometric distributions; here's a good starting point:

http://www.kibble.net/magic/math.php

The hypergeometric distribution can take care of the basic questions
with arbitrary hand size and arbitrary deck size.

I incorporated these functions into my TI-89 calculator... Here's the
(pseudo)code for them:

======================================================

N is number of cards you are checking for (wanting to draw)
Z is number of cards you are drawing
X is number of this card you ahve in the deck
Y is total number of cards left in the deck

-----------------------------------------------------------

unary hypergeometric distribution:

(percent chance of getting exactly N of the specified card)


hgm(N,Z,X,Y)

hgm(N,Z,X,Y) := ( nCr(X,N) * nCr(Y-X,Z-N) / nCr(Y,Z) ) * 100

(may not want the * 100 at the end)

-----------------------------------------------------------


N-to-Z sum hypergeometric distribution:

(percent chance of getting at least N of the specified card)


hgms(N,Z,X,Y)

hgms(N,Z,X,Y) := sum( hgm(t,Z,X,Y) , t , N, Z)

-----------------------------------------------------------


0-to-N sum hypergeometric distribution:

(percent chance of getting no more than N of the specified card)


hgmc(N,Z,X,Y)

hgmc(N,Z,X,Y) := sum( hgm(t,Z,X,Y) , t , 0, N)

===================================================================

Now for the more complicated part.

For myself, I was content with an approximation:

For a dual land, ex plains-mountain, i just added this number to both
totals of the individual lands. for example, with 7 plains, 6
mountains, and 4 plain-mountains, i just considered myself as having
11 plains and 10 mountains. This tends to inflate the number of overal
lands you can expect to receive by a given turn, because 21 lands is
greater than the 17 you really have, but in terms of calculating you
mana curve it seems to work well because you're mainly focused on
playing a card with 2 white mana by turn X.

I was content with this because went further trying to calculate the
effect of card-drawing effects (such as Brainstorm or Opt). I
approximated this by assuming that the effective deck size was smaller
than the original size by some factor that I would consider to be the
card's average effectiveness. I gave Opt '0.75' and Brainstorm '1.25',
or so. (And rounded to the nearest integer afterwards).

If anyone knows a more accurate way of doing this, I am interested as well.

I hope that was helpful, or at least interesting.

~Ruien
Subject: Re: HARD Combinatorics/probability question about drawing cards from a deck
From: robertborgersen-ga on 17 Nov 2005 23:04 PST
 
Awesome!

I worked out the first part of the problem:

There are (L choose M1) ways to pick the M1 Land in your first hand
(where M1 varies from 0 to 7), and for each of these combinations of
land, there are (60-L choose 7-M1) ways to choose the remainder. 
There are a total of (60 choose 7) possible hands, so

(L choose M1) * (60-L choose 7-M1) / (60 choose 7)

will be the percentage chance of getting a hand with exactly M1 land
on the deal if there are L land in the deck.

I punched this into an excel spread sheet for values of M1 from 1 to
7, and L from 0 to 60.  Here were the middle ground results:

	L
M1	18	19	20	21	22
0	7%	6%	5%	4%	3%
1	24%	22%	20%	18%	16%
2	34%	33%	32%	31%	30%
3	24%	25%	27%	28%	29%
4	9%	11%	12%	14%	16%
5	2%	2%	3%	4%	5%
6	0%	0%	0%	1%	1%
7	0%	0%	0%	0%	0%

So, for the average person, playing 20 land per 60 card deck, you have
a 27% chance of getting at least 3 land, and a 42% chance of getting
AT LEAST 3 land (27+12+3).  Each percentage maxed out at certain
values of L.

If you want exactly 1 land in your hand, there is a 42% chance if you
have 7-9 land in your deck
If you want exactly 2 land in your land, there is a 34% chance if you
have 16-18 land in your deck
If you want exactly 3 land in your land, there is a 31% chance if you
have 24-28 land in your deck
If you want exactly 4 land in your land, there is a 31% chance if you
have 33-36 land in your deck
If you want exactly 5 land in your land, there is a 34% chance if you
have 42-44 land in your deck
If you want exactly 6 land in your land, there is a 42% chance if you
have 51-53 land in your deck


Another interesting note: the chances of having at least three land
(obviously) goes up the more land in your deck.  Here are some values
for certain L:

17	18	19	20	21	22	23	24	25
31%	35%	39%	43%	47%	51%	55%	59%	63%

So, once you hit 22 land, half the time your starting hand will have
at least 3 land.

Also, with regards to mulligans (no land), at L=20, there is only a 5%
chance of this occuring (with completely random shuffling ofcourse). 
This chance is practically 0% (0.4%) when L = 31, and just gets lower
from there...

I'm going to keep looking into this...this was only about 15 mins of
work...but a lot of cool results (for someone that plays anyway lol!)

Enjoy!

Rob
Subject: Re: HARD Combinatorics/probability question about drawing cards from a deck
From: ruien-ga on 18 Nov 2005 20:36 PST
 
Hey that's pretty cool.

If you get a chance, try to figure out the dual land & card-drawing
things. That's completely stumped me, but I'm horrible at this stuff.

:)

Ryan

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy