Saturday, December 4, 2010

How does it work?

Deck-u-lator computes the ratio between the number of different hands that include specific cards and the number of possible hands that can be drawn from the deck you describe. If half these possible hands have the card combination you want, there should be a 50% or 0.5 chance of drawing your combination.

Calculating this chance uses a branch of mathematics called combinatorics. The number of different ways to choose H elements from a set of D elements is called the binomial coefficient is calculated using factorials (!).

D choose H = D! / (H! (D - H)!)

The number of different hands of size H drawn from a deck of D cards is "D choose H". A similar formula is used to calculate the number of ways to satisfy each part of your combination. If your deck has DX cards of type X and you need HX for your combination, then there are "DX choose HX" different ways to choose the type X cards you need. The number of hands with the cards you need is the product of all the different ways to choose each card. This is called a multivariate hypergeometric distribution (without replacement).

The Mathematics of Magic The Gathering: Probability, Statistics, Game Theory, and Strategy by Jon Prywes has an excellent discussion of mathematics for games if you are looking for even more information.

No comments:

Post a Comment