Probabilities can sum to one and still describe the wrong experiment
AI assistance: An AI agent ran the experiments and helped draft this article. Take ten distinct objects: seven marked and three unmarked. Choose six uniformly, It is three. There are only three unmarked objects available. Even taking all The clearest framing from our discussion was a pigeonhole argu

AI assistance: An AI agent ran the experiments and helped draft this article. Take ten distinct objects: seven marked and three unmarked. Choose six uniformly, It is three. There are only three unmarked objects available. Even taking all The clearest framing from our discussion was a pigeonhole argument: the size That small constraint matters. A binomial model can produce probabilities that 7.047% probability to outcomes that cannot happen. The support is the set of values the marked count can take with positive The upper bound is six: there are only six places in the draw. Having seven More generally, use SciPy's parameter names: M objects in total, n marked N objects drawn. The count k must be an integer satisfying: max(0, N - (M - n)) <= k <= min(n, N) The lower bound says that any places left after using all the unmarked objects This is the support used by SciPy's hypergeometric distribution. There are C(10, 6) = 210 unordered sets of six objects. Here C(a, b) means the b objects from a. Each set was enumerated once by Marked count Sets of six Exact probability Percentage 2 0 0 0% 3 35 1/6 16.6667% 4 105 1/2 50% 5 63 3/10 30% 6 7 1/30 3.3333% 7 0 0 0% The four nonzero counts add to 210. Their exact fractions add to one. A second calculation used the combination formula independently. For four C(7, 4) * C(3, 2) / C(10, 6) = 35 * 3 / 210 = 1/2 The general expression is C(n, k) * C(M - n, N - k) / C(M, N) for possible The control was Binomial(6, 0.7): six independent trials, each with a fixed 70% SciPy's binomial documentation. Sampling with replacement would fit that control: after every draw, the object Without replacement, the next probability changes with what has already been All 210 unordered six-object draws from a synthetic population of seven marked The binomial control gives probabilities of 0.0729%, 1.0206% and 5.9535% for Both distributions sum to one. Both have expected marked count 4.2. Those two Normalization is necessary, but not sufficient. The possible outcomes must fit This deliberately uses a large sampling fraction—six objects out of ten—to make Five explicit checks used marked counts 2, 3, 6, 7 and 3.5. SciPy returned zero Trying to draw eleven objects from a population of ten is different: the NaN in that check, and when The source makes this distinction explicit. Its parameter validation checks SciPy 1.18.1 implementation The exhaustive validation also covered every integer population size from one 1,784 . Each case used 3.33e-16, below the predefined absolute tolerance of 1e-12. One first-run check was too strict: it required floating-point equality to one 0.9999999999999997. Applying the same predefined These are complete counts for small synthetic cases. They do not establish The useful check comes before the arithmetic: write down which outcomes the experiment permits. A total probability of one cannot repair the wrong sampling assumptions.
Key Takeaways
- •AI assistance: An AI agent ran the experiments and helped draft this article. Take ten distinct objects: seven marked and three unmarked
- •This story was reported by Dev.to, covering developments in the dev space.
- •AI advancements continue to reshape industries — read the full article on Dev.to for complete coverage.
📖 Continue reading the full article:
Read Full Article on Dev.to →


