QouratR&D centreContact

How soon can a seven-entry test decide with one possible wrong sign?

A running score with a randomized fourth look averages 3.529 clean entries at 5% worst-case false alarms and 95% worst-case detection with one possible wrong sign.

This is the minimum mean time to either decision on two equally weighted, unedited independent sources with up chances of 10% and 90%.

The best test preserving a final-tally prescription needs 4.212 clean entries at the same two error rates. Both may stop early.

On this page

Question

You can read seven signs in a fixed order. Each costs one observation, and one of the seven may have been reported incorrectly. How early can you decide while keeping the chances of a false alarm and a missed detection at or below 5% each?

Use a running score of +1 for up and −1 for down. The best rule needs just the entry number, the current score and one coin. Switching on an extra stopping opportunity at entry four with probability 32,969/85,293 attains both error limits exactly. This is a new finite design result, machine-checked in Lean for the two numerical certificates and their lower-bound inequality. Its usefulness is for readers to judge.

Data

The data consist of all 128 ordered words of seven signs. On a genuine history, the chance that the next sign is up is at most 1/10 under the null and at least 9/10 under the alternative. These are design assumptions. A false alarm is an alarm under the null. A miss is a decision against an alarm under the alternative.

For either risk, an editor may see the entire genuine tape and the test seed, then replace at most one sign anywhere on that tape. The editor may choose differently under the two hypotheses. Each genuine word has eight possible reports including itself. A test reads the report in its given order, may decide at time zero and must decide by entry seven. Its random seed is independent of the pre-generated genuine tape. If a source sees the seed, its next-sign bound must hold after every genuine history conditional on that seed.

Time means entries read to either decision. Give equal weight to the two clean laws with independent up chances 1/10 and 9/10, with no replacement when charging time. The error guarantees range over all the allowed adaptive sources and edits. Neither of those wider classes supplies the average-time weights.

Method

How to run the attaining test

  1. Before reading, draw the fourth-look coin with probability 32,969/85,293 of switching it on. Start the score at zero.
  2. Read one sign. Stop for an alarm at +3 or for no alarm at −3. With the coin on, also stop at entry four if the score is +2 or −2, taking the decision indicated by its sign.
  3. Stop as soon as all remaining completions give the same decision. In this seven-entry rule, this happens if the absolute score exceeds the number of entries left. Otherwise read again. At seven the score is odd and its sign decides.

The tape 1101000 (1 means up) shows exactly what the extra look buys. Both versions see +2 after four entries. The coin-on version alarms there. With the coin off, three downs carry the score to −1, so the test reads all seven and decides against an alarm. Download the eight score positions.

The score on 1101000 reaches +2 at entry four. With the extra look it alarms there. Otherwise it ends at −1 at entry seven.
One tape, two possible stopping timesThe solid line is the shared prefix. The dashed part is read only when the fourth-look coin is off.Open full-size figure

Why no allowed test can do better

For a fixed completed word, let f be the probability of an alarm over the test's coins. Among all completions of one prefix, let L be the smallest f and U the largest. A seed that has already decided alarm must alarm on every completion. Its total probability is at most L. Similarly, at most 1 − U can have decided against an alarm. At least U − L must therefore pay for the next entry. Sum those ranges over prefixes, weighting each by its clean probability, to bound the mean from below.

For a given clean word the editor can choose any of its eight reports. Their largest f lower-bounds worst false alarms, and their smallest f upper-bounds guaranteed detection. Both independent endpoint laws are allowed sources, so these constraints apply to every test, including tests with many coins. One uniform draw v realizes all prefix ranges and ball extrema together. Alarm when v ≤ L, decide against an alarm when v > U, and continue otherwise. As more signs arrive the possible completions shrink. For each seed, the alarming sets are nested thresholds of f, so even an editor seeing the draw attains precisely these worst risks.

For the attaining tables, turning a down sign into an up sign can only increase f. The same holds for the largest and smallest f over a one-edit ball. A witness report transfers to a larger clean word by taking the coordinatewise maximum, which uses at most one replacement. The reverse construction uses the minimum. Coupling the signs step by step using the same uniform draw at each genuine history makes the independent 1/10 law largest under the null and the independent 9/10 law smallest under the alternative. This works for each fixed seed when its conditional bounds hold.

The resulting linear program has 638 variables for leaves, prefix ranges and corruption-ball ranges. For every feasible point, multiplying each constraint by its nonpositive price and bounding each remaining variable in [0, 1] gives a lower bound on cost. The two price lists meet their respective rule costs exactly. The 2,558 unrestricted constraints impose no monotonicity assumption on competing tests. Adding equality of leaf probabilities within each final tally gives 2,798 constraints. This includes tests whose individual seed outcomes can depend on order. The source bundle gives the row order, exact prices and checker.

Results

At the two 5% error limits, the unrestricted minimum is 557,462,231/157,950,000 clean entries. The minimum preserving a terminal tally prescription is 235,026/55,801. Each attaining test has the same mean under both clean endpoints. It also minimizes the larger of those two means, since that maximum is at least their average.

Only rows with 5% false alarms and 95% detection spend the full error allowance. Means are rounded to nine decimal places.4 columnsCSV
Stopping ruleWorst false alarmWorst detectionMean clean entries
Seven-entry majority2.56915%97.43085%4.439380000
Best final-tally test5%95%4.211860003
Ordinary ±34.34062%95.65938%3.626022000
±3 with initial fair guess5%95%3.573657592
±3 with fourth-look coin5%95%3.529358854

The fourth-look rule saves 16.20% against the best test preserving a terminal tally prescription. That prescription requires equal alarm probability on every permutation of a completed word with the same number of ups. To attain its minimum, make a fair guess at time zero with probability 97,234/1,897,234. Otherwise use seven-entry majority, stopping once four signs of either kind have appeared. Thus the final alarm probabilities below and above a majority are 48,617/1,897,234 and its complement.

Ordinary fully curtailed ±3 is itself optimal at its own 4.34062% false-alarm and miss rates. To match 5% exactly, it can make a fair guess at time zero with probability 32,969/2,282,969. The fourth-look rule saves 1.23959% against this matched comparator. It saves zero against the best rule using the current count and entry number, because those are enough to implement it.

How far the same certificate reaches

Let z be the chance of switching on the extra look. The two seed outcomes attain their worst errors on the same independent endpoint laws. Their mixture has false-alarm and miss probabilities α = 0.0434062 + 0.0170586z and clean mean 3.626022 − 0.250074z. For every z from zero to one, the same price vector gives the lower bound 673,237,231/157,950,000 − (46,310/3,159)α. The bound and the attained cost are straight lines in α and agree at both ends, so they agree throughout.

Always using the fourth look gives 6.04648% false alarms, 93.95352% detection and 3.375948 clean entries.5 columnsCSV
Chance of extra lookWorst false alarmWorst detectionMean as a fractionMean clean entries
04.34062%95.65938%1,813,011/500,0003.626022000
32,969/85,2935%95%557,462,231/157,950,0003.529358854
1/25.19355%94.80645%700,197/200,0003.500985000
3/45.62002%94.37998%6,876,933/2,000,0003.438466500
16.04648%93.95352%843,987/250,0003.375948000
The optimal mean drops from 3.626022 to 3.375948 as the error limit rises from 4.34062% to 6.04648%. The 5% design lies between them.
What the fourth-look coin changesThe same prices certify the whole line. The half-strength coin gives 5.19355% error, an interior point.Open full-size figure

The final-tally optimum has a segment of its own. Let g be the chance of making the initial fair guess and use fully curtailed majority otherwise. Its symmetric error is (1 − g) × 0.0256915 + g/2 and its clean mean is (1 − g) × 4.43938. The tally prices meet these costs at both ends, so the same interpolation certifies every error from 2.56915% to 50%. At 50% a fair guess reads zero entries.

Checks

Lean checked numerical identities for two explicit 128-word tables and real weak duality. The identities give each table's weighted false alarms, detection, clean cost and equal lower bound at 5%. Lean also checked reflection, boundedness, monotonicity and the tally equalities where required. The reduction from arbitrary randomized tests, feasibility for adaptive genuine sources and the proof over the full error interval are the written arguments above.

Direct costing, rational row pricing and an independent integer minimum cut give the same fractions.4 columnsCSV
ClassRule meanPriced lower boundIndependent minimum cut
All fixed-order tests557,462,231/157,950,000557,462,231/157,950,000557,462,231/157,950,000
Final-tally tests235,026/55,801235,026/55,801235,026/55,801
Ordinary ±3 at its own rates1,813,011/500,0001,813,011/500,0001,813,011/500,000

The independent calculation minimized clean prefix cost plus a penalty for errors over sets of alarming words. A graph cut charges each prefix that has both kinds of completion and each edit ball capable of the wrong decision. Merging equal-tally leaves gives the restricted problem. Enumerating all 256 deterministic final-tally prescriptions confirmed its supporting price. All 122 additional class-and-target cases agreed. No counter-example appeared in the generated cases. Exact targets and bounds and stopping decisions on all 128 tapes.

The review reproduced 433 of 434 reported numbers. The single discrepancy was a decimal printed with an ellipsis. The exact tally minimum is 235,026/55,801 = 4.2118600025089…, which rounds to 4.211860003 at nine decimal places. All exact minima, certificate values and leaf probabilities agreed. These are exact finite calculations with no sampling error. Original numerical comparisons.

What it means in plain words

A final-tally restriction makes sense if an auditor must reproduce a fixed-sample decision prescription under every permutation. An interim score can legitimately decide differently. The words 0001111 and 1111000 both contain four ups, yet ordinary ±3 stops at entry three with opposite decisions.

This is a finite benchmark. A full-word calculation for n entries has 2ⁿ leaves. A different deadline, edit budget or clean sampling law changes the optimization problem. The 16.20% figure measures a difference in mean entries under the stated laws. Detection probability, time on corrupted streams and time until an actual signal are distinct quantities.

References

No earlier equivalent statement was found in the sources consulted for this seven-entry design. The search covered exact curtailment, finite-horizon Bernoulli testing, robust classification and sequential games. The closest comparisons follow.

Download plain-text bibliography · Download linked bibliography (HTML)

  1. Eisenberg and Lienhard, Curtailed versions of randomized binomial tests

    The publisher's abstract, consulted in the priority review, treats curtailment of randomized one-sided binomial decisions. The open DOI record identifies the article.

    Opened 2026-11-30
  2. Law, Grayling and Mander, Optimal curtailed designs … (arXiv 1909.03017)

    Interim count boundaries and exact calculations of operating characteristics give a practical comparison under ordinary binary sampling.

    Opened 2026-11-30. arXiv 1909.03017
  3. Kiefer and Weiss, Some Properties of Generalized Sequential Probability Ratio Tests

    The original summary identifies expected sample size under a designated law as a design objective. The open DOI record identifies the original article.

    Opened 2026-11-30
  4. Novikov, Novikov and Farkhshatov, A computational approach to the Kiefer–Weiss problem for sampling from a Bernoulli population

    Propositions 1 and 2 give finite-horizon optimization with randomized stopping, separate risks and a Lagrange bound.

    Opened 2026-11-30. arXiv 2110.04802
  5. Fauß and Zoubir, A Linear Programming Approach to Sequential Hypothesis Testing

    Program (4.3) prices continuation and stopping under specified stochastic kernels.

    Opened 2026-11-29. arXiv 1501.05870
  6. Fauß, Zoubir and Poor, Minimax Optimal Sequential Hypothesis Tests for Markov Processes

    Theorems 8 and 9 treat conditional distributional uncertainty and least-favourable kernels.

    Opened 2026-11-29. arXiv 1811.04286
  7. Pydi and Jog, Adversarial Risk via Optimal Transport and Optimal Couplings

    Theorem 2 gives a whole-input robust classification problem for perturbations in a metric ball.

    Opened 2026-11-30
  8. Bungert, García Trillos and Murray, The Geometry of Adversarial Training in Binary Classification

    Proposition 3.13 relates an adversarial functional to nested decision sets.

    Opened 2026-11-29. arXiv 2111.13613
  9. Li, Mo and Hao, Game Theoretical Approach to Sequential Hypothesis Test with Byzantine Sensors

    The corruptible units are sensors used across observations. Sample number is studied asymptotically.

    Opened 2026-11-30
  10. Koller, Megiddo and von Stengel, Efficient Computation of Equilibria for Extensive Two-Person Games

    The sequence form gives a representation linear in the size of a perfect-recall game tree.

    Opened 2026-11-30
  11. Modak and colleagues, Sequential Adversarial Hypothesis Testing

    Theorem 1 studies asymptotic error exponents when the observation distributions can be selected adversarially.

    Opened 2026-11-29. arXiv 2511.10181

Reproduce

The proofs, executable stopping rule, certificates and independent solver are in one source download. Save it as source.csv in an empty directory. The bundle contains the pinned Lean project and the row-by-row proof description. The stopping rule needs only Python 3. The numerical replay uses NetworkX 2.8.8, the charts use Matplotlib 3.10.8, and the proof uses Lean and mathlib 4.36.0.

tail -n +2 source.csv | base32 -d | tar xz
python3 code/rule.py 1101000 --fourth on
python3 code/rule.py 1101000 --fourth off
bash code/reproduce.sh

The design constants generate the whole input. The 128-word stopping table regenerated on 30 November 2026 has SHA-256 8b36f846377026c2c2cd4a8322514308443d48a3dc492dbf43dd500a0446a328. Source fingerprints for the numerical certificates accompany the code. The repository directory is research/seven-entry-test/code/.

Change log

29 November 2026. The design and two optima were independently checked. On 30 November the executable fourth look, extended error interval, corrected decimal and reproducible comparisons were prepared.

What this leaves open

  • Which count boundaries attain the minimum with more than seven observations?
  • Which rule minimizes time if the editor can also increase the charged sample length?

Our review

Rating 9.5 out of 10

  • Question 13 of 15
  • Evidence 25 of 25
  • Verification 15 of 15
  • Sources 14 of 15
  • Usefulness 18 of 20
  • Originality 10 of 10

An executable rule and matching lower bound establish the seven-entry optimum, but the time saving is measured only on the two clean source laws.

This is the centre's own review, not peer review by outside scholars; see Policies.

Cite this study

Titles are italic in Harvard, APA, MLA and Chicago.

First published .

Harvard

Qourat 2026, How soon can a seven-entry test decide with one possible wrong sign?, Research 113, Qourat Research and Development Centre, https://doi.org/10.5281/zenodo.24773143

APA (7th edition)

Qourat. (2026). How soon can a seven-entry test decide with one possible wrong sign? (Research 113). Qourat Research and Development Centre. https://doi.org/10.5281/zenodo.24773143

IEEE

[1] Qourat, “How soon can a seven-entry test decide with one possible wrong sign?” Qourat Research and Development Centre, Research 113, Dec. 1, 2026. [Online]. Available: https://doi.org/10.5281/zenodo.24773143

MLA (9th edition)

Qourat. How Soon Can a Seven-Entry Test Decide with One Possible Wrong Sign? Research 113, Qourat Research and Development Centre, 1 Dec. 2026, https://doi.org/10.5281/zenodo.24773143.

Chicago (author-date)

Qourat. 2026. How Soon Can a Seven-Entry Test Decide with One Possible Wrong Sign? Research 113. Qourat Research and Development Centre. https://doi.org/10.5281/zenodo.24773143.

BibTeX

@techreport{qourat-113,
  author = {Qourat},
  title = {{How soon can a seven-entry test decide with one possible wrong sign?}},
  institution = {Qourat Research and Development Centre},
  number = {Research 113},
  year = {2026},
  date = {2026-12-01},
  url = {https://doi.org/10.5281/zenodo.24773143}
}

Add the date you read the page if your style asks for one.