So I have been meaning to open a thread where we can collect questions and answers regarding the mathematics of Hearthstone (which is after all a game based heavily on mathematics). Richard Garfield, the creator of MtG, has a PhD in combinatorial mathematics, so that may be the reason.
I don't want to argue about whether it's 'math' and not 'maths' by the way, unless you can tell me why you don't study 'stat' :P
Which comes from DimosTheTherion, asking about the probability of drawing minions and not spells in a Barnes deck, the aim is to show the probabilities of having a certain number of minions in hand after 5 draws (turn 5 usually, but drawing cards affects that, so we will say 5 draws).
I'll use this first post to cover the case before the mulligan,
Dimos has 22 non-minions and 8 minions in his deck. So I'll show how to calculate how likely it is to see M minions in the cards you see before the mulligan.
You can come up with several correct arguments based on combinatorics but I'm going to use the general case which we will apply for the mulligan and later turns as well, which uses the Hypergeometric distribution. This gives the probability of drawing marbles from an urn of different colours when you don't replace them.
The population size is 30 (number of cards in the deck)
There are 8 "successes" in the deck, i.e. minions.
The sample size is 3 (number of cards you see).
So, we use those parameters and get the probability for seeing M = 0, 1, 2 or 3 cards. I will use H(30, 8, 3, M) to denote the parameters used for the distribution.
p(M=0) = H(30, 8, 3, 0) = 0.379310344827586
p(M=1) = H(30, 8, 3, 1) = 0.455172413793104
p(M=2) = H(30, 8, 3, 2) = 0.151724137931034
p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759
So the most likely result is seeing 1 minion, about 45%, then 0 minions is next most likely (about 38%).
Going 2nd, similar, but we use H(30, 8, 4, M) since we see 4 cards and M goes from 0 to 4:
p(M=0) = H(30, 8, 4, 0) = 0.266922094508301
p(M=1) = H(30, 8, 4, 1) = 0.449553001277139
p(M=2) = H(30, 8, 4, 2) = 0.236015325670498
p(M=3) = H(30, 8, 4, 3) = 0.0449553001277139
p(M=4) = H(30, 8, 4, 4) = 0.00255427841634738
So again, seeing 1 minion is most likely (45% again) but seeing 0 and 2 is roughly the same odds (27%, 24%).
The calculator also shows you p(M < x), p(M <= x) etc. which can be useful as well.
Next installment I will go into how the mulligan affects the odds if you hard mulligan for non-minions (i.e. throw away all minions).
That assumption is not valid if you always keep Barnes and no other minion, I will probably go over that as well.
==================================
If you respond to a specific question, it helps to link the post where the original question was asked.
You can also ask other questions and I will decide if I can be arsed answering them ;) Hopefully the answers I give will be explained well enough to work out how to do things on your own for similar scenarios as well.
I'm ok with being sidetracked about non-Hearthstone maths questions as well. I also know about the maths involved in making video games so we could go there also.
So, you cheated Mungo! You didn't answer the question, you just showed how to find the answer for pre-mulligan number of minions seen and you also used a calculator rather than multiplying out all the binomial coefficients (number of ways of choosing N objects from a set of M in total).
Yes, I cheat if there is an online calculator to do the work for me.
I will go into detail about the case when going first here then probably hand-wave and leave the going 2nd case as an exercise ;)
This is stage 2 in the calculation, we will find the probability of having 0, 1, 2 or 3 minions in your hand AFTER you mulligan, ASSUMING that you throw away every minion you see. The final stage is continuing this for the first 5 draws of the game.
We already worked out the odds of having 0, 1, 2 or 3 minions pre-mulligan.
If you have 0 minions, you don't mulligan anything. So the chance of having 0 minions remains the same after the mulligan if you had 0 to start with.
If you have 1 minion before the mulligan, you throw it away, and get back 1 additional card. This cannot include the card you just threw away, so you are drawing 1 card from a deck with 26 cards remaining in it (mulligan card is set aside). 7 of these 26 are minions.
EDIT: That is bobbins. You still pick from 27 cards remaining - the ones still in the deck - and the set aside card has no effect, apart from knowing it is a minion reduces the number of minions left in the 27 to 7.
Chances to have 0 or 1 minions in hand after mulligan given you had 1 minion pre-mulligan:
Here, p(A | B) means the probability A occurs given B has already occured
These 2 probabilities add up to 1, which is good, since one of those events is guaranteed to happen.
If you had 2 minions before the mulligan and throw both away, you are drawing 2 cards from a pool of 25 cards (2 mulligan cards are set aside). 6 of these 25 are minions.
If you had 2 minions before the mulligan and throw both away, you are drawing 2 cards from a pool of 27 cards. 6 of these 27 are minions.
Chances to have 0, 1 or 2 minions after the mulligan:
If you had 3 minions before the mulligan and throw all 3 away, you are drawing 3 cards from a pool of 24 cards (3 mulligan cards are set aside). 5 of these 24 are minions.
If you had 3 minions before the mulligan and throw all 3 away, you are drawing 3 cards from a pool of 27 cards. 5 of these 27 are minions.
Chances to have 0, 1, 2 or 3 minions after the mulligan:
Now we can calculate the chances of having 0, 1, 2 or 3 minions after the mulligan. There are 4 ways to have 0 minions, these are
I had 0 minions pre-mulligan. The probability of this was in post #1, and was 0.379310344827586
I had 1 minion pre-mulligan. The probability of this was in post #1, and was 0.455172413793104. Then I mulliganed the minion and I got 0 back with probability p(M=0 | (M=1 pre-mulligan)) = H(27, 7, 1, 0) = 0.740740740740741. These both have to occur one after the other, so we multiply the probabilities giving 0.455172413793104 * 0.740740740740741= 0.337164750957854932822477650064
I had 2 minions pre-mulligan. The probability of this was in post #1, and was 0.151724137931034. I mulligan them both and get 0 back with probability p(M=0 | (M=2 pre-mulligan)) = H(27, 6, 2, 0) = 0.598290598290598. Again, we multiply these to give the probability of having 0 minions after mulliganning 2, 0.151724137931034 * 0.598290598290598 = 0.090775125257883545652814618332
I had 3 minions pre-mulligan. The probability of this was in post #1, and was 0.0137931034482759. I mulligan all 3 and get 0 back with probability p(M=0 | (M=3 pre-mulligan)) = H(27, 5, 3, 0) = 0.526495726495726. Chances of both things happening is 0.0137931034482759 * 0.526495726495726 = 0.0072620100206307234188034188034
Those are the only ways to have 0 minions after the mulligan. These are independent events so we can add the probabilities together to get the final answer
p(M=0 after the mulligan stage) = 0.379310344827586 + 0.337164750957854932822477650064 + 0.090775125257883545652814618332 + 0.0072620100206307234188034188034 = 0.8145122310639552018940956871994
So you are around 81% likely to have 0 minions after throwing all minions away if you are going first.
The cases for 1, 2 or 3 minions are calculated in the same way, I'm having a break for a bit now though, peace ;)
EDIT: This post updated following realising my mistake about the mulligan number of cards drawn from.
So the probability to have a single minion after mulligan is about 22%
Ways to get 2 minions after the mulligan:
I had 2 minions before the mulligan (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034) and have 2 after i.e. p(M=2 | (M=2 pre-mulligan)) = H(25, 6, 2, 2) = 0.05. Multiplying, 0.151724137931034 * 0.05 = 0.0075862068965517
I had 3 minions before the mulligan (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and have 2 after i.e. p(M=2 | (M=3 pre-mulligan)) = H(24, 5, 3, 2) = 0.0938735177865613. Multiplying gives 0.0137931034482759 * 0.0938735177865613 = 0.00129480714188360769865067466267
So the chances of having 2 minions after mulligan are
There is only 1 way to have 3 minions if you hard mulligan for non-minions. This is when you have 3 to start with (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759), throw them all away, and get 3 back P(M=3 | (M=3 pre-mulligan)) = H(24, 5, 3, 3) = 0.00494071146245059.
So the probability is 0.0137931034482759 * 0.00494071146245059 = 6.8147744309663497751124437781e-5. That number is tiny, scientific notation is being used (6.81e-5 i.e. 6.81 * 10 ^ -5), way less than 1%.
Summarising, after the mulligan:
p(M=0 after the mulligan stage) = 0.8050226145668424910044699678134
p(M=1 after the mulligan stage) = 0.2180588749914087562884903701994
p(M=2 after the mulligan stage) = 0.00888101403843530769865067466267
p(M=3 after the mulligan stage) = 6.8147744309663497751124437781e-5
Unfortunately, adding these up gives a number greater than 1, 1.0320306513409962184893621371133
But I believe that is caused by floating point inaccuracies in the calculation, which is SUPER ANNOYING. I think my reasoning is correct, if anyone can see a mistake let me know.
We'll blame it on inaccuracy for now. (Good brushing under the carpet there).
You'd calculate the going 2nd case in the same way.
Final episode for this question will entail using those numbers to calculate how many minions you are likely to have received after 5 more draws. That depends only on how many minions you have following the mulligan, since the set aside cards now go back into the deck.
There may be a bonus discussion about how keeping Barnes in the mulligan affects the results (hint: It adds another branch at the root of the probability tree, splitting the cases when we had Barnes from when we did not have Barnes - again you can use Hypergeometric distribution to calculate that).
EDIT: I spotted my mistake! It's always good to own up to mistakes as soon as you find them folks.
The number of cards in the mulligan calculation is wrong. You always pick from 27 cards (the ones you didn't see). Having cards set aside makes no difference. Oops. It just afffects how many minions are remaining of the 27... will edit my posts...
I double checked my working now I corrected it, and drew a tree diagram on a piece of paper ;)
Now the case for having 1 minion after the mulligan, this can happen as follows:
You had 1 minion originally (p(M=1) = H(30, 8, 3, 1) = 0.455172413793104). You then get 1 back from the mulligan, which is p(M=1 | (M=1 pre-mulligan)) = H(27, 7, 1, 1) = 0.259259259259259. Multiplying these gives 0.455172413793104 * 0.259259259259259 = 0.118007662835249067177522349936
You had 2 minions originally (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034). You then get back 1 from the mulligan, which is p(M=1 | (M=2 pre-mulligan)) = H(27, 6, 2, 1) = 0.358974358974359. Multiplying these gives 0.151724137931034 * 0.358974358974359 = 0.054465075154730157736516357206
You had 3 minions originally (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759). You then get 1 back from the mulligan, which is p(M=1 | (M=3 pre-mulligan)) = H(27, 5, 3, 1) = 0.394871794871795. Multiplying these gives 0.0137931034482759 * 0.394871794871795 = 0.0054465075154730494606542882405
Adding these possibilities up gives the chance to have 1 minion after the mulligan as
So you have about an 18% chance to have 1 minion when hard mulliganning for non-minions when going first.
Having 2 minions following the mulligan can happen in 2 ways:
You had 2 minions before the mulligan (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034) and have 2 after the mulligan, which is p(M=2 | (M=2 pre-mulligan)) = H(27, 6, 2, 2) = 0.0427350427350428. Multiplying gives 0.151724137931034 * 0.0427350427350428 = 0.0064839375184202662658414382552
You had 3 minions before the mulligan (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and have 2 afterwards, which is p(M=2 | (M=3 pre-mulligan)) = H(27, 5, 3, 2) = 0.0752136752136752. Multiplying gives 0.0137931034482759 * 0.0752136752136752 = 0.00103743000294724699086354258768
So you have about 0.8% chance to have 2 minions when going first if you hard mulligan for non-minions.
Finally, there is only one way to have 3 minions after the mulligan. This is when you have 3 to begin with (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and get back 3 after the mulligan, which is p(M=3 | (M=3 pre-mulligan)) = H(27, 5, 3, 3) = 0.00341880341880342. Multiplying these tiny numbers together gives 0.0137931034482759 * 0.00341880341880342 = 4.7155909224874888299440023578e-5 which is so small Windows Calculator gives it in scientific notation. The probability is about 0.000047, or about 0.0047%.
So to summarise, if you go first and hard mulligan to have no minions in your hand, the probabilities of having 0, 1, 2 or 3 minions after the mulligan is
i.e. rounding errors means it really adds to 1 (since it is certain to have 0, 1, 2 or 3 minions). I caught my mistake because my previous calculation had the probability adding up to more than 1. Any probability adding to more than 1 should raise major alarm bells (i.e. you got the sums wrong). If it adds to as near as dammit it 1 (which the number above is), it's due to rounding errors by the calculator and because the probability reported by the online calculator being limited to however many significant figures.
Once you have those numbers it's then fairly straightforward to calculate the probability of seeing a certain number of minions after 5 more draws. Mulligan considerations are the most complicated thing to calculate, and we just did that.
I will show how in a later post, then discuss how keeping Barnes affects the probabilities.
Awesome work there mungo ! Plus i think i understand it :P
Do you think the numbers would be very different if the player goes second, or if he goes 1st half the time and second the other half of games?
I know that in my 30 games, i probably went half and half (1st and second), and on a few ocassions i kept a minion (like Barnes), but to me it's striking that the probability in your numbers, to have 1 minion after mulligan is 18% , and i practically got 33 minions on 30 games after the mulligan! (so i almost always had one, a few times 0, afew times more than one).
Not sure if this is correct. I am pretty sure that when you muligan cards away they go back into the pool of cards that can be draw in the second muligan draw.
I've definitely had at least one case where I have initially draw 2 bonemares. Mulliganed the cards away then got them back again.
Of course I might just be reading the maths wrong. I still go cross-eyed at the sight of mathematical notations despite having a strong maths grounding.
Not sure if this is correct. I am pretty sure that when you muligan cards away they go back into the pool of cards that can be draw in the second muligan draw.
I've definitely had at least one case where I have initially draw 2 bonemares. Mulliganed the cards away then got them back again.
Of course I might just be reading the maths wrong. I still go cross-eyed at the sight of mathematical notations despite having a strong maths grounding.
Well, you're incorrect. You can't redraw the cards you mulliganed away until turn 1. If you did, then it was a bug.
Awesome work there mungo ! Plus i think i understand it :P
Do you think the numbers would be very different if the player goes second, or if he goes 1st half the time and second the other half of games?
I know that in my 30 games, i probably went half and half (1st and second), and on a few ocassions i kept a minion (like Barnes), but to me it's striking that the probability in your numbers, to have 1 minion after mulligan is 18% , and i practically got 33 minions on 30 games after the mulligan! (so i almost always had one, a few times 0, afew times more than one).
Going second makes a big difference because you get 4 cards and the mulligan stage has more cases to consider as well. I'll probably work this out later on.
I'm going to discuss what happens if you always keep Barnes in the mulligan as well and how it affects things.
One small terminology correction - the events are not independent, they are disjoint.
I thought that was what I smoked when I was studying maths... you are correct of course. Independent would mean doing 2 separate things which cannot affect each other (like drawing a card from 2 different decks).
I think I got a good question for this thread. What is the maximum amount of gold you can earn by quests on a week, and what is the probability of acheiveing it?
I think I got a good question for this thread. What is the maximum amount of gold you can earn by quests on a week, and what is the probability of acheiveing it?
I'll put that in the question bank, I don't think they released enough info about the quest drop rate to make a decent prediction though. I believe there is a cool down period after completing a quest (not sure if rerolling affects this also), and currently there is no info about whether the drop rates for all quests is uniform (equally likely).
If anyone knows more about the system feel free to chime in...
My current understanding is it may be ever so slightly beneficial to gamble rerolling a 50g quest since I think (assuming all quests are equally likely) the average value of a quest is something like 52g. It's a gamble though - take the 50g quest now or risk a reroll?
I think I got a good question for this thread. What is the maximum amount of gold you can earn by quests on a week, and what is the probability of acheiveing it?
I'll put that in the question bank, I don't think they released enough info about the quest drop rate to make a decent prediction though. I believe there is a cool down period after completing a quest (not sure if rerolling affects this also), and currently there is no info about whether the drop rates for all quests is uniform (equally likely).
If anyone knows more about the system feel free to chime in...
My current understanding is it may be ever so slightly beneficial to gamble rerolling a 50g quest since I think (assuming all quests are equally likely) the average value of a quest is something like 52g. It's a gamble though - take the 50g quest now or risk a reroll?
Noxious did some calculations regarding maximization of gold. Not sure if this is still relevant because of all the new quests, and didn't really look if it answers the question above but it is quite informative anyway. Have a look: Noxious Gold
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
So I have been meaning to open a thread where we can collect questions and answers regarding the mathematics of Hearthstone (which is after all a game based heavily on mathematics). Richard Garfield, the creator of MtG, has a PhD in combinatorial mathematics, so that may be the reason.
I don't want to argue about whether it's 'math' and not 'maths' by the way, unless you can tell me why you don't study 'stat' :P
First question http://www.hearthpwn.com/forums/hearthstone-general/general-discussion/34296-is-the-matchmaking-system-really-random-or-rigged?comment=576
Which comes from DimosTheTherion, asking about the probability of drawing minions and not spells in a Barnes deck, the aim is to show the probabilities of having a certain number of minions in hand after 5 draws (turn 5 usually, but drawing cards affects that, so we will say 5 draws).
I'll use this first post to cover the case before the mulligan,
Dimos has 22 non-minions and 8 minions in his deck. So I'll show how to calculate how likely it is to see M minions in the cards you see before the mulligan.
You can come up with several correct arguments based on combinatorics but I'm going to use the general case which we will apply for the mulligan and later turns as well, which uses the Hypergeometric distribution. This gives the probability of drawing marbles from an urn of different colours when you don't replace them.
Background reading: https://en.wikipedia.org/wiki/Hypergeometric_distribution
There are 2 cases. You go first and see 3 cards, or go second and see 4 cards and get the coin as well.
What is the probability of seeing M minions when you see 3 cards? (Going first)?
Let's use a Hypergeometric distribution calculator, there's one here: http://stattrek.com/online-calculator/hypergeometric.aspx
The population size is 30 (number of cards in the deck)
There are 8 "successes" in the deck, i.e. minions.
The sample size is 3 (number of cards you see).
So, we use those parameters and get the probability for seeing M = 0, 1, 2 or 3 cards. I will use H(30, 8, 3, M) to denote the parameters used for the distribution.
p(M=0) = H(30, 8, 3, 0) = 0.379310344827586
p(M=1) = H(30, 8, 3, 1) = 0.455172413793104
p(M=2) = H(30, 8, 3, 2) = 0.151724137931034
p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759
So the most likely result is seeing 1 minion, about 45%, then 0 minions is next most likely (about 38%).
Going 2nd, similar, but we use H(30, 8, 4, M) since we see 4 cards and M goes from 0 to 4:
p(M=0) = H(30, 8, 4, 0) = 0.266922094508301
p(M=1) = H(30, 8, 4, 1) = 0.449553001277139
p(M=2) = H(30, 8, 4, 2) = 0.236015325670498
p(M=3) = H(30, 8, 4, 3) = 0.0449553001277139
p(M=4) = H(30, 8, 4, 4) = 0.00255427841634738
So again, seeing 1 minion is most likely (45% again) but seeing 0 and 2 is roughly the same odds (27%, 24%).
The calculator also shows you p(M < x), p(M <= x) etc. which can be useful as well.
Next installment I will go into how the mulligan affects the odds if you hard mulligan for non-minions (i.e. throw away all minions).
That assumption is not valid if you always keep Barnes and no other minion, I will probably go over that as well.
==================================
If you respond to a specific question, it helps to link the post where the original question was asked.
You can also ask other questions and I will decide if I can be arsed answering them ;) Hopefully the answers I give will be explained well enough to work out how to do things on your own for similar scenarios as well.
I'm ok with being sidetracked about non-Hearthstone maths questions as well. I also know about the maths involved in making video games so we could go there also.
So, you cheated Mungo! You didn't answer the question, you just showed how to find the answer for pre-mulligan number of minions seen and you also used a calculator rather than multiplying out all the binomial coefficients (number of ways of choosing N objects from a set of M in total).
Yes, I cheat if there is an online calculator to do the work for me.
Now we get to the mulligan stage. This involves conditional probability https://en.wikipedia.org/wiki/Conditional_probability
That looks scary but there is an easy way to calculate conditional probabilities by drawing a probability tree diagram
https://www.mathsisfun.com/data/probability-tree-diagrams.html
I will go into detail about the case when going first here then probably hand-wave and leave the going 2nd case as an exercise ;)
This is stage 2 in the calculation, we will find the probability of having 0, 1, 2 or 3 minions in your hand AFTER you mulligan, ASSUMING that you throw away every minion you see. The final stage is continuing this for the first 5 draws of the game.
We already worked out the odds of having 0, 1, 2 or 3 minions pre-mulligan.
If you have 0 minions, you don't mulligan anything. So the chance of having 0 minions remains the same after the mulligan if you had 0 to start with.
I
f you have 1 minion before the mulligan, you throw it away, and get back 1 additional card. This cannot include the card you just threw away, so you are drawing 1 card from a deck with 26 cards remaining in it (mulligan card is set aside). 7 of these 26 are minions.EDIT: That is bobbins. You still pick from 27 cards remaining - the ones still in the deck - and the set aside card has no effect, apart from knowing it is a minion reduces the number of minions left in the 27 to 7.
Chances to have 0 or 1 minions in hand after mulligan given you had 1 minion pre-mulligan:
Here, p(A | B) means the probability A occurs given B has already occured
p(M=0 | (M=1 pre-mulligan)) = H(27, 7, 1, 0) = 0.740740740740741
p(M=1 | (M=1 pre-mulligan)) = H(27, 7, 1, 1) = 0.259259259259259
These 2 probabilities add up to 1, which is good, since one of those events is guaranteed to happen.
If you had 2 minions before the mulligan and throw both away, you are drawing 2 cards from a pool of 25 cards (2 mulligan cards are set aside). 6 of these 25 are minions.If you had 2 minions before the mulligan and throw both away, you are drawing 2 cards from a pool of 27 cards. 6 of these 27 are minions.
Chances to have 0, 1 or 2 minions after the mulligan:
p(M=0 | (M=2 pre-mulligan)) = H(27, 6, 2, 0) = 0.598290598290598
p(M=1 | (M=2 pre-mulligan)) = H(27, 6, 2, 1) = 0.358974358974359
p(M=2 | (M=2 pre-mulligan)) = H(27, 6, 2, 2) = 0.0427350427350428
Again, these add up to 1.
If you had 3 minions before the mulligan and throw all 3 away, you are drawing 3 cards from a pool of 24 cards (3 mulligan cards are set aside). 5 of these 24 are minions.If you had 3 minions before the mulligan and throw all 3 away, you are drawing 3 cards from a pool of 27 cards. 5 of these 27 are minions.
Chances to have 0, 1, 2 or 3 minions after the mulligan:
p(M=0 | (M=3 pre-mulligan)) = H(27, 5, 3, 0) = 0.526495726495726
p(M=1 | (M=3 pre-mulligan)) = H(27, 5, 3, 1) = 0.394871794871795
p(M=2 | (M=3 pre-mulligan)) = H(27, 5, 3, 2) = 0.0752136752136752
P(M=3 | (M=3 pre-mulligan)) = H(27, 5, 3, 3) = 0.00341880341880342
I trust those add up to 1 also, near as dammit.
But what does this mean Mungo?
Now we can calculate the chances of having 0, 1, 2 or 3 minions after the mulligan. There are 4 ways to have 0 minions, these are
I had 0 minions pre-mulligan. The probability of this was in post #1, and was 0.379310344827586
I had 1 minion pre-mulligan. The probability of this was in post #1, and was 0.455172413793104. Then I mulliganed the minion and I got 0 back with probability p(M=0 | (M=1 pre-mulligan)) = H(27, 7, 1, 0) = 0.740740740740741. These both have to occur one after the other, so we multiply the probabilities giving 0.455172413793104 * 0.740740740740741= 0.337164750957854932822477650064
I had 2 minions pre-mulligan. The probability of this was in post #1, and was 0.151724137931034. I mulligan them both and get 0 back with probability p(M=0 | (M=2 pre-mulligan)) = H(27, 6, 2, 0) = 0.598290598290598. Again, we multiply these to give the probability of having 0 minions after mulliganning 2, 0.151724137931034 * 0.598290598290598 = 0.090775125257883545652814618332
I had 3 minions pre-mulligan. The probability of this was in post #1, and was 0.0137931034482759. I mulligan all 3 and get 0 back with probability p(M=0 | (M=3 pre-mulligan)) = H(27, 5, 3, 0) = 0.526495726495726. Chances of both things happening is 0.0137931034482759 * 0.526495726495726 = 0.0072620100206307234188034188034
Those are the only ways to have 0 minions after the mulligan. These are independent events so we can add the probabilities together to get the final answer
p(M=0 after the mulligan stage) = 0.379310344827586 + 0.337164750957854932822477650064 + 0.090775125257883545652814618332 + 0.0072620100206307234188034188034 = 0.8145122310639552018940956871994
So you are around 81% likely to have 0 minions after throwing all minions away if you are going first.
The cases for 1, 2 or 3 minions are calculated in the same way, I'm having a break for a bit now though, peace ;)
EDIT: This post updated following realising my mistake about the mulligan number of cards drawn from.
I'll finish off the going first case now, after the mulligan.
Ways to get 1 minion after the mulligan:
I had 1 minion pre-mulligan (p(M=1) = H(30, 8, 3, 1) = 0.455172413793104) and have 1 afterwards i.e. p(M=1 | (M=1 pre-mulligan)) = H(26, 7, 1, 1) = 0.269230769230769. Multiplying these gives 0.455172413793104 * 0.269230769230769 = 0.122546419098143279575596816976
I had 2 minions pre-mulligan (p(M=2) = H(30, 8, 4, 2) = 0.236015325670498) and have 1 afterwards i.e. p(M=1 | (M=2 pre-mulligan)) = H(25, 6, 2, 1) = 0.38. Multiplying, 0.236015325670498 * 0.38 = 0.08968582375478924
I had 3 minions pre-mulligan (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and have 1 afterwards i.e. p(M=1 | (M=3 pre-mulligan)) = H(24, 5, 3, 1) = 0.422430830039526. Multiplyiing, 0.0137931034482759 * 0.422430830039526 = 0.0058266321384762367128935532234
Add these up to get the chance of having 1 minion after hard-mulliganning for non-minions gives
0.122546419098143279575596816976 + 0.08968582375478924 + 0.0058266321384762367128935532234 = 0.2180588749914087562884903701994
So the probability to have a single minion after mulligan is about 22%
Ways to get 2 minions after the mulligan:
I had 2 minions before the mulligan (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034) and have 2 after i.e. p(M=2 | (M=2 pre-mulligan)) = H(25, 6, 2, 2) = 0.05. Multiplying, 0.151724137931034 * 0.05 = 0.0075862068965517
I had 3 minions before the mulligan (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and have 2 after i.e. p(M=2 | (M=3 pre-mulligan)) = H(24, 5, 3, 2) = 0.0938735177865613. Multiplying gives 0.0137931034482759 * 0.0938735177865613 = 0.00129480714188360769865067466267
So the chances of having 2 minions after mulligan are
0.0075862068965517 + 0.00129480714188360769865067466267 = 0.00888101403843530769865067466267
So less than 1% for this to occur.
There is only 1 way to have 3 minions if you hard mulligan for non-minions. This is when you have 3 to start with (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759), throw them all away, and get 3 back P(M=3 | (M=3 pre-mulligan)) = H(24, 5, 3, 3) = 0.00494071146245059.
So the probability is 0.0137931034482759 * 0.00494071146245059 = 6.8147744309663497751124437781e-5. That number is tiny, scientific notation is being used (6.81e-5 i.e. 6.81 * 10 ^ -5), way less than 1%.
Summarising, after the mulligan:
p(M=0 after the mulligan stage) = 0.8050226145668424910044699678134
p(M=1 after the mulligan stage) = 0.2180588749914087562884903701994
p(M=2 after the mulligan stage) = 0.00888101403843530769865067466267
p(M=3 after the mulligan stage) = 6.8147744309663497751124437781e-5
Unfortunately, adding these up gives a number greater than 1, 1.0320306513409962184893621371133
But I believe that is caused by floating point inaccuracies in the calculation, which is SUPER ANNOYING. I think my reasoning is correct, if anyone can see a mistake let me know.
We'll blame it on inaccuracy for now. (Good brushing under the carpet there).
You'd calculate the going 2nd case in the same way.
Final episode for this question will entail using those numbers to calculate how many minions you are likely to have received after 5 more draws. That depends only on how many minions you have following the mulligan, since the set aside cards now go back into the deck.
There may be a bonus discussion about how keeping Barnes in the mulligan affects the results (hint: It adds another branch at the root of the probability tree, splitting the cases when we had Barnes from when we did not have Barnes - again you can use Hypergeometric distribution to calculate that).
EDIT: I spotted my mistake! It's always good to own up to mistakes as soon as you find them folks.
The number of cards in the mulligan calculation is wrong. You always pick from 27 cards (the ones you didn't see). Having cards set aside makes no difference. Oops. It just afffects how many minions are remaining of the 27... will edit my posts...
Always nice to see something more than just salt threads- keep this up please it's very interesting
I have found my mistake (see edit) and will update my post.
That's why adding up the numbers at the end is a good sanity check ;)
About to edit the posts...
I always keep the hypergeometric calculator at Stat Trek handy when playing a deck where I really need certain cards quickly.
I double checked my working now I corrected it, and drew a tree diagram on a piece of paper ;)
Now the case for having 1 minion after the mulligan, this can happen as follows:
You had 1 minion originally (p(M=1) = H(30, 8, 3, 1) = 0.455172413793104). You then get 1 back from the mulligan, which is p(M=1 | (M=1 pre-mulligan)) = H(27, 7, 1, 1) = 0.259259259259259. Multiplying these gives 0.455172413793104 * 0.259259259259259 = 0.118007662835249067177522349936
You had 2 minions originally (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034). You then get back 1 from the mulligan, which is p(M=1 | (M=2 pre-mulligan)) = H(27, 6, 2, 1) = 0.358974358974359. Multiplying these gives 0.151724137931034 * 0.358974358974359 = 0.054465075154730157736516357206
You had 3 minions originally (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759). You then get 1 back from the mulligan, which is p(M=1 | (M=3 pre-mulligan)) = H(27, 5, 3, 1) = 0.394871794871795. Multiplying these gives 0.0137931034482759 * 0.394871794871795 = 0.0054465075154730494606542882405
Adding these possibilities up gives the chance to have 1 minion after the mulligan as
0.118007662835249067177522349936 + 0.054465075154730157736516357206 + 0.0054465075154730494606542882405 = 0.1779192455054522743746929953825
So you have about an 18% chance to have 1 minion when hard mulliganning for non-minions when going first.
Having 2 minions following the mulligan can happen in 2 ways:
You had 2 minions before the mulligan (p(M=2) = H(30, 8, 3, 2) = 0.151724137931034) and have 2 after the mulligan, which is p(M=2 | (M=2 pre-mulligan)) = H(27, 6, 2, 2) = 0.0427350427350428. Multiplying gives 0.151724137931034 * 0.0427350427350428 = 0.0064839375184202662658414382552
You had 3 minions before the mulligan (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and have 2 afterwards, which is p(M=2 | (M=3 pre-mulligan)) = H(27, 5, 3, 2) = 0.0752136752136752. Multiplying gives 0.0137931034482759 * 0.0752136752136752 = 0.00103743000294724699086354258768
Adding those up,
0.0064839375184202662658414382552 + 0.00103743000294724699086354258768 = 0.00752136752136751325670498084288
So you have about 0.8% chance to have 2 minions when going first if you hard mulligan for non-minions.
Finally, there is only one way to have 3 minions after the mulligan. This is when you have 3 to begin with (p(M=3) = H(30, 8, 3, 3) = 0.0137931034482759) and get back 3 after the mulligan, which is p(M=3 | (M=3 pre-mulligan)) = H(27, 5, 3, 3) = 0.00341880341880342. Multiplying these tiny numbers together gives 0.0137931034482759 * 0.00341880341880342 = 4.7155909224874888299440023578e-5 which is so small Windows Calculator gives it in scientific notation. The probability is about 0.000047, or about 0.0047%.
So to summarise, if you go first and hard mulligan to have no minions in your hand, the probabilities of having 0, 1, 2 or 3 minions after the mulligan is
0 minions: 0.8145122310639552018940956871994 (81%)
1 minion: 0.1779192455054522743746929953825 (18%)
2 minions: 0.00752136752136751325670498084288 (0.8%)
3 minions: about 0.000047 or in scientific notation 4.7155909224874888299440023578e-5 (0.0047%)
Adding these numbers up (which is how I caught my error previously), always a good check you did done good my son, we get
p(0, 1 2 or 3 minions) = 0.8145122310639552018940956871994 + 0.1779192455054522743746929953825 + 0.00752136752136751325670498084288 + 4.7155909224874888299440023578e-5 = 0.99999999999999986441379310344836
i.e. rounding errors means it really adds to 1 (since it is certain to have 0, 1, 2 or 3 minions). I caught my mistake because my previous calculation had the probability adding up to more than 1. Any probability adding to more than 1 should raise major alarm bells (i.e. you got the sums wrong). If it adds to as near as dammit it 1 (which the number above is), it's due to rounding errors by the calculator and because the probability reported by the online calculator being limited to however many significant figures.
Once you have those numbers it's then fairly straightforward to calculate the probability of seeing a certain number of minions after 5 more draws. Mulligan considerations are the most complicated thing to calculate, and we just did that.
I will show how in a later post, then discuss how keeping Barnes affects the probabilities.
I was going to continue, but it seems the Hypergeometric calculator site is down, I hope I haven't overloaded it ;)
Awesome work there mungo ! Plus i think i understand it :P
Do you think the numbers would be very different if the player goes second, or if he goes 1st half the time and second the other half of games?
I know that in my 30 games, i probably went half and half (1st and second), and on a few ocassions i kept a minion (like Barnes), but to me it's striking that the probability in your numbers, to have 1 minion after mulligan is 18% , and i practically got 33 minions on 30 games after the mulligan! (so i almost always had one, a few times 0, afew times more than one).
Not sure if this is correct. I am pretty sure that when you muligan cards away they go back into the pool of cards that can be draw in the second muligan draw.
I've definitely had at least one case where I have initially draw 2 bonemares. Mulliganed the cards away then got them back again.
Of course I might just be reading the maths wrong. I still go cross-eyed at the sight of mathematical notations despite having a strong maths grounding.
Now I am curious. I definitely remember the double bonemare muligan... But memory can be fickle. I will have to read up on hearthstone draw mechanics.
Bravo, good thread. I love me a bit of maths in the morning.
"Hello. Would you like to destroy some evil today?"
One small terminology correction - the events are not independent, they are disjoint.
I am curious to see your math on that, cause 18% to 81% is a huge difference.
I think I got a good question for this thread. What is the maximum amount of gold you can earn by quests on a week, and what is the probability of acheiveing it?
Noxious Gold