Opening Hand
Odds
How likely is it that your opening hand has the cards you need, and how much does the mulligan help? Exact probabilities, preset for Neuroscape's 5-card hand and bottom-and-redraw mulligan. Change the numbers for any card game.
Deck and hand
// setupCards and combos
// targetsEach combo row is one hand you'd be happy with. The number under a card is how many copies that combo needs (0 = not part of it). You hit if any one combo is fully in hand. Max is optional and caps a card no matter which combo; leave it blank for no cap.
Opening hand
// no mulliganCombo by combo each on its own
| Combo | Needs | Opening hand | After mulligan, chasing only this | Bar |
|---|
Mulligan, before you look
// one shot, bottom & redrawYour overall chance of ending with the cards you need if, on a miss, you keep the copies you already have and send back up to this many other cards.
| Willing to send back | Chance | Bar | vs. no mulligan |
|---|
Mulligan, hand in front of you
// live decisionYou've drawn. Enter how many copies of each card are actually in your hand, and see what sending cards back does. Each row shows the best cards to keep for that many sent back.
| Send back | Best keep | Chasing | Chance | Bar |
|---|
How the math works
// show your workOne card
Drawing cards from a shuffled deck is sampling without replacement, which is what the hypergeometric distribution describes. With N cards in the deck, K copies of the card you want, and n cards drawn, the chance of seeing exactly k copies is
C(a, b) is "a choose b", the number of ways to pick b items from a. The numerator counts hands with exactly k copies (k of the wanted card, n − k of everything else); the denominator counts every possible hand. "At least k" is the sum of the exact terms from k upward.
Worked example
Neuroscape: 50-card cyberdeck, four copies of a card, 5-card hand. Hands with none of it: C(46, 5) = 1,370,754. All hands: C(50, 5) = 2,118,760. So the chance of zero copies is 64.70%, and the chance of at least one is 35.30%.
Several cards at once
Wanting card A and card B in the same hand is the multivariate hypergeometric distribution. A hand with c₁ copies of the first card, c₂ of the second, and so on, has probability
where R is the number of cards that aren't on any line. The calculator adds up every combination of counts in which some combo has all of its needs met and no card is over its Max. Hands can't contain more copies than you run, and the lines are treated as distinct cards, so one card can't count toward two lines.
Either combo will do
With two or more combos the question becomes "A or B". Hands that satisfy both are counted once, never twice, because the sum runs over distinct count vectors and simply asks whether at least one combo is complete. You can check it by hand: P(A or B) = P(A) + P(B) − P(A and B). For Intern + Trust Fund Baby or Intern + Seeker Drones, all 4-ofs in a 50-card deck: 10.76% + 10.76% − 2.67% = 18.85%, which is what the calculator reports. Each hand is counted once, so every term stays positive and nothing is lost to cancellation.
The mulligan
Neuroscape's rule (Comprehensive Rules 103.5b): once per game, after drawing your five, you may put any number of cards from your hand on the bottom of your cyberdeck, then draw that many from the top. Two things follow from that:
- The cards you send back go under the deck. You won't see them again during the mulligan, so each replacement is drawn from the N − 5 cards that were never in your hand, and every copy you didn't draw is still in there.
- You pick which cards to keep. If you already hold a copy a combo needs, keeping it is never worse than redrawing it. With one combo the calculator keeps the copies that count toward it and sends back everything else: cards not on any line first, then spare copies.
- With several combos, which pieces to keep depends on the hand. Holding Trust Fund Baby and Seeker Drones but no Intern, you should keep just one of them and dig four cards for the Intern (32.0%) rather than keep both and dig three (24.9%). In other spots keeping toward two combos at once is right. So for every hand the calculator tries each set of combos you might chase, keeps the copies that count toward that set, and uses whichever plan has the best chance. For "at least" targets that family contains the best possible decision. If you set a Max, it is a strong heuristic rather than a proven optimum. The "hand in front of you" table shows you the winning keep.
For a hand you're holding, the fix is one more hypergeometric draw: pull X cards from the N − 5 unseen cards, which still hold every copy you didn't draw. Continuing the example, if your five whiffed on a 4-of and you send all five back, you draw 5 from 45 cards with 4 hits: 1 − C(41, 5) / C(45, 5) = 1 − 749,398 / 1,221,759 = 38.66%.
Before you've looked, the calculator walks through every possible opening hand, weights each by its probability, applies the keep-and-redraw rule, and adds it up. In the example: 35.30% of hands have the card already; the other 64.70% get a 38.66% shot at it, for a total of 60.32%. The "willing to send back" table caps how many cards you'd let go, since many players won't ship a decent hand to dig for one piece.
Accuracy
Binomial coefficients are computed as exact integers (JavaScript BigInt) and converted to decimals once. Every probability is a sum of positive terms, so no precision is lost to cancellation; results are good to well over ten significant figures, far beyond the two decimals shown. The engine has been cross-checked against an independent exact brute-force enumeration and against Monte Carlo simulation of the physical shuffle, deal, bottom, and redraw.
Assumptions
- The deck is thoroughly shuffled and nothing manipulates draws (no scry, tutor, or deck-stacking effects).
- "Extra draws" are plain draws off the top after the opening hand and any mulligan. For Neuroscape, remember you can draw up to two per turn, or install RAM instead.
- Each line is a distinct set of cards. Interchangeable cards (say, any cheap blocker) can share one line by adding their copies together.
- Mulligan math requires the unseen part of the deck to cover the redraw (deck size ≥ 2 × hand + extra draws). That holds for every legal Neuroscape deck.
Found a number you think is wrong? Comment on any 5H4N3 video with the link from "Copy link to this setup" and the expected value.