Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

180 of 180 checks pass. Each check compares a function of engthink with an exact identity, a brute-force oracle or a published value.

This file is written by python scripts/validate.py, which needs only NumPy.

Historical Benchmarks, Taylor Trinity Fireball Data & 24 Mental Moves Catalog (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Package version engthink.version equals 1.0.01.0.01.0.0PASS
2Trinity data of Taylor (1950) contain 25 frames2525 (rtol=1.0e-09)PASS
3Trinity time stamps strictly increase from 0.10 ms to 62.0 ms[0.0001, 0.062] sStrictly increasingPASS
4Trinity fireball radii strictly increase from 11.1 m to 185.0 m[11.1, 185.0] mStrictly increasingPASS
5R / t^(2/5) varies by less than 2.5 % over the frames from 0.24 ms onCV=2.22%< 2.5%PASS
6Log-log slope of R(t) over the frames from 0.24 ms on is 2/5 within 0.0120.390366220.4 (rtol=1.0e-09, atol=1.2e-02)PASS
7Energy from the frames from 0.24 ms on lies near Taylor’s estimate of about 17 kt ([16.2, 18.2] kt)17.27 kt TNTIn [16.2, 18.2] ktPASS
8TNT energy conversion constant equals 4.184e12 J/kt4.184e+124.184e+12 (rtol=1.0e-09)PASS
9CANONICAL_DIM_MATRICES provides 4 benchmark physical systems44 (rtol=1.0e-09)PASS
10MENTAL_MOVES_DB catalogs exactly 24 Mental Moves (IDs 1..24)2424 (rtol=1.0e-09)PASS
11MENTAL_MOVES_DB IDs are consecutive 1..241..241..24PASS
12Every MENTAL_MOVES_DB module_fn resolves to a live callable in engthink24/24 resolvedAll callablePASS
13MENTAL_MOVES_DB covers all 5 curriculum parts I..VParts I..V5 partsPASS
14Topographic DEM cost_grid has shape (48, 48) and strictly >= 1.0min=1.000>= 1.0PASS
15Topographic DEM generator is deterministic for fixed seed00 (rtol=1.0e-09)PASS
16Sensor station coordinates (60, 2) lie inside [4.0, 96.0]^2 kmIn [4, 96]^2Valid boundsPASS
17Regular 24-gon tour perimeter equals 480 * sin(pi/24)62.65257262.652572 (rtol=1.0e-09)PASS
18Large-N regular n-gon perimeter converges to 2piR62.83184762.831853 (rtol=1.0e-06)PASS
19Shuffled circle coordinates preserve centroid at (0, 0)1.2582528e-150 (rtol=1.0e-09)PASS
20Domain guard rejects undersized terrain grid nx < 8ValueError raisedValueErrorPASS

IEEE-754 Representation, Compensated Invariants & Rational Buckingham-Pi (20/20 PASS)

#CheckComputedExpected / OracleStatus
1IEEE-754 float64(1.0) has sign=0, biased_exp=1023, mantissa=0, ulp=2^-52ulp=2.220e-16Exact binary64(1.0)PASS
2IEEE-754 reconstruction matches -3.5 (-1 * (1 + 0.75) * 2^1)-3.5-3.5 (rtol=1.0e-09)PASS
3IEEE-754 float64(0.0) classified as zero with 64-bit all-zero bitstringzerozeroPASS
4next_up(1.0) - 1.0 equals machine epsilon 2^-522.220446e-162.220446e-16 (rtol=1.0e-09)PASS
5Naive float64 sum loses 100% of 1000 unit increments next to 1e16 (gives 0.0)00 (rtol=1.0e-09)PASS
6Neumaier/Babuska compensated sum recovers exact 1000.0 despite 1e16 cancellation10001000 (rtol=1.0e-09)PASS
7Compensated alternating harmonic sum matches math.fsum to < 1e-150.693047190.69304719 (rtol=1.0e-09)PASS
8Welford single-pass mean on 1e9 + [4, 7, 13, 16] equals 1e9 + 10.01010 (rtol=1.0e-09, atol=1.0e-06)PASS
9Welford single-pass population variance equals exact 22.5 (immune to 1e18 cancellation)22.522.5 (rtol=1.0e-07)PASS
10Naive E[x^2] - E[x]^2 variance fails catastrophically (> 50% error) at 1e9 offsetnaive=-128.00Catastrophic lossPASS
11stable_logsumexp([1000, 1000+ln(3)]) == 1000 + ln(4) without overflow1001.38631001.3863 (rtol=1.0e-09)PASS
12stable_logsumexp([-1000, -1000]) == -1000 + ln(2) without underflow-999.30685-999.30685 (rtol=1.0e-09)PASS
13stable_logsumexp softmax probabilities sum to 1.0 ([0.25, 0.75])1.0241807e-140 (rtol=1.0e-09)PASS
14Buckingham-Pi on Taylor blast [R, t, E, rho0] yields unique integer group [5, -2, -1, 1][[5, -2, -1, 1]][[5, -2, -1, 1]]PASS
15Buckingham-Pi pipe flow (6 vars, rank 3) yields 3 dimensionless groups33 (rtol=1.0e-09)PASS
16Buckingham-Pi convective heat transfer (7 vars, rank 4) yields 3 groups (Nu, Re, Pr space)33 (rtol=1.0e-09)PASS
17Buckingham-Pi capillary droplet (5 vars, rank 3) yields 2 groups (Ohnesorge & scaled freq)22 (rtol=1.0e-09)PASS
18All 4 canonical Buckingham-Pi bases satisfy exact D @ pi^T == 000 (rtol=1.0e-09)PASS
19Dijkstra 3-way Dutch National Flag partition satisfies all 3 zone invariantsbounds=(58,88)Valid 3-zone invariantPASS
20Dutch National Flag preserves exact input multiset in <= 2*N comparisons00 (rtol=1.0e-09)PASS

Empirical Complexity Laws, 2-D Prefix Integrals, Monotonic Deques & Cell Lists (20/20 PASS)

#CheckComputedExpected / OracleStatus
1fit_empirical_complexity classifies constant workload as O(1)O(1)O(1)PASS
2fit_empirical_complexity classifies binary-halving workload as O(log N)O(log N)O(log N)PASS
3fit_empirical_complexity classifies linear sweep as O(N) with exponent 1.0p=1.0000O(N)PASS
4fit_empirical_complexity classifies N*log2(N) workload as O(N log N)O(N log N)O(N log N)PASS
5fit_empirical_complexity classifies N*(N-1)/2 pairs as O(N^2) with p ~ 2.0p=2.0041O(N^2)PASS
62-D Prefix Integral Table matches 40 random rectangle sums to < 1e-129.094947e-130 (rtol=1.0e-09)PASS
72-D Prefix Integral answers 40 rectangle queries in exactly 160 array lookups160160 (rtol=1.0e-09)PASS
82-D Prefix Integral single-pixel query equals grid[r, c]3.44898373.4489837 (rtol=1.0e-09)PASS
92-D Prefix Integral full-domain query equals np.sum(grid)3592.64473592.6447 (rtol=1.0e-09)PASS
10Monotonic deque sliding-window max matches naive O(N*k) scan on 400 samples00 (rtol=1.0e-09)PASS
11Monotonic deque pushes each element exactly once (total_pushes == N)400400 (rtol=1.0e-09)PASS
12Monotonic deque pops each element at most once (total_pops <= N)pops=391 <= 400<= NPASS
13Monotonic deque on strictly increasing sequence returns right endpoints00 (rtol=1.0e-09)PASS
14Monotonic deque on strictly decreasing sequence returns left endpoints00 (rtol=1.0e-09)PASS
152-D Spatial Cell-List neighbor pairs match O(N^2) brute-force oracle identically1099 == 1099 pairsExact pair set matchPASS
162-D Spatial Cell-List cuts candidate distance checks > 15x at N=500, r_c=5.5speedup=39.9x> 15xPASS
17Domain-spanning cutoff r_c=200 recovers all N*(N-1)/2 = 124,750 pairs124750124750 (rtol=1.0e-09)PASS
18Well-separated points below cutoff yield 0 neighbor pairs00 (rtol=1.0e-09)PASS
19Exact boundary distance d == r_c is included consistently by cell-list and oracle11 (rtol=1.0e-09)PASS
20All returned neighbor pairs satisfy i < j sorted invariantAll i < jCanonical orderPASS

Parametric Search, MergeSort Inversions, Cooley-Tukey FFT & Barnes-Hut Quadtree (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Parametric binary search solves x^2 >= 2 to < 1e-111.41421361.4142136 (rtol=1.0e-09, atol=1.0e-11)PASS
2Parametric binary search finds exact minimum buffer tank capacity (20.0)2020 (rtol=1.0e-09, atol=1.0e-09)PASS
3Parametric binary search flags infeasible bracket cleanlyfeasible=FalseInfeasiblePASS
4Integer parametric search finds ceil(sqrt(1000)) = 32 in <= 12 evaluationsk*=32, evals=11k*=32, <=12 evalsPASS
5Integer parametric search returns lo immediately when lo is already feasible55 (rtol=1.0e-09)PASS
6MergeSort sorted output matches np.sort00 (rtol=1.0e-09)PASS
7MergeSort O(N log N) inversion count matches O(N^2) brute-force count21532153 (rtol=1.0e-09)PASS
8Sorted array has 0 inversions00 (rtol=1.0e-09)PASS
9Reverse-sorted length-40 array has 40*39/2 = 780 inversions780780 (rtol=1.0e-09)PASS
10Constant equal-element array has 0 strict inversions00 (rtol=1.0e-09)PASS
11Pure-NumPy Cooley-Tukey radix-2 FFT convolution matches np.convolve (< 1e-12)5.3290705e-150 (rtol=1.0e-09)PASS
12FFT convolution with unit impulse [1, 0, 0] reproduces input signal6.6613381e-160 (rtol=1.0e-09)PASS
13FFT convolution commutativity a * b == b * a1.7763568e-150 (rtol=1.0e-09)PASS
14FFT convolution integral identity sum(a * b) == sum(a) * sum(b)-1.6943293-1.6943293 (rtol=1.0e-11)PASS
15Barnes-Hut Quadtree at theta=0.0 matches exact O(N^2) pairwise forces (< 1e-11)1.0658141e-140 (rtol=1.0e-09, atol=1.0e-11)PASS
16Exact N-body momentum conservation sum_i F_i == (0, 0) at theta=0.04.9650683e-150 (rtol=1.0e-09, atol=1.0e-11)PASS
17Barnes-Hut theta=0.5 achieves < 1.8% relative L2 force errorrel_err=0.33%< 1.8%PASS
18Barnes-Hut theta=0.5 slashes force evaluations > 3.5x at N=22011855 vs 48180> 3.5x reductionPASS
19Barnes-Hut Quadtree records adaptive bounding boxes and positive depthboxes=374, depth=7Valid tree geometryPASS
20Wider opening angle theta=0.9 performs strictly fewer evaluations than theta=0.55411 < 11855Monotonic pruningPASS

Bellman Dynamic Programming: Knapsack, Alignment, Seam Carving & Storage Control (20/20 PASS)

#CheckComputedExpected / OracleStatus
10/1 Knapsack DP matches exhaustive 2^12 subset enumeration5656 (rtol=1.0e-09)PASS
2Reconstructed knapsack item weights obey capacity <= 20weight=20<= 20PASS
3Reconstructed knapsack subset values sum to max_value5656 (rtol=1.0e-09)PASS
4Zero-capacity knapsack returns 0 value and empty selection00 (rtol=1.0e-09)PASS
5Non-restrictive capacity selects all positive-value items166166 (rtol=1.0e-09)PASS
6Levenshtein edit distance(‘KITTEN’, ‘SITTING’) == 333 (rtol=1.0e-09)PASS
7Levenshtein edit distance(‘SATURDAY’, ‘SUNDAY’) == 333 (rtol=1.0e-09)PASS
8Edit distance identity d(s, s) == 0 and symmetry d(a, b) == d(b, a)00 (rtol=1.0e-09)PASS
9Edit distance satisfies metric triangle inequality d(a, c) <= d(a, b) + d(b, c)3 <= 4+3Triangle inequalityPASS
10Needleman-Wunsch aligned strings have equal length and strip to originalsACGTGA / ACGT-AValid global alignmentPASS
11Seam-carving DP matches exhaustive 8-connected path enumeration on 7x6 field17.81637417.816374 (rtol=1.0e-09)PASS
12Seam-carving column trajectory obeys |c[r] - c[r-1]| <= 1 everywhere[2, 2, 2, 2, 3, 4, 3]8-connected seamPASS
13Seam energy sum along reconstructed seam equals min_total_energy17.81637417.816374 (rtol=1.0e-09)PASS
14Seam carving threads planted zigzag low-energy valley (12 * 0.25 = 3.0)33 (rtol=1.0e-09)PASS
15Bottom row minimum of cumulative_energy_map equals min_total_energy17.81637417.816374 (rtol=1.0e-09)PASS
16Bellman value function V_0(s) is monotonically non-decreasing in initial storage sNon-decreasing V_0(s)More stored energy >= valuePASS
17Higher round-trip efficiency (95% vs 70%) strictly raises optimal expected profit5809.5 > 3464.0Higher eta -> higher profitPASS
18Zero electricity prices and zero terminal value yield V == 0 everywhere00 (rtol=1.0e-09)PASS
192-stage deterministic lossless arbitrage buys 25 MWh at 10 and sells at 100 (+2250)22502250 (rtol=1.0e-09)PASS
20Positive terminal water/energy salvage value raises V_0(s)V_term >= V_baseMonotone in salvagePASS

Greedy Exchange Proofs, Belady Caching & Admissible A* Search (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Earliest-finish-time greedy interval scheduling matches 2^10 exhaustive optimum55 (rtol=1.0e-09)PASS
2Greedy selected intervals are mutually non-overlappingcount=5Pairwise compatiblePASS
3Earliest-finish greedy avoids shortest-duration trap on [(0,4), (3,6), (5,9)] -> 222 (rtol=1.0e-09)PASS
4Disjoint sequential intervals are all selected44 (rtol=1.0e-09)PASS
5Mutually overlapping intervals select exactly 111 (rtol=1.0e-09)PASS
6Belady Furthest-in-Future incurs <= misses of online LRU and FIFOBelady=45 <= LRU=76, FIFO=73Belady optimalPASS
7Belady’s Anomaly reproduced: FIFO has MORE misses at cache=4 (10) than cache=3 (9)FIFO(4)=10 > FIFO(3)=910 > 9 anomalyPASS
8Belady MIN and stack-based LRU are immune to Belady’s Anomaly (misses(4) <= misses(3))Belady 6<=7Monotonic stack propertyPASS
9Cache larger than distinct alphabet incurs only cold-start compulsory misses55 (rtol=1.0e-09)PASS
10Belady hit_rate + miss_rate == 1.011 (rtol=1.0e-09)PASS
11Admissible A* (w=1) discovers exact same minimum path cost as Dijkstra117.38291117.38291 (rtol=1.0e-12)PASS
12Admissible A* expands strictly fewer terrain cells than blind DijkstraA*=1662 vs Dijk=2760A* << DijkstraPASS
13Weighted A* (w=2.2) expands fewer nodes while obeying w-suboptimality boundnodes=155, cost=117.7Bounded suboptimalPASS
148-neighbor Euclidean-heuristic A* matches 8-neighbor Dijkstra cost identically100.87861100.87861 (rtol=1.0e-12)PASS
15Allowing diagonal moves lowers path cost relative to 4-neighbor Manhattan grid100.9 < 117.4Diagonal shortcutPASS
16A* with heuristic_weight=0 reduces identically to Dijkstra00 (rtol=1.0e-09)PASS
17BFS on unweighted 15x15 grid finds Manhattan shortest length 282828 (rtol=1.0e-09)PASS
18Sealed inf-cost barrier cleanly reports found=Falsefound=FalseUnreachable detectedPASS
19Opening single gap at (5, 9) restores optimal detour path through gapPasses (5, 9)Valid gap detourPASS
20Reconstructed A* path starts at start, ends at goal, and takes unit grid stepslen=95Contiguous 4-grid pathPASS

Problem Reduction: Knuth’s Algorithm X (Exact Cover) & Critical-Path DAGs (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Knuth’s classic 7-element Exact Cover instance has unique solution [‘B’, ‘D’, ‘F’][['B', 'D', 'F']][['B', 'D', 'F']]PASS
2Unsatisfiable Exact Cover returns 0 solutions cleanly00 (rtol=1.0e-09)PASS
3Symmetric 2-partition Exact Cover finds both valid covers22 (rtol=1.0e-09)PASS
4Every Algorithm X solution partitions primary universe without overlap[1, 2, 3, 4][1, 2, 3, 4]PASS
5N-Queens via Exact Cover reduction matches OEIS A000170 [1, 0, 0, 2, 10, 4, 40, 92] for N=1..8[1, 0, 0, 2, 10, 4, 40, 92][1, 0, 0, 2, 10, 4, 40, 92]PASS
6Reconstructed 8-Queens placement has 8 non-attacking queens across rows, cols & diagonals8 queensZero conflictsPASS
7MRV column branching solves all 92 8-Queens configurations in < 2000 search nodesMRV pruned< 2000 nodesPASS
8Exact Cover enumerates all 12 distinct 3x3 Latin squares1212 (rtol=1.0e-09)PASS
9Completed 4x4 Latin square preserves clues and permutes 1..4 in every row and columnsolutions=3Valid Latin squarePASS
10Contradictory Latin-square clues (two 1s in row 0) yield 0 solutions00 (rtol=1.0e-09)PASS
115x5 diagonal-seeded Latin square completion succeeds cleanly11 (rtol=1.0e-09)PASS
12Critical Path Method computes exact bottleneck project duration (18.0 days)1818 (rtol=1.0e-09)PASS
13Critical path identifies exact zero-slack bottleneck chain['Design', 'Procure_A', 'Fabricate', 'Integrate']4 critical tasksPASS
14Non-critical tasks have exact slack floats (Procure_B=3.0, Software=7.0)00 (rtol=1.0e-09)PASS
15All precedence constraints EF[u] <= ES[v] hold across DAGPrecedence respectedEF[u] <= ES[v]PASS
16Delaying critical task Fabricate by +2 days delays project by +2 days2020 (rtol=1.0e-09)PASS
17Delaying non-critical Software by +5 days (< 7-day slack) causes 0.0 project delay1818 (rtol=1.0e-09)PASS
18All task slacks are non-negativeslack >= 0Non-negativePASS
19Cyclic dependency graph raises ValueError in critical_path_dagCycle rejectedValueErrorPASS
20Parallel independent tasks have project_duration == max(durations)8.58.5 (rtol=1.0e-09)PASS

Shannon Information Metrics, Fault Trees & Sublinear Streaming Sketches (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Fair 8-outcome distribution has Shannon entropy 3.0 bits and efficiency 1.0H=3.0, eff=1.0H=3.0, eff=1.0PASS
2Deterministic certainty [1, 0, 0, 0] has 0.0 bits of entropy00 (rtol=1.0e-09)PASS
3KL divergence D_KL(p || p) equals 0.0 bits00 (rtol=1.0e-09)PASS
4Gibbs inequality D_KL(p || q) > 0 for p != qKL=0.2500> 0PASS
5Cross-entropy identity H(p, q) == H(p) + D_KL(p || q)22 (rtol=1.0e-09)PASS
6Dyadic [1/2, 1/4, 1/8, 1/8] entropy equals exact 1.75 bits1.751.75 (rtol=1.0e-09)PASS
7Optimal fault tree on dyadic [1/2, 1/4, 1/8, 1/8] achieves Shannon bound 1.75 tests (0 redundancy)1.751.75 (rtol=1.0e-09)PASS
83-bit parity/address sensors isolate 8 equiprobable faults in 3.0 tests33 (rtol=1.0e-09)PASS
9Expected fault tests obey Shannon lower bound H(p) <= E[L] < H(p) + 1H=1.319 <= E[L]=1.450Noiseless coding boundPASS
10Indistinguishable fault columns raise ValueError in optimal_fault_diagnosis_treeValueError raisedValueErrorPASS
11Vitter Reservoir Sampling (k=3 from 10) gives uniform inclusion 0.30 +/- 0.025 across all elementsmax_dev=0.0106< 0.025PASS
12Reservoir sample contains k=15 distinct elements from stream15 uniqueValid k-subsetPASS
13Reservoir sample with k == N retains all N stream elements2020 (rtol=1.0e-09)PASS
14Bloom Filter guarantees strictly ZERO false negatives on all inserted items00 (rtol=1.0e-09)PASS
15Bloom Filter auto-selects optimal k* = round(10 * ln 2) = 7 hashes77 (rtol=1.0e-09)PASS
16Bloom Filter empirical FPR matches theoretical (1 - e^(-kn/m))^k within 0.01emp=0.0070 vs th=0.0082|emp - th| < 0.01PASS
17Doubling Bloom Filter bit budget (10 -> 20 bits/item) slashes FPR > 5x0.00000 < 0.0070Exponential FPR dropPASS
18Count-Min Sketch guarantees strict one-sided error (min_overestimate >= 0, zero undercounting)min_err=0>= 0PASS
19Count-Min Sketch (w=128, d=5) recovers heavy hitter HOT_VALVE within <= 12 counts of 400est=409In [400, 412]PASS
20Widening Count-Min Sketch (w=32 -> 128) reduces mean frequency overestimate0.39 < 11.71Decreasing errorPASS

Emergence (Percolation, Traffic, Flocking), SA/LHS & Metamorphic Auditing (20/20 PASS)

#CheckComputedExpected / OracleStatus
1Empty lattice (p=0) has 0 clusters and does not percolate0 clustersFalsePASS
2Full lattice (p=1) forms 1 spanning cluster of fraction 1.01 cluster, frac=1.0TruePASS
32-D site percolation sharp transition brackets p_c ~ 0.5927 (P(0.46)=0 vs P(0.72)=1)P(0.46)=0.00, P(0.72)=1.00Sharp phase transitionPASS
4Giant cluster fraction surges across p_c (p=0.35 vs p=0.75)0.020 -> 0.755Giant cluster emergencePASS
5Cluster label matrix assigns 0 to all unoccupied poresConsistent maskExact maskPASS
6Nagel-Schreckenberg CA strictly conserves vehicle count at every time step110 cars / stepExact conservationPASS
7Free-flow highway achieves high mean speed (> 4.2) and near-zero jamsv=4.59, jam=0.006Free-flow regimePASS
8Congested highway spontaneously nucleates phantom stop-and-go jams (jam_fraction > 0.25)v=0.50, jam=0.61Emergent jam wavesPASS
9Random braking asymmetry p_slow lowers fundamental traffic flux0.307 < 0.691Stochastic capacity dropPASS
10Vicsek order parameter Phi(t) stays bounded in [0, 1]In [0, 1]Bounded order parameterPASS
11Low angular noise (eta=0.15) triggers collective flocking (Phi > 0.90)Phi=0.999> 0.90PASS
12High angular noise (eta=6.0) destroys orientational order (Phi < 0.30)Phi=0.171< 0.30PASS
132-opt Simulated Annealing untangles shuffled 20-gon to exact global optimum75.08854375.088543 (rtol=1.0e-09)PASS
14Simulated Annealing reduces tour length > 2.2x from initial tangled tour326.6 -> 75.1> 2.2x shorterPASS
15Best TSP tour is a valid permutation of 0..19Valid permutation0..19PASS
16Latin Hypercube MC estimate of integral_{0..1}^3 sum(e^x_j) matches 3*(e - 1)5.15500655.1548455 (rtol=1.0e-09, atol=3.0e-02)PASS
17Latin Hypercube Sampling achieves > 4x variance reduction over crude SRSVRR=3066.4x> 4.0xPASS
18Metamorphic + oracle audit passes exact np.median across 80 randomized/adversarial trialstests=320passed=TruePASS
19Differential micro-oracle catches subtle even-length median bug immediatelyfailures=34Caught even-N bugPASS
20Oracle-free metamorphic invariants catch order/threshold bias with no reference oraclecaught law=shift_equivarianceCaught without oraclePASS