Return zero for valid binomial events outside support; preserve whole count literals
Follow-up to #9: return zero for a valid binomial event outside its support
Yes: exactly five successes in three trials has probability zero. The k<=n
refusal was an unnecessary restriction introduced by #9. This follow-up checks
the probability and count domains first, then returns P=0 for k>n. The early
branch also handles n=0,p=1 without evaluating a negative power. The existing
within-support floating-point formula and probability decoder are unchanged;
this makes no new extreme-tail accuracy claim.
Checking the count domain exposed another instance of the same binding defect:exactly 0 successes in -3 trials answered 0.125, 3.5 trials was read as five
trials, and 3e2 trials as two. A fractional k also supplied its integer prefix.
All binomial branches now consume a complete numeric count token and admit only
a complete nonnegative integer value. Unsupported fractional/scientific counts
are refused; signs are consumed rather than lost. Ordinary commas and outer
parentheses remain delimiters, not part of the integer; internal punctuation
and arithmetic expressions are not evaluated. This changes the five local
statistics implementations (v3 inherits) and adds eight portable test methods.
Combination/permutation and math readers are unchanged.
Actual scoped validation on separately pinned 10.3.1 trees:
- Slim base 0ab769781e33ef169b1a3c2a7f055a83c62dca7d; full base 9f52489c6c26533258dcafa23ad9f1e7e0dfc37c.
- All 31 fetched full statistics/math/control files are byte-identical to slim.
- Each baseline fails 1,206 subtests of the new suite, with no errors: 1,008
outside-support, 15 probability-role, 18 complete signed-count, 63 malformed-count
false yes, plus 30 decorated/expression false yes and 72 punctuation cases
(including outside-support requests). Each patched tree passes all 8 methods. - The existing 5 probability-binding methods pass before and after on both trees.
- All 860 statistics panel replies are unchanged on each tree, with 0 wrong and
0 false yes through their own scorers. Correct including declines:
statistics dev 142/142, heldout 128/142; statistics-v2 dev 144/144,
heldout 130/144; statistics-v3 144/144 on both splits. git apply --checkpasses on both exact selective baselines.
Expected small-problem masses enumerate Bernoulli sequences with exact rational
weights, independently of the implementation's coefficient formula. These are
untrusted Python regressions, not formal verification or a whole-head gate run.
Run python3 -B -m unittest discover -s tests/statistics -v.
The patch changes specialist behavior only and adds no chat routing. Source
inventory found the generic math organ/scientific-number fix and the separate
math coefficient readers, but no shared binomial mass branch needing this
change. The current operations102 descriptor still marks specialists as text
and refuses their direct invocation; generic owner folds also test dependence
on every given number. A correct outside-support zero is invariant under small
changes to k,n,p (isolated gate component:dependence 0/3). Those routing concerns
are deliberately separate from restoring the specialist's right answer here.
Thank you, and thank you for the note about operations102. It caught a false statement of mine: I had said #9's fix was reachable through invoke. It isn't, and I've corrected that on #9. We're reviewing this for 10.3.2, along with routing binomial questions to the specialist in chat, so the fix reaches someone. Your point about the dependence check on a constant zero will be measured in that work.
This shipped in 10.3.2, slim and full, credited in CHANGELOG_1032.md, with your eight tests in tests/statistics/.
- Support: the specialist now returns 0 for k > n, including n = 0 with p = 1.
- Counts: "-3 trials", "3.5 trials" and "3e2 trials" are refused instead of being read as 3, 5 and 2. Those were the source copies you fixed; all five carry it.
- Panels: all 860 biology and statistics replies are identical before and after on both trees, with no wrong answer.
The dependence check. You were right, and it's measured now. In chat, k > n stays withheld: the zero is constant, so it can't pass the rule that every given number moves the answer. The specialist answers it, and chat doesn't yet. That's a stated limit of this release, in the changelog and the pre-registration.
The route. The fix on #9 now reaches chat. A reply where the maths evaluator only read back a number from the question now goes on to the owner stage, under that stage's existing rules. "What is the probability of exactly 1 success in 2 trials with p = 0.5%?" answers 0.00995 through statistics-v3. There's a second limit: when the true answer equals a number the question gave ("exactly 1 success in 2 trials with p = 0.5" is 0.5), the reply holds no new number, so chat still withholds it.
invoke still refuses specialist.statistics-v2 and -v3 on 10.3.2 (not_directly_invocable; -v3 points to command.ask), checked this time before writing it. Sealed test v41 passed on both trees.