David asked for a basic mulligan calculation to compute \(1-(1-P)^N\) and that is now available on Deck-u-lator. The settings panel has three mulligan options:
- No Mulligan
- Redraw multiple times (you specify 1-10)
- One blind redraw
hypergeometric card combination calculator
David asked for a basic mulligan calculation to compute \(1-(1-P)^N\) and that is now available on Deck-u-lator. The settings panel has three mulligan options:
Since the decklist import feature back in February 2024, the front end of Deck-u-lator has been rebuilt from the ground up. Removing cards and hands is now driven directly by switches in the settings panel, so the table only shows the controls that apply to what you're building.
Settings also got smarter about remembering themselves. Options that used to need re-entering now persist. A decklist pasted into the settings panel is remembered too, so the cards and counts come back the next time you open Deck-u-lator. And the page itself now opens in whichever theme, dark or light, your operating system already asked for. Settings are stored in site data in the browser, so clearing the browser cookies and other site data will reset your settings.
Deck-u-lator's calculation engine has been reworked for speed. Probability calculations run on faster internal data structures, so larger decks and combinations return results quicker. On a benchmark combination, the same calculation now finishes about 2.7 times faster than it did in 2024.
If you just want a quick answer and don't need the chart or formula, the settings panel now lets you turn them off. Lowering the graph and formula limits there skips that extra work, so you get your result even faster. Increasing the size of calculation steps means fewer breaks in long calculations.
Since the last update in February 2024, Deck-u-lator has had a round of accessibility work aimed at making the calculator usable with a screen reader or a keyboard alone, not just a mouse. Every input in the card table is now labeled by its row and column (hand columns only get numbers once there's more than one hand to tell apart), the settings button and footer link have proper ARIA labels, and every slider announces itself the same way. A skip link and a real main landmark, with a sensible heading outline, now sit on every page, and every interactive control shows a visible focus ring so you can always tell where you are.
The calculation itself got the same treatment. Results and errors now announce themselves to assistive technology through live regions instead of just appearing silently on screen, the scrolling card table has its own keyboard stop so arrow keys can reach rows that used to be untabbable, and the results chart now comes with a generated text summary, since the charting library underneath it has no keyboard handle of its own. On top of all that, every page we route now runs through an HTML validator as part of CI, so markup regressions get caught before they ship.
None of this changes what the calculator does, only who can comfortably use it. Thanks to everyone who sent feedback, that's how most of this list got written.
A common question asked about Deck-u-lator is why does it take so long to calculate my combination.
Time to calculate binomial coefficient
The fundamental calculation performed is the binomial coefficient. Python can perform four million binomials coefficients per second using math.comb() function.
Deck-u-lator uses Python functools.cache to do these even faster, only calculating the result for each set of inputs once and remembering that result.
Time to calculte multivariate hypergeometric
When you draw exactly as many cards as are in your combination, Deck-u-lator calculates the multivariate hypergeomatric once, with one binomial coefficient for each card in the combination (C) and one for the deck. For a combination with 4 cards, binomial coefficient is calculated 5 times.
Time to draw extra cards
When you draw more cards than your combination, Deck-u-lator calculates the multivariate hypergeometric for each different way to draw those extra cards. The number of different ways to draw the extra cards is roughly the product of the number of cards C of each type in your deck. In a 60 card deck, a three card combination where there are four of each card in your deck will calculate multivariate hypergeometric 64 times (\(4^C\) or \(4^3\))
Time to draw alternate hands
When your combination includes alternate hand columns, Deck-u-lator must calculate every combination of hand columns. For H hand columns, there are \(2^H -1\) combinations to calculate.
Deck-u-lator also uses functools.cache to combine hand columns, making this a bit faster.
Total time to calculate your combination
To estimate the time it will take to complete your calculation, substitute C for the card rows in your combination and H for the hand columns in this formula:
$$ \frac {(2^H - 1) \times (4^C) \times (C + 1) }{4,000,000 } \text{ seconds} $$
A sample calculation with C=5 card rows and H=3 card columns
$$ (2^3 - 1) \times (4^5) \times (5 + 1) / 4,000,000 \text{ seconds} $$
$$ (7) \times (1,024) \times 6 /4,000,000 \text{ seconds} $$
$$ 0.01 \text{ seconds}$$
You can now use Deck-u-lator settings to import your decklist. This can be a faster way to setup your calculation than entering cards one at a time. Settings are accessible by clicking the gear icon at the top right of the screen.
With the latest upgrade, Deck-u-lator can calulate combinations including many more hands. Mark had been trying to calculate larger combinations than could be finished within the Google App Engine limit of 60 seconds. Now these longer calculations will show a progress bar with the amount of work that has been completed.