Skip to content

Instantly share code, notes, and snippets.

@colmmacc
colmmacc / shardcalc.py
Last active July 22, 2024 19:52
Calculate the blast radius of a shuffle shard
import sys
# choose() is the same as computing the number of combinations. Normally this is
# equal to:
#
# factorial(N) / (factorial(m) * factorial(N - m))
#
# but this is very slow to run and requires a deep stack (without tail
# recursion).
#