Sections


Wednesday, August 19, 2009

Probability: Law of Multiplication


We have covered finding the probability of drawing into specific card, when drawing multiple cards from the top of your deck.  But what if we want to know about the probabilities of drawing multiple cards in a set, from a certain amount of draws from the top of the deck.  To get this probability, we need to use the Law of Multiplication.  The Law of Multiplication looks as follows:


P(A and B) = P(A) x P(B)

However, because the probability of drawing from a system without replacement creates conditional probabilities, the Law of Multiplication will look as follows:

P(A and B) = P(A) x P(B given A)

To put P(B given A) in perspective, lets assume that we have successfully drawn one card from a set of four, from the top card of a sixty-card library, and we want to know the probability of drawing the second card of the set of four from the next draw.  The overall deck size has been depleted by one, and the number of cards from the set of four has been depleted by one as well.  Therefore P(B given A) is 3/59. So the overall probability of drawing two cards from a set of four, in the top two cards of a sixty card library is as follows:


P(A and B) = 4/60 x 3/59 = 0.339%

The Probability Laws of Addition and Multiplication are especially useful in finding Mana Availability Curve, as we need to draw into multiple lands to play cards with converted mana costs higher than one (which is most cards). Remember that in Probability: Law of Subtraction, we can use P prime, to find overall probabilities, so long as we remember to subtract P prime from one at the end.  So lets say we want to know the probability of drawing 2 of 20 lands, in the top 3 draws from a deck of 60 cards.  In order to do this we will have to break down the possible combinations of where we can draw into the first and second cards of the set of twenty.  In the table below, P(A) represents the probability of drawing into the first land, and P(B) represents the probability of drawing into the second land.


 

P(X)/EventFirst PossibilitySecond Possibility
P(A)First DrawSecond Draw
P(B)Second DrawThird draw


Finding P'(A and B) will be the same as finding P'(A) + P'(B)P(A), according to Probability: Law of Addition.  I will show the proof for this as follows:


Given: P(X and Y) = P(X) + P(Y)(1- P(X)), according to Probability: Law of Addition.


Prove: P'(A and B) = P'(A) + P'(B)P(A)

By substituting all instances of P(X) for P'(A), and all instances of P(Y) for P'(B), the given equation looks as follows.

P'(A and B) = P'(A) + P'(B)(1-P'(A))


According to Probability: Law of Subtraction P(A) = 1- P'(A), therefore:


P'(A and B) = P'(A) + P'(B)P(A)

Next we apply the Probability: Law of Multiplication to find P'(A).  We know that we must fail to find the first card of a set of 20, in both the first and second draws, therefore P'(A) = (1-20/60)(1-20/59).  To find P'(B) we must find the probability of failure in the second and third draws.  P'(B) = (1-19/59)(1-19/58).  Because we are dealing with conditional probabilities, we must also take into account the probability of looking for the second card of a set of 20, in the second and third draws.  This probability is represented by two separate occurrences of successfully drawing into 1 of a set of 20 from a deck of 60, (20/60+20/60).  The equation for failing to draw into 2 of 20 lands from a deck of 60 cards, in the top three cards, looks as follows:



P'(A and B)=(1-20/60)(1-20/59)+(1-19/59)(1-19/58)(20/60+20/60)= 74.459%


P(A and B) = 1-P'(A and B) = 25.541%

Obviously, the opening hand consists of 7 cards, not three, and the equations will only get more complex as we begin to look for more and more lands, in more and more draws.  Fortunately, these probabilities can be easily found using a spreadsheet.  To find the above probability, I can type the following on a Google Spread Sheet:



=Minus(1,SUM(HYPGEOMDIST(0,3,20,60),HYPGEOMDIST(1,3,20,60)))

Later on, I will explain in greater detail, what this code means, and how to find other specific probabilities when drawing from a deck, with the HYPGEOMDIST function.  For now, suffice it to say that with this function, I can find the probabilities of drawing into any number of cards in a set, from a deck of a specific size, in any given amount of draws.



Thursday, August 13, 2009

What is this, Mana Curve?


I believe that the most overused, misused, and misunderstood concept in all of Magic: the Gathering is Mana-Curve. At base value, I have seen casual players and veterans alike, use the term Mana-Curve to simply describe the number of lands in a deck. Though this usage is wrong, in my opinion, it is sadly the most accurate , in comparison to other usages I have heard or read. I have heard Mana-Curve used in reference to the casting cost of creatures and spells in a deck. People have literally said, "The Mana-Curve of such and such card or cards is off in this deck." or "The cards in this sleigh deck are all above the curve." and my favorite, "That card in this deck throws the curve off." I believe that we intuitively call the pool of available mana, which varies turn by turn, a Mana-Curve, because we recognize that there is not generally a linear relationship, between turn and the available mana. In other words, we will almost always lay down a land on turns one and two (most players will take a mulligan if they do not have at least two lands in their opening hand), but the third land will usually come out on turns four or five. If we were to plot this trend, we would see a curve that starts to rise quickly, but slows in its ascent over time, a logarithmic curve.


I believe that we as a gaming community need to come up with, and use a more descriptive definition of this observation. I propose: Mana Availability Curve, defined as the functional relationship between the dependent variable of available mana to a single player, generated by any permanent owned by that player, within a given parameter of probability, for a given deck quantity and mana source quantity, per the independent variable of turn. This is a lengthy definition, but MAC is more complex than most players realize. If we were to plot Turn, T, on the x-axis, and the whole number value of Available Mana, M, on the y-axis, we would still need to plot the probability of N mana-sources per turn, P(T,M), on a z-axis, in order to relate the entire story. This three-dimensional plot is known as a hyper-geometric matrix (Prywes). By setting a given parameter of probability, 70% to 80% being reasonable according to Pyrwes, we can view a cross-section of the hyper-geometric matrix on a two-dimensional graph. On this plot, we will initially observe a curve that resembles either a step-function, or a diagonally oriented sine-curve. We can smooth out this curve by multiplying M by P(T,M). Presented here is the Mana Availability Curve of a sixty card deck, with twenty lands as the only mana-sources, where I have applied this treatment.




Wednesday, August 12, 2009

A Metaphor for Probability without Replacement


Because finding Probabilities without Replacement is such an important concept in this study, I want to put a metaphor out there. This excerpt is straight from the rough draft of my e-book, and it should hit close to home for many single male MTG players, as I was at one time.



"Imagine that you are running late for school/work, and you can't find your keys. As any person in a serene, rational mindset would do when they can't find something, you replay the events in your mind, from the last time you used your keys, to the last probable time you had the keys on your person, as opposed to scouring your belongings, like a well placed Warp World. You know you had to use the keys to open your front door, and under the stress of preforming your day to day functions at 14% brain capacity (this is a continuation of a previous metaphor in the e-book, just try to roll with it), you immediately plopped down on the couch. Eventually, your brain began to recover, and you were ready to assimilate more useless information, so you reached over to the coffee table, and grabbed the remote. You saw a fast-food commercial on T.V. which reminded you that in your previously drooling stupor, you neglected to eat lunch. So you got up to grab some junk food from the kitchen. As is always the case, the shortest commercial break fell on the time interval when you were rushing to get or do something that would make your T.V. viewing experience more pleasurable, and you had to periodically peek into the living-room from the kitchen, as you prepared your dietary abomination. Finally you gave up on the notion of shifting from room to room, and placed all of your pseudo-food items on the bar/dining-room table, so that you could prepare and watch at the same time. After sampling from the eventual buffet line that you drug out onto the coffee table, you discovered the time was later than you thought, when the daily news report looped back onto the station, and decided to get ready for bed. Leaving your garments in whatever room you were standing in, you grabbed your jammies, and headed to the shower.

Logically, the last time the keys could have been on your person, would have been in your pockets. Also, each time you placed yourself or another item, assuming the keys were in your hand, you would have placed them down to pick something else up. Therefore, the couch cushions, the coffee table, the kitchen counter-top, the bar/dinning-room table, and the pockets of your pants from the day before are all logical places to look. Lastly, the keys could have fallen into the extra-dimensional pocket, whose invisible, intangible rift, sporadically winks into existence at random locations in your dwelling, to swallow whatever sets in its place, never to be seen again. So there are six possible locations where you will find, or not find your keys. You check the pockets of the pants you are currently wearing first, working past the stiffness, lint, and grunge, of a weeks worth of wearing. You have a one in six chance of finding your keys here. You pull your pockets inside out, revealing some items previously thought to be casualties to the rift, but reveal no keys. As you are standing in the living room, you decide to start stacking dirty dishes and look on the coffee table. Here and now, you have a one in five chance of finding your keys, as you have already checked one place, but stop and think on what brought you to looking here. If you had found your keys in your pockets, you would be leaving the dirty dishes for someone else to pick up. The overall probability of finding your keys at this point in time is the sum of the probabilities of finding your keys in either location. This is important to remember: when you are checking multiple events for a single outcome, the overall probability is found by adding the probabilities of
each event. However, the probability of moving on to the second check is equal to the probability of failing to find the target outcome in the first event. When we are looking for the alternate probability of an event, in this case failure of the the first event, we take one minus that probability. Therefore we must multiply the probability of the second check, by the probability of getting to the second check. The second important property of probabilities to remember is that when more than one probabilities influence an event, those probabilities must be multiplied together. Therefore, the overall probability of second check looks as follows:

P(A or B) =(1/6)+(1/5)(1-1/6)

Failing to find the keys on the coffee table, you carry the dirty dishes into the kitchen to check the kitchen counter-top. In order to get to the third check, you have to fail to find the keys in the first and second locations, therefore the overall probability of the third check will be: P(A,B, or C)=(1/6)+(1/5)(1-1/6)+(1/4)(1-1/6)(1-1/5). We can see a pattern developing here, which is doomed to get more complicated, especially if we use this model to search through 60 possible "locations". We can condense this model into a new model by simply looking for the alternate outcome. Remember that the probability of not finding the keys when looking in the first location is 1-1/6. We will call the alternate probability, or probability of failure P', therefore P'(A) = (1-1/6). In order to find P'(A or B), we must fail to find the keys in the first and second locations. Because both conditions must be met, they both influence P'(A or B), and must be multiplied together. In the end, we subtract P'(A or B) from one in order to get P(A or B). The new model will look as follows:

P(A or B) =1-P'(A or B)=1-(1-1/6)(1-1/5)

P(A,B, or C)=1-(1-1/6)(1-1/5)(1-1/4)

You take the stack of dishes back into the kitchen, peer at the only clear patch of counter-top in your kitchen, and concluding that you did not place the keys there the night before, place your stack over the last remnants of cleanliness in your kitchen. Well time is running short, so check the bar/dinning-room table, as you collect your text books/paperwork spilling from the table and chairs. On your way out the door, you pull the cushions off the couch onto the floor. Concluding that your last set of keys are lost to the void, you count grimy change for cab fair, from the box springs of your couch, and head out the door. Oops, you almost forgot to lock the door, so you turn around and twist the keys hanging from your door-knob, and head out to flag down public transportation. Only immediately after you have paid cab fair, do you realize that the keys are once again on your person."

Monday, August 10, 2009

Saturday, August 8, 2009

Taking a short break

The first priority of this blog, is to build a following for my study. In order to do so, I will need to take a step back from time to time, and just release. I posted this blog on my MySpace profile, and I think that posting it here will help those following, in getting to know me. I aim to post on this blog at least every other evening, to keep you the reader updated and interested. From time to time, I will let you in on the external process of putting all this together.

"I've been researching and posting statistical proofs on blogger for the last week, and I'm a little wiped out at the moment. I've got a lot of ideas bouncing around in my head, mostly probability models and visual presentations, but I have to present the ground work to the target audience first. Balancing my time between these two priorities, along with building a following for my study, it's all a learning process. Of course that is the purpose of all this anyhow. At my monotonous job, I often catch myself daydreaming about what I want/need to get posted by the end of the night. By the time I get home with fresh material, contained in a fatigued mind, I face the challenges of; how to present it, where to present it, and what is it building from and leading up to?

I used to HATE doing research and analysis in school. Now ironically, either because of conditioning, or because of the predisposition of an inquiring mind, I find that doing this in my spare time is a healthy and full-filling release. I feel like a freelance statistician, with no current affiliation to a company, but with an overwhelming desire, and an ever-growing passion, to hone my skills. There is a lot that I did not know about probabilities just a week ago, but have come to understand through resourcing and practice. Though there is much I still want to understand, I am confident that resourcing will eventually bring me there. Through life experience, and in my short lived experience in the master's program, I have learned that the most important skill is the ability to resource and critical analyze information. Scholars and masters of trade put on the illusion of infallible and limitless knowledge, with respect to their emphasis or trade, but in actuality, are just superb researchers. Only a fool will believe that he has learned all he needs to know, with respect to his passion."

Have a good evening all, see you again soon.

Probability: Law of Addition


When you draw cards from the top of your deck, in hopes of drawing into a specific card, say that Warp World, Haunting Echoes, Akroma, Angle of Wrath, or whatever your devious plans call for, you are essentially sampling without replacement. Your deck does not replenish itself as you draw, unless of coarse you are pulling some wicked synergy. The act of drawing actually influences probabilities of future draws. When you are checking two or more separate events, which are independent of one another, and looking for the same outcome, the overall probability is found through the addition of the probabilities. Total Probability, as this is called, looks as follows:

P(A or B) = P(A) + P(B)

However, when the two or more events are dependent, as in the case with a depleting deck size, the equation looks as follows:

P(A or B) = P(A) + P(B) - P(A and B)

We can rearrange this equation in numerous ways; I have two ways which I like to use. P(A and B) is the same as P(A) x P(B); I will cover the Multiplication Law later on.

P(A or B) = P(A) + P(B) - P(A) x P(B)

P(A or B) = P(A) + [P(B) - P(A) x P(B)]

P(A or B) = P(A) + P(B)(1 - P(A))


I like this arrangement, because it is easy for me to remember that, "If I had found the card in the first draw, I wouldn't be looking for it in the second draw." Before I move onto the third arrangement, I should explain P'(A), P prime of A. If P(A) is the probability of successfully finding the card in the first draw, then P'(A) is the probability if failing to find the card in the first draw. Because all possible outcomes add up to 1, when dealing with probabilities we can observe Probability: Law of Subtraction as follows:

P(A) + P'(A) = 1

P'(A) = 1 - P(A)

P(A) = 1 - P'(A)

In second example, the second probability, P(B), must be multiplied by the probability of failure of the first check, P'(A), because we had to fail to get there. Let's see what happens when we substitute 1-P'(A) for P(A):

P(A or B) = P(A) + P(B) -P(A) x P(B)

P(A or B) = P(A) + P(B) - [(1-P'(A)) x P(B)]


P(A or B) = P(A) + P(B) - [P(B) - P'(A) x P(B)]


P(A or B) = P(A) + [P(B) - P(B)
+ P'(A) x P(B)]

P(A or B) = P(A) + [P'(A) x P(B)]


P(A or B) = P(A) + [(1-P'(B)) x P'(A)]


P(A or B) = P(A) + [P'(A) - P'(B) x P'(A)]


P(A or B) = 1 - P'(A) + P'(A) - (P'(A) x P'(B))


P(A or B) = 1 - (P'(A) x P'(B))


P(A or B) = 1 - (1-P(A))(1-P(B))


What this tells us is that if we find the probabilities of failing to draw into the desired card on both the first and second draw, we can multiply them together to get the probability of failing to draw into the card on both draws, P'(A or B). Take one minus that probability, and we have the probability of drawing at least one of the desired card in the first two draws.

So, say I have 4 copies of the desired card, in a 60 card deck, what are my chances of drawing into that card in my opening hand of 7 cards:

P(A or . . . G) = 1 - (1-4/60)(1-4/59)(1-4/58)(1-4/57)(1-4/56)(1-4/55)(1-4/54) = 39.95%



Friday, August 7, 2009

Why Statisical Analysis?


We use Statistical Analysis in almost every facet of society today. Engineering, Economics, Science, Medicine, Marketing, and Psychology are just a few fields which heavily utilize this branch of mathematics. In Statistical Analysis we seek to either optimize our gain, based on the probabilities presented, or we observe an optimal trend, and seek to find the probabilities behind it. Through my experiences in obtaining my B.A. in Biology, I was astonished when I learned that statistical models in Economics were virtually identical to statistical models in Ecology. By changing the meaning of certain variables , it is as if we could use money to explain population distribution and survivorship.



Game Theory, which takes root in Bayesian Logic, looks to optimize the probability of winning. The models of Game theory have been used in economics as well. Game theory uses descriptive, situational statistics, to build models , which describe the best decision in a given circumstance. In Magic the Gathering, one could apply Game Theory, by analyzing the current game environment, and modeling the best deck to play in the next sanctioned tournament. During sanctioned play, one could model the best play, at a critical moment in the match, again using descriptive probabilities, which will tell you what your opponent's deck is likely to have in it, or what your opponent is likely to play.



Inferential Statistics are probabilities built from inferences. Inferential models may be used to describe specific circumstances, but they can also describe trends in a broader scope. A skilled and ethical statistician will be able to define, and provide a clear definition of the assumptions in an inferential model. Assumptions are parameters designed to exclude variables from a model, which are believed to exhibit minimal or insignificant influence on the outcome. The groundwork of a descriptive model has no such assumptions, as the probabilities leading up to the model have already been observed. The only true assumption of a descriptive model is that the descriptive probabilities will not change, mid-circumstance. Assumptions can be seen as both the strength and weakness of inferential models.



I have chosen to pursuit inferential models, because first and foremost, I want to look at Magic the Gathering in broad scope. I hope to build models which will prove robust, as the game environment changes from expansion to expansion. Too often, I have seen veteran players leave the game, because of the inability to keep up with the latest trends in Magic. For some, the mechanics get too complex, for others the cards seem too over-powered. But with inferential models, we could gain a clearer understanding of the true power of cards, from past present and future expansions. In applying these models, the task of figuring out what to supplement your collection with, from the current set, would become much less daunting to the veteran player.


Wednesday, August 5, 2009

Why we keep decks trimmed.

Here is one of many blogs to follow, in which I will cover some basics in statistics and probability. I will post these in order to explain, piece by piece, the framework of my study, and eventual e-book. To most of us, it is common sense to keep our decks trimmed, because we know intuitively that doing so increases our chances of drawing into the cards we want to play. But without proof, our best guesses are nothing more than just that. Here is the proof, which can be found in the introductory chapter of most any Statistics text book:

IF: P(X) = 1/X

Prove: P(N) > P(N+1)

By substituting all instances of X for N when P(X) = 1/X, we get P(N) = 1/N.

By substituting all instances of X for (N+1) when P(X) =1/X, we get P(N+1) = 1/(N+1)

Let's arbitrarily call N 60, for a typical deck size of 60 cards.

We find that P(N) = P(60) = 1/60 = 0.01666,

and P(N+1) = P(60+1) = 1/(60+1) = 0.01639.

0.01666 > 0.01639, therefore

P(N) > P(N+1).


In otherwords, If you have one copy of a card in your deck, you will have a 1.666% chance of drawing into it from the top card of a 60 card deck, and a 1.639% chance of drawing into it from the top card of a 61 card deck. This might seem like an insignificant difference, but rest assured, as you add more and more cards to your deck, without thinning others out, the difference becomes significant. Later on I will cover finding Probability Without Replacement, which explains what happens to the probabilities of drawing into certain cards, as you deplete your library through the act of drawing. But for now chew on this; if you have 4 copies of a specific card in your deck, you have a 39.950% chance of drawing into at least one of those cards in your opening hand, from a 60 card deck. However if your deck is 70 cards, your chance of drawing into at least 1 of 4, in your opening hand, is reduced to 35.035%.

Tuesday, August 4, 2009

Introducing Myself

I have been collecting into, and playing Magic the Gathering for almost 15 years. I account myself one of the few casual-play veterans, who is pleased with the balanced direction the game has moved in. Over the years, I have watched a fluctuating, but growing population of players, gravitate towards MTG, and other trading card games. With MTG's overall popularity growth, I have seen this interest channeled into numerous web-pages, blogs, and forums, with increasing frequency. I have personally picked the brains of numerous posters, in constructing my own type two, and extended decks. The wealth of information I find, from players much younger than myself, is insightful and astonishing.

I am beginning a project, which I hope will be ongoing, where I will statistically analyze MTG at the most fundamental levels. Through the research I have already done, I have seen most serious analysis as outdated (in terms of modern game mechanics), or guarded (subscribe here, plug your numbers in here, get your answers here). Of coarse a major function of this initial blog is to share and network information on the subject of analyzing the game, which I may currently lack.

I feel strongly, that the research I will do, will be different than the quantitatively objective, or qualitatively subjective information already out there. Most analyses focus on overall game-play, and deck building strategies. I will refine my focus to individual cards, and individual mechanics, by revisiting the most fundamental levels of the game. I will construct probability models, which I hope will be transposable into future expansions, where I will be able to empirically measure the strength of future expansions.