Box ↔ Item Probability Explorer

Items (one per box)

    Boxes

    Breakdown

    Notes

    Computations are made 100% locally.

    Exact odds are calculated from all valid combinations. On Auto Computation mode If there is more than 9 items, it uses a quicker estimate instead and shows progress as it works.

    What is a permutation?

    In this app a permutation is one possible way to place the set of items into the boxes so that each box has exactly one item and every item appears once. For example, if you have three items A, B and C and three boxes, one permutation is:

    Another permutation is Box 1 → B, Box 2 → C, Box 3 → A. The app checks every permutation that doesn't contradict your hints and counts how many times each item appears in each box across all valid permutations. Those counts are converted to probabilities.

    Why permutations get expensive

    The number of permutations grows very fast: for n items there are n! (n factorial) permutations. Example sizes:

    Because of that exponential growth, the page uses exact enumeration for small n and switches to sampling for larger n to keep the UI responsive. The status line will show progress while sampling.

    If you found this helpful consider giving me a ⭐ on GitHub!