Dice Theory and Branch Theory

    By making approximations on a system, it is far simpler to see general rules and logic lines, and their effects, than pre-approximations.  To this end, let us look at Yu-Gi-Oh! after making some approximations in this manner.
“Dice Theory”

    What does it mean to win?  To win, it simply means that the combination of your decision making, deck building, and luck were greater than the decision making, deck building, and luck of your opponent.  In a way, a game can be described or approximated as the two players each pulling out their [heavily modded, sleeved, 1st edition hobby league ready-microwaved] dice, and rolling them.  Whoever rolls higher would be the winner.

    In this comparison, the various numbers on the dice would be the results of a formula accounting for the three qualities stated above (decision making, deck building, and luck).  It should be noted that your opening hand is both a subset of deck building and luck, and thus the variance in your opening hands is shown in the dice’s face values.  A dice could have various amounts of sides (just like how decks have various amounts of standard plays – example, +1 Fire Fist vs Dragon Rulers).  In the following examples, I’m going to set the amount of sides to 10 for all, because it makes it easier to illustrate my point.

    Player one has a dice with not only holographic, astral pack edges but also an 8 on each face – so 10 faces with 8 on each.  If he rolls any amount of times, his average value will be 8.  This kind of dice, consistent and having decent values, could be alikened to +1 fire fist.

    Player two is going for maximum yolo.  He just got back from 360 n0sc0ping some pleb on COD, and is using a minimum scope maximum skill dice, on which 6 sides are 9, and 4 sides are 1.  The average value of this dice’s faces are 5.8.

    So, between player one and player two, who is more likely to win?  The simple answer which new players may mistakenly pick is player one, because on average his roll is an 8, versus player two, who’s rolling not only his swagged out tricycle but also a 5.8.  However, at no point does player two’s dice land on 5.8 – it will always land on either a 9, or a 1.  If it lands on a 9 player two wins, and if it lands on a 1 he loses.  So in other words, player two has the advantage with a 60% win rate (as games approach infinity).

    Let’s change player one out for player three.  Player three is using a consistent dice from a past meta, so it has 6 on each of its 10 sides.  Player three will have the same win – loss rate as player one versus player two’s dice, but will have a 0% win rate against player one.  So, let’s look at this:

    1. Player one vs Player two: 40-60
    2. Player one vs Player three: 100-0
    3. Player three vs Player two: 40-60

    Note that player one and player three seem to be equal based on our win rates in (1) and (3).

 However, they are obviously not equal when we look at (2), with a 100% win rate for player one.  So, what does this mean?

    Traditionally, a difference between OCG and TCG deck building has been noted: OCG seems to run builds with more variance between hands (sacrificing consistency for higher power).  TCG traditionally (not saying it is forever to be static) runs builds with lower variance between hands, but at the cost of some of the higher power (and inconsistent) hands.  This does not only extend to variance in the consistency sense – ‘win-more’ has become a buzzword in the TCG, but with good reason?  When looking at the game in the approximated dice form above, we see consistency is not the deciding factor – nor is a card like Dark Hole.  In the past, Dark Hole was a very dualistic card – good for baiting your opponent into overcommitting and good when you were in a losing position, but suboptimal when you have an established field.  The argument here is generally ‘if I’m winning its fine to have a suboptimal card, as if I start to lose the card becomes optimal’.  However, is this correct?

    Let’s say that player two adds a Dark Hole, or a similar card, to his deck.  What happens here is the values it at suboptimal times and optimal times become averaged over all faces, but are applied differently to different faces of the dice?  For example, two of the faces with 1’s on them may become 4s, while two of the faces with 9s on them (when he is in a winning position / established field) may become 7s (he lost a combo piece for dark hole).  His dice now has two faces with 1s, two faces with 4s, four faces with 9s, and two faces with 7s.

 His average dice roll is now a 6, up from 5.8 – a more consistent deck.  Let us examine his win rates.

    1. Player two vs Player one: 40-60
    2. Player two vs Player three: 60-40

    While his win rate vs player three is still 60%, his win rate versus player one has dropped 20% (from 60% to 40%) because he sacrificed power for consistency.  So power is a broad word, how are we defining it? Power is generally used to describe how strong a field can be thrown up (example, Abyss-Teus + Aqua Spirit used to be a common power play), as well as how much damage (both life point and card advantage) something can do (Judgment Dragon is powerful).  However, speed / tempo is built into this definition, and often overlooked.  There is a winning threshold in this game, where if you are above your opponent by a certain amount (dependent on point in the game and match up) you win.

    To better implement describe this, let’s give each player three hearts.  A player loses the difference in rolls in hearts, and players keep rolling until one dies.  What does this do?  If one player rolls a 9 and the other a 6, the player whom rolled a 6 will lose right on the first roll.  However, if one player rolls a 9 and the other an 8, and then the next roll is 4 vs 8, the player rolling the 8s will have one: as the variance based player failed to reach the winning threshold in the allotted time (a better way to describe this would be to have players gaining hearts per turn given by a non-linear function dependent upon the number of turns).

    At this point we realize that if we are the variance player we have to just forgo the lost hands (because if we roll a 1 or a 4 in Yu-Gi-Oh! it’s not likely to turn into a 9) and find the winning threshold. Once we have done this, we transition into maximizing the likelihood we reach that threshold (as there is no difference between rolling an 11 against an 8 or a 17 against an 8), and then maximize it.  Of course, due to the sheer number of hands possible in a 37 card deck, our plot will not simply be us seeing the threshold and then having a line for two units at four, for two units at one, for four units at nine, and for two units at seven – if we were to graph it holistically, with ‘true’ values assigned to each hand, it would reflect a traditional, continuous graph much more due to the number of points.  At this point we would graph different builds, and see which has the largest unit distance above the threshold: in effect, which value of deck satisfies this for the largest percentage of hands.  This would of course be extremely tedious to do by hand, and thus would be done by computer (if we generalize hands to a degree this is actually not hard to code).

Returning from this tangent to the concept of assigning different values to different faces, we have four dice, with the following faces:

    1. Ten 8s (Tier One Consistency)
    2. Ten 6s (Lower Tier Consistency)
    3. Four 1s, Six 9s (Variance)
    4. Two 1s, Two 4s, Two 7s, Four 9s (Variance with Dark Hole type card(s))

    Our averages are 8, 6, 5.8, and 6, respectively.  We previously examined the variance vs consistency match up, and saw that it was based on the winning threshold being reached as fast as possible (using the model with non-linear amount of hearts gained per turn to represent grind game).  In Yu-Gi-Oh!, this is seen how a combo heavy, aggressive deck will generally win with the superior power it generates over a limited amount of turns – compared to the relatively linear power generation of a deck such as +1 Fire Fist or HAT, or will simply fail to win early and then get out grinded as the average power decreases with following turns.  This is due to Yu-Gi-oh!’s lack of a restraining mana system – the only thing limiting the combo deck’s aggression is its ability (how long it takes) to convert hand advantage into field advantage.  While we are on the Magic related note, it should be noted that dice interactions describe deck interactions between agro, combo, and control relatively well, while allowing us to easier compare this to Yu-Gi-Oh! despite the mana system.

    Let us examine the consistency mirror, and the variance mirror.  In the consistency mirror, the win will almost always go to the player with the higher average roll.  For example, going back to January 2014 we see things like Bujins, Blackwings, and Hunders doing abysmally.  This represents the concept of fairness that has been used increasingly in recent times – these decks are consistency based in rolls, and for the most part do not have high power variance rolls.  Because of this, the winning threshold between these decks and a tier one consistency deck (+1 fire fists, represented by dice (1) above) is very rarely achieved in early game (first couple rolls), and almost without fail the lower tier consistency deck falls.  From this, we see that there is almost no benefit in playing lower tier consistency based decks.

    In contrast, the variance mirror includes two dice with large bounds in roll values.  This is allows for the winning threshold to be achieved extremely easily, as if one person rolls an 8 and the other a 2, the game immediately ends.  This concept is exemplified in a match up like Quickdraw quasar vs Karakuri.  Essentially whoever bricks will lose immediately if the other does not brick equivalently (for example rolling a 3 vs a 2).  However, at this point we notice that with the high variance rolls there is little to be gained by increasing your roll power – for example, if your opponent rolls a 2 there is no difference between rolling a 6 or rolling a 9.  So, if the meta is mostly composed of variance based decks or dice, you should seek to restrict your high rolls to the minimum winning threshold, and increase your lower variance rolls enough to increase your win rate slightly (for example, adding dark hole type cards).

    Referring to a post by Hoban in the ban list thread, we see him note that the format generally goes consistency -> variance in terms of tier one decks / dice.  Of course, over time builds become refined and more consistent at hitting their goal (what they’re winning condition is).  In terms of a constancy deck, which generally has a stable, non-combo based core, we might see slight adjustments to the monster line up (such as the addition of Card Car Ds to Fire Fist, though Card Car is not a true monster) and standardizations to the main deck, such as fiendish.  This is because in a consistency-based meta, there is only one ‘best dice’, and thus this dice changes to combat itself better.  This represents the first half of January 2014’s format.  Then variance is introduced in the form of Mermail.  Contrary to +1 Fire Fist, Mermail did in fact have the ability to brick, which resulted in something resembling dice (3) or dice (4) (this was further accentuated games two and three where the fire fist could draw a macro and win unless Mermails could quickly out it).  However, as noted in the constancy vs variance section, there is no difference between losing with a difference of 10 cards in card advantage between you and your opponent, and a difference of 1 card – both mean a loss.  Because of this, Mermail’s variance based style allowed it to accept the losses to macro / difi, and focus on the six or so faces of very high value rolls which were enough to reach the winning threshold over fire fist without progressing to the late game, or at least reach the late game with correct set-up (waters for Tidal in grave, and preferably a controller in hand).

        The second point that I wished to talk about is branches, in relation to card effects, deck building, and decision making.  Branches are almost never talked about directly, despite being implicitly (and often unknowingly) referenced all the time.

“Branch Theory”

        What do I mean by branches?  Let’s relive elementary school, and say that a scummy player (Let’s call him player X) wakes up one morning.  There are three things he can do: top a locals, rip someone’s trade binder on Pojo, or post on the Hearthstone thread.  Let’s look at this.

        Let’s also assume that you’ve been dutifully stalking him for the last five years, and know that he has a 30% chance of going to locals, a 40% chance of stealing a binder through Pojo and a 30% chance of posting about Hearthstone.

        You also know that when he goes to locals, he has a 60% chance of topping, and steals binders without getting caught 80% of the time.

        If he has a 60% chance of topping, he has a 100% – 60% chance – 40% — of not topping, and similarly a 20% chance of getting caught.  So:

        Now, let’s go back to the start.  If player X has just woken up, and we want to know how likely he is to go and steal a binder without anyone catching him, we follow the branches to that point: so we’ll get 40% * 80%, which comes out to 32%.

        To try and maintain a logical progression, let’s start with card effects, move to deck building, and then touch on decision making.

        Pot of Duality is best described by the use of branches (people have difficulty understanding how it helps consistency because they often lack an understanding of branches).  For this example, I’m going to leave out Upstart Goblins and other draw cards, because the tree becomes very large and daunting.  Let’s say you’re trying to figure out how much running a Pot of Duality will help you draw Exodia’s head, as opposed to running a non-draw card in that slot.

        You’ll notice there are two places where your goal is fulfilled – hitting Exodia’s head in your opening hand, and getting it off a Pot of Duality.  So, your probability of getting Exodia turn 1 will simply be a + (1 – a) * p * h.  You simply do what we did with the previous example, but add each possible path: so we added the first path and the second one in this case.  Note: these values may be calculated by using a hypergeometric calculator or one of the programs I released if you’re interested in them.

        Now that we have talked about using branches to better describe card effects, let’s move onto deck building.  A question was posed in a deck thread – is Forbidden Lance or Mystical Space Typhoon optimal? To answer this question, first examine both cards. They share a common overlap in preventing your monster from dying to a trap.  Now let us compare the differences:

1. MST is optimal when there is only one backrow and your opponent went first because it plays around Solemn Warning unlike Lance.
2. Lance is better when there are multiple backrow due to being able to chain to a trap.
3. MST kills Vanity’s Emptiness.
4. Lance lets things beat over El Shaddoll Winda.
5. And more stuff that I’m not going to list, because you’re getting the point of this at this point.

        What we do now is we divide the branch goals between ones that show Lance is better and ones that show MST is better.  We then use branches to calculate which is more likely to occur by summing the probabilities, and then get our answer.  I did this to a limited degree here (I did not do the full branch as it was an example).

        “And Miss Click, because this deck does not fear any commonly played flood gates, it’s not too difficult to see where Lance is better than MST.  All we do is look at the average number of vanities + average number of Solemn Warnings (1 or 0) / deck, and compare it to other backrow / deck and see which is greater.  Note that Lance has applications outside of merely protecting from backrow due to the attack reduction.  For example, it allows Kuick to out Winda.

        Also note another thing, if you play MST over Lance solely as a counter for Vanity’s:

        Your opponent has x % chance of drawing Vanitiy’s, multiplied by 0.5 * y due to the fact they’ll normally have to go first to use it against you (sucks against established field).  y represents your ability to combo at least one synchro monster.  I will code this in tonight (your chances of not bricking basically).

        So: getting skilled on by vanities lock is x * y / 2.  (Note that is never actually 0.5 but because we look at the full match we average the value of going first or second).

        Now, let’s say you run a number of MST.  You have a z % chance of drawing it.  In order for you to get the desired value out of your MST, you need to have your chance of MST overlap with them locking you with Vanity’s.  So, you’ll see that to calculate which is better we have to look at the tree:

        Let g be the % chance of them having multiple backrow, L = % to draw lance.”

        You can apply this line of thinking and problem solving to most deck building applications in the same fashion, so now let’s talk about decision making in game (as in technical play).  Before we begin, please note that there is always a correct technical play, and the correct technical play can still lose you the game – the correct play changes based on the amount of information available (before seeing your opponents face-downs, versus being omniscient and knowing the face-downs).  You have a spell card that will let you target one monster on the field and destroy it, and if the monster is destroyed (ie nothing happens before spell resolves) your opponent takes 8000 life points.  However, if the monster is not destroyed during the resolution of your spell, you take 8000 life points instead.  What are the chances of you killing yourself as opposed to your opponent?

        So, what do we notice about this?  Our tree is very simple right now, but unintuitive.  This is because we have yet to expand the branches.  Let us begin to do this.

        The monster being destroyed means that your opponent did not have an out – so let us clarify this by expanding the branch vertically.  Expanding a branch vertically does not change the values because there is only one path to take (straight down) meaning the probability will simply be multiplied by 100% (1).  So now, using information such as ‘what traps does my opponent’s deck normally run, what s/t have I seen, what has he used’, you are able to make the optimal choice based on the information available to you.  I am sure many of you do this implicitly already.  However, what the branches let you do is calculate the correct play by looking multiple plays down (by branching as in previous examples).

        Let us view one more example, in which we see multiple branches upon the play-path.  You’re in the U.S national finals, sitting across from a player, lets call him Josh.  You control a Machina Fortress, and a face-down Forbidden Lance (one in grave, none in deck).  Your opponent has two face down cards.  You enter your battle phase, and Josh activates a Mirror Force.  Now, generally you would protect the Fortress with lance, but in this case it is game three, and in game two X activated a Magic Cylinder against you.  You are at 2500 lp, and consider that he may be trying to bait your lance to game you with a Magic Cylinder.  He asks you if you have a response to Mirror Force, what do you do?

        In this example, we notice varying gains values depending on the path the duel follows — so in other words, different results can be better to aim for even if they are less likely.  Let us fill out the probabilities as we have done previously.

        Now to solve this, you simply add up the possibilities from activating Lance, and compare them to the possibilities from not activating Lance, and see which is higher.

        Lance: -s * w + (1 – w) * r * s + (1 – s) * (1 – r) * p * -w + (1 – w) * (1 – s) * (1 – r) * w
        Don’t Lance: g * r  * w + g * (1 – r) * m + (1 – g) * -b

        Note: You could probably expand the tree if you’re feeling skilled, but niche probabilities have extremely low impacts.  Remember that when comparing possible plays you don’t need to find the probable gains value (probability of it happening * gains) but only figure out which play has higher value (in other words you don’t need to find x, but only if x > y).

“Combining Dice and Branch Theory”

        The next question is likely ‘how do I combine dice theory and branch theory’.  The main application (not to say that there aren’t others you can link them for) which I use is the match system.  In the dice theory section, the players had been playing singles – however, Yu-Gi-Oh! is played in matches obviously. However, are all matches the same?  No, as you may play two games in a match and go second both times, or may go first, second, first, etc.  The thing we have to note here is what our dice face values are representing — the faces are a combination of the deck building, luck, and technical play (decision making).  Note that contained inside the deck building set is the subset of your opening hand — which varies going first or second (five cards versus six), and that the deck itself changes after siding.  For example, in the variance vs consistency match up that we were representing before, game one player three may have a 60% win rate against player one.  However, post side floodgates are generally applicable for the variance deck (due to variance being generally more combo oriented and weak to floodgates).  For example, by adding macro and dimensional fissure to his deck, the fire fist player changes two of his faces from 8s to 11s, making it so that unless the variance / Mermail player rolls a high enough number (a number containing an MST), he will simply auto lose.  This changes the win / loss rate from 60%, which is important.  We are still able to generalize these face values to constant however, by creating different faces for going first / second, pre-siding / post-siding, etc.  So let us look at a picture.

        Without any information other than we’re playing a game, we could aliken this to a coin flip — if it heads, we win, if tails, we lose.  At that point it would be a 50-50 w/l.  You will notice that with no information, we assume each branch is a 50-50, and we will end up with 6 red circles (lose the match) and 6 blue (win the match) showing that in fact with no other information it remains a 50-50 through the branching.  Now, let us apply dice theory.  By applying dice theory, you can approximate win / loss ratios for pre / post siding and going first / second.  So in other words, you will end with 8 percentages, shown here.

        Win % Pre siding going first: a
        Win % Pre siding going second: b
        Win % Post siding going first: c
        Win % Post siding going second: d
        Loss % Pre siding going first: 1 – a
        Loss % Pre siding going second: 1 – b
        Loss % Post siding going first: 1 – c
        Loss % Post siding going second: 1 – d

        If you wish to be extremely precise you may approximate percentages for information gained and such (making differences between game two and game three), as well as the percent of the time that your opponent will opt to let you go first after they lose.  However, I want to keep the example relatively simple, so I shall stick with this and assume that your opponent chooses to go first each time they can, and that you do the same.  Viewing music for resulting picture.

        After you’ve taken in the monstrosity that is the resulting jpg, note that your chances of winning the match are:

0.5 * a * d + 0.5 * a * (1 – d) * c + 0.5 * (1 – a) * c * d + 0.5 * b * d + 0.5 * b * (1 – d) * c + (1 – b) * c * d

        and your chances of losing are:

0.5 * (1 – a) * (1 – c) + 0.5 * 1 – a * c * (1 – d) + 0.5 * a * (1 – d) * (1 – c) + 0.5 * b * (1 – d) * (1 – c) + 0.5 * (1 – b) * (1 – c) + 0.5 * (1 – b) * c * (1 – d)

        Now, the skilly thing here is that if you have a 50-50 win / loss ratio at a point (lets say for a, so a = 50% or 0.5) then 1 – 0.5 = 0.5, and we see that the chances of winning and losing are equal (when a = b = d = c = 0.5).  Note that I did not reduce and compact the above lines (for example, have 0.5 * ( a …… * d)) because I wished to better demonstrate the application of branching here.  Note that you may go one set higher, and generalize your match win rate (from this branch chart, as a function of round number among others) over the possible paths your win / loss record could take (this depends on how long the tournament is), and see your chances of winning, topping, etc.

Inexorably

I code, play pet decks, and write stuff.

Show Buttons
Hide Buttons