mann_whitney_u_test

std.stats.mann_whitney_u_test · Level L5

The Mann–Whitney U test (Wilcoxon rank-sum) by the normal approximation with the tie correction, without a continuity correction: [U, p] with U = Rₓ − n(n + 1)/2 from x's midranks in the combined sample, σ² = nm/12·((N + 1) − Σ(t³ − t)/(N(N − 1))) and the two-sided p = erfc(|U − nm/2|/(σ√2)). An approximation to the exact distribution, closer as n and m grow.

U = Rₓ − n(n + 1)/2, z = (U − nm/2)/σ, p = erfc(|z|/√2)

Signature

mann_whitney_u_test(x: f64[n], y: f64[m]) → f64[2]

Requires: m, n ≥ 2

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

xf64[n]yf64[m]2.0Reshapex_colSizenConcatz_all1.0SizemSqrtroot2Reshapeall_rowAddn10.5AddNMultiplynmReshapeall_col12.0LessbelowEqualsameMultiplynn1MultiplymuAddN1SubtractNm1Equaleq_allDividenm12ReduceSumnbReduceSumnsMultiplybaseMultiplyNN1ReduceSumcAddns1Multiplyc2MultiplymidSubtractc21AddrxReduceSumTReduceSumRxDividetieSubtractUSubtractcoreReshapeU1SubtractdUMultiplyvarSqrtsdDividezNegatenzMaximumazDividewErfcpReshapep1Concatoutoutf64[2]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size with m, n ≥ 2.
  • Agrees with the reference midranks by sorting the combined sample, tie groups counted directly; p = Q(½, z²/2) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 80 float64 results inside the running error bound; the closest uses 25% of it.
  • Interpreter and NumPy backend return bit-identical results.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
64%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
5.30

Note

The graph counts ranks and ties by comparing every pair; the reference sorts and walks the tie groups. Both evaluate the same approximation exactly, and the verification checks that agreement, not the approximation's accuracy.

Identity

Calls
—
Called by
—
sha256:a1ec51afe33b812cbc78154d51e759304cca3aece0d140af4c2e20b387f2bed5

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.stats.mann_whitney_u_test · Ω:mann_whitney_u_test
Pins
sha256:01e3e9347badc6e0ae27d527cbff47a1528bda119077ac754b6ef040d05efe2fthis graph alone
Evidence
sha256:2d8af17863467ba1a996cc08e181872e771704a4b707dc840958fdf98a8a1c64the hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.