5H4N3 /// Hand Odds
Tool file Hypergeometric

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.

Exact math, no simulation Neuroscape CR 103.5 Shareable links
SEC 01

Deck and hand

// setup
SEC 02

Cards and combos

// targets

Each 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.

SEC 03

Opening hand

// no mulligan
Chance it's there
—
Enter your deck and the cards you want.
Odds
—
Roughly one hand in this many.
Chance you miss
—
How often you'll be reaching for the mulligan.
After best mulligan
—
Keep what you need, send back the rest.
SEC 04

Mulligan, before you look

// one shot, bottom & redraw

Your 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 backChanceBarvs. no mulligan

SEC 05

Mulligan, hand in front of you

// live decision

You'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 backBest keepChasingChanceBar

SEC 06

How the math works

// show your work

One 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

P(exactly k) = C(K, k) · C(N − K, n − k) / C(N, n)

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

P(c₁, …, cₘ) = C(K₁, c₁) · C(K₂, c₂) · … · C(R, n − Σc) / C(N, n)

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:

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

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.