4

I want to pick up Vintage Dredge in the card game Magic - The Gathering and I want to know the probability of starting with Bazaar of Baghdad in your opening hand.

We can assume that this is a 60-card deck with 4 Bazaar of Baghdad and 4 Serum Powder, and that we will mulligan aggressively for the Bazaar. Then we will perform the following procedure: we start by drawing 7 cards. After each draw, if the hand contains a Bazaar of Baghdad we are done. Otherwise, if the hand contains a Serum Powder, we use Serum Powder's ability to exile the hand and draw the same number of cards. Otherwise, we mulligan normally, drawing 1 fewer card. If we get to 1 cards without drawing a Bazaar we have failed. What is the probability of finding a Bazaar this way?

  • 2
    This is not a duplicate. It is broader than the linked question because it allows for Serum Powder and mulligans. – murgatroid99 Sep 20 '18 at 17:23
  • 2
    @murgatroid99 I disagree. This question could have been answered using that question's answer, with different variations of hypergeometric distribution calculations. If anything, the linked question is more broad because it provides the process for getting to the answer. – SocioMatt Sep 20 '18 at 18:02
  • 1
    That's not the issue here. The linked question specifically asks about the probability of seeing a specific card in an opening hand of 7 cards. And you can't actually use a just the methods described in that answer to answer this question because of how Serum Powder impacts the deck size and the way that impacts the probability distribution of different sequences. – murgatroid99 Sep 20 '18 at 18:12
  • 2
    OK, I'm just going to edit the information from the answer into the question, so that we have a concrete scenario that we can calculate the probability of – murgatroid99 Sep 20 '18 at 19:53
9

I approached this question numerically and drew one billion (1,000,000,000) sample hands. My assumptions: The deck contains 60 cards, 4 of which are Bazaar of Baghdad and 4 are Serum Powder. No further assumptions regarding the deck building are required.

Then I draw the opening seven cards. If it contains at least 1 Bazaar, the hand is considered a hit. If I draw a Serum Powder, the hand is removed from the game and I draw the exact same number again. If I miss on both, Bazaar and Powder, than I take a mulligan (e.q. reshuffling the deck and drawing one card less).

This continues until I reach the point where I reshuffle a one-card-hand, since it was considered a miss and start the game with a zero-card-hand. In this situation I consider the somewhat new mulligan scry rule, which let's you scry one after mulligan. So even if I start with zero cards in hand, there is a chance that a Bazaar is in the top 2 cards of my library and (thanks to the scry) can be found within one draw step. That probability is also included in my end results.

My findings:

  • Probability of starting with a 7 card hand: 54.2 %

  • Probability of starting with a 6 card hand: 22.12 %

  • Probability of starting with a 5 card hand: 9.91 %

  • Probability of starting with a 4 card hand: 4.79 %

  • Probability of starting with a 3 card hand: 2.43 %

  • Probability of starting with a 2 card hand: 1.23 %

  • Probability of starting with a 1 card hand: 0.52 %

  • Probability of starting with a 0 card hand: 4.8 % (this means no Bazaar of Baghdad was found)

  • Probability of starting with a 0 card hand and Bazar on top (including scry 1): 0.9 %

  • Probability of complete failure: 3.9 %

  • Probability to hit: 95.2015011 %

  • Probability to hit with scry: 96.1029072 %

For the curious people, here is a plot how those probabilities converged: x-axis shows the amount of sample hands, y-axis gives the probability to have a Bazaar in hand

  • 3
    @NeilMeyer You can, it's just normally better to have any 1 card rather than none. Rule 103.4 defines the mulligan process and includes: This process is then repeated until no player takes a mulligan. (Note that if a player’s hand size reaches zero cards, that player must keep that hand.) – Samthere Sep 20 '18 at 14:35
  • 4
    Have you tried repeating this experiment with "Mull to 0 before accepting the scry" replaced by "Mull to 1 before accepting the scry"? Intuitively speaking, if your hand is 1 card and it's not Bazaar then the chances of Bazaar being in the top 2 cards of a 59 card deck should be marginally better than the odds of Bazaar being in the top 2 cards of a 60 card deck. – Kamil Drakari Sep 20 '18 at 15:25
  • 1
    @KamilDrakari That's a valid argument. I will do it – rtime Sep 20 '18 at 15:31
  • 2
    I made a small edit already, but you should really move all of the parameters of the scenario that you're testing into the question (i.e. stop on Bazaar, use Serum Powder if available, mulligan otherwise), because they are part of the description of what information you are asking for. – murgatroid99 Sep 20 '18 at 18:10
  • 2
    I wonder -- suppose that you draw seven, and all four Serum Powders are in hand (and no Bazaar). Is it better to exile all four Serum Powders and draw another seven or to shuffle them in and draw six? – Thom Smith Sep 20 '18 at 19:35
3

In this answer, I consider the question that I believe the asker is most interested in: given optimal mulligan decisions, what is the probability of drawing at least one Bazaar in time to play one on your first turn? This answer accounts for all reasonable mulligan decisions, including scrying, and for the chance of drawing one in your first draw step on the play. This is in accord with the asker's own answer, but not necessarily with the explicit algorithm that was later added to the question.

(This answer does not address questions like whether you should exile important cards other than Bazaar using Serum Powder. It also assumes that the opponent does not interfere with your first draw.)

When you draw a hand, there are four parameters to consider:

  • The number of cards in your library (excluding those exiled by Serum Powder).
  • The number of Serum Powders left in your library.
  • The number of cards you're drawing.
  • Whether you're on the draw (and have a chance of drawing on your first turn).

When you draw a hand, if you hit a Bazaar, you're done. Otherwise, you have up to three choices:

  • Keep the hand and hope to draw Bazaar on your first turn. If your current hand size is less than seven, you get to look at two cards; otherwise, you only see one.
  • Mulligan and try again with a smaller hand size (unless you're already at zero).
  • Exile your hand and try again with the same hand size (only if you've drawn at least one Serum Powder).

Rather than work this out analytically, I wrote a Python script to brute-force it (with a little memoization):

#!/usr/bin/python3

from functools import lru_cache
from scipy.stats import hypergeom

INITIAL_LIBRARY_SIZE = 60
INITIAL_HAND_SIZE = 7
COPIES_OF_BAZAAR = 4
COPIES_OF_SERUM = 4

@lru_cache(None)
def prob(library_size, serums_in_library, hand_size, on_the_draw=False):

    # Probability of drawing at least one Bazaar
    prob_bazaar = 1 - hypergeom.pmf(0, library_size, COPIES_OF_BAZAAR, hand_size)

    if hand_size > 0:
        # Probability of success on a mulligan
        prob_if_mulligan = prob(library_size, serums_in_library, hand_size-1, on_the_draw)
    else:
        prob_if_mulligan = 0

    if on_the_draw:
        # Probability of drawing Bazaar on the first draw step given that we haven't drawn a Bazaar yet.
        # Accounts for seeing an extra card as a result of the Vancouver mulligan.
        prob_if_keep = 1 - hypergeom.pmf(0, library_size-hand_size, COPIES_OF_BAZAAR, 2 if hand_size < INITIAL_HAND_SIZE else 1)
    else:
        prob_if_keep = 0

    # Split into cases depending on the number of Serum Powders drawn.
    prob_if_no_bazaar = sum(
        # Probability of drawing exactly `serums_drawn` copies of Serum Powder.
        hypergeom.pmf(serums_drawn, library_size-COPIES_OF_BAZAAR, serums_in_library, hand_size)

        # Choose the strategy with the best chance of success
        * max(
            # Mulligan, recycling drawn cards.
            prob_if_mulligan,

            # Use Serum Powder. Exile all cards in hand, which may include more than one Serum Powder.
            # If we draw no Serum Powders, ignore this strategy.
            prob(library_size-hand_size, serums_in_library-serums_drawn, hand_size, on_the_draw) if serums_drawn else 0,

            # Keep the hand and hope to draw on the first turn.
            prob_if_keep
        )

        # For each possible number of Serum Powders drawn
        for serums_drawn in range(0, 1 + min(serums_in_library, hand_size))
    )

    return prob_bazaar + (1 - prob_bazaar) * prob_if_no_bazaar

print(
    prob(INITIAL_LIBRARY_SIZE, COPIES_OF_SERUM, INITIAL_HAND_SIZE, False),
    prob(INITIAL_LIBRARY_SIZE, COPIES_OF_SERUM, INITIAL_HAND_SIZE, True),
)

The results I got were:

  • 94.17% if you're on the play.
  • 95.03% if you're on the draw.

These numbers are significantly lower than t.rathjen's. I double-checked the first figure by running a few million simulations, and it seems correct. I suspect that t.rathjen's simulations may have a small bug. If I've made a mistake in the script, I hope that someone will point it out. I haven't tried it out yet with high-precision arithmetic.

I played around with the script to see if you should ever do a regular mulligan if you draw Serum Powder, and the answer seems to be no. Even if you draw all of your Serum Powders at once, it's better to exile all of them for a single free mulligan than keep going with a smaller hand size but Serum Powders in the deck. That is, the algorithm described in the question does seem to be optimal: you should always use Serum Powder when possible and always mulligan down to one card (but not zero) or until you find a Bazaar.

  • 1
    You seem to be computing a different thing than what the question and the other answer describe. The other answer specifies a particular procedure, but you seem to be accounting for the fact that sometimes exiling multiple serum visions is not the best move, and sometimes doing something else. I think that's what that max call is doing. Overall, the intention behind some parts of the code is not clear, particularly the uses of the hypergeom API and the big calculation in the return statement, so it's hard to tell whether those are correct. – murgatroid99 Sep 20 '18 at 22:32
  • More generally, I think this answer would benefit from a textual description of the algorithm and probability calculations that you are doing in this program. – murgatroid99 Sep 20 '18 at 22:49
  • I've commented the code. This procedure may differ from the other answer's procedure if that procedure is suboptimal. The hypergeom.pmf method computes the probability mass function of a hypergeometric distribution at the given value with the given parameters. SciPy API documentation is available here: docs.scipy.org/doc/scipy/reference/tutorial/stats.html. I would be happy to provide more detailed explanation of specific parts of the algorithm. – Thom Smith Sep 21 '18 at 3:23
  • Thank you for adding the comments. It looks correct to me, so I don't know why you would be getting different numbers. – murgatroid99 Sep 21 '18 at 5:14
  • Realize this comment is late to the party, but the assumption in this answer, is that the play is optimal. How far does the OP's mulligan procedure differ from this one? How far from optimal is his simple procedure, vs. this potentially very difficult to memorize procedure? – John Feb 27 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.