Saturday, August 22, 2026

Settings and Deck Table Updates

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.

Delete buttons for cards and hands

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.


Backend performance and reliability improvements

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.

updated settings panel

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.


Accessibility improvements

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.

new focus ring on the draw input box

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.


Friday, February 6, 2026

Quickly calculate probabilities

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}$$ 


Monday, February 12, 2024

Import your decklist

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.


Deck-u-lator recognizes any line that begins with a number and a space as a card in your deck.  Blank lines and lines that do not begin with a number and a space are ignored.  

WARNING: If there are multiple lines with the same card name, their counts are combined.  This means that if your decklist includes a sideboard, those cards and counts will be included.  If you do not want this, then delete the sideboard lines, or adjust the counts appropriately.


Saturday, February 10, 2024

Better support for longer calculations

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.


This required re-factoring the Deck-u-lator engine to return partial results and to continue a partial calculation.  The new engine is five times faster.

From the image above, you can also see that these changes are highlighted by switching to dark mode.

Saturday, January 20, 2024

New math formula for multiple hand combinations

The latest version of Deck-u-lator shows new math formulas for advanced calculations with two or three hands.  Previously multi-hand calculations simply confirmed how many alternate hand combinations you were calculating.  This is still the case for combinations with four or more hands.

To calculate your chances to draw alternate hands, Deck-u-lator performs the multivariate hypergeometric calculation for each hand and adds those probabilities together.  What about draws that contain all the cards needed for two different hands?  These get double counted by just summing probabilities for both hands.  So we calculate the probabilities for all combinations of two hands and subtract those.  This process continues, alternately adding probabilities for combinations of three hands, subtracting probabilities for combinations of four hands and so on.

The new formula gives a glimpse into this process.  Enjoy!

$$ \frac{ H_{0} + H_{1} - H_{0} \cap H_{1} }{ \binom{ 52 }{ 2 } } = 95.0\% $$