
…to confirm an election was counted correctly
Statistics seminar, University of Sydney
17 April 2026
Will not cover

Developed by Wald (1945)
Birth of sequential analysis
Data (X_i): 0, 0, 1, 1, 0, 1, \dots
Hypotheses: \begin{cases} H_0\colon p = p_0 \\ H_1\colon p = p_1 \end{cases}

Test statistic: S_t = \frac{L_t(p_1)}{L_t(p_0)} = \frac{\Pr(X_1, \dots, X_t \mid H_1)} {\Pr(X_1, \dots, X_t \mid H_0)} = \frac{p_1^{Y_t} (1 - p_1)^{t - Y_t}} {p_0^{Y_t} (1 - p_0)^{t - Y_t}}
Where: Y_t = \sum_{i=1}^t X_i
Stopping rule: \begin{cases} S_t \leqslant \frac{\beta}{1 - \alpha} & \Rightarrow \text{accept } H_0 \\ S_t \geqslant \frac{1 - \beta}{\alpha} & \Rightarrow \text{accept } H_1 \\ \text{otherwise} & \Rightarrow \text{keep sampling} \end{cases}
Error control:

Parameters:
n = 38 for fixed-n test with same power
SPRT often stops earlier
H_0\colon X \sim f_0(\cdot) \quad \text{vs} \quad H_1\colon X \sim f_1(\cdot)
Test statistic: S_t = \frac{f_1(X_1, X_2, \dots, X_t)} {f_0(X_1, X_2, \dots, X_t)}
Test statistic, with iid observations: S_t = \prod_{i=1}^t \frac{f_1(X_i)}{f_0(X_i)} = S_{t - 1} \times \frac{f_1(X_t)}{f_0(X_t)}


“Stays the same” on average

“Stays the same or reduces in value” on average
Martingale condition: \mathbb{E}\left(S_{t+1} \mid X_1, \dots, X_t\right) = S_t
Supermartingale condition: \mathbb{E}\left(S_{t+1} \mid X_1, \dots, X_t\right) \leqslant S_t
Let S_0, S_1, S_2, \dots be a test supermartingale (TSM):
has non-negative terms (S_i \geqslant 0) and starting value S_0 = 1.
For any \alpha > 0, \Pr\left(\max_t (S_t) \geqslant \frac{1}{\alpha}\right) \leqslant \alpha


Decision rule:
Ville’s inequality \Rightarrow anytime-valid type I error control
Growth rate under H_1 \rightarrow statistical efficiency (“power”)
At time t: \mathbb{E}_{H_0} \left(\frac{f_1(X_t)}{f_0(X_t)}\right) = \int \frac{f_1(x)}{f_0(x)} f_0(x) \, dx = \int f_1(x) \, dx = 1
This implies the martingale condition.
H_0\colon \theta = \theta_0 \quad \text{vs} \quad H_1\colon \theta \in \mathcal{A}
Plug-in strategy: S_t = S_{t-1} \times \frac{f(X_t \mid \hat\theta_t)}{f(X_t \mid \theta_0)} \hat\theta_t = a(X_1, X_2, \dots, X_{t-1}) \in \mathcal{A}
H_0\colon \theta = \theta_0 \quad \text{vs} \quad H_1\colon \theta \in \mathcal{A}
Mixture strategy: S_t = S_{t-1} \times \frac{\int_{\mathcal{A}} f(X_t \mid \theta) \, g_t(\theta) \, d\theta}{f(X_t \mid \theta_0)} g_t(\theta) \text{ is a distribution over } \mathcal{A} g_t(\theta) \text{ can depend on } X_1, X_2, \dots, X_{t-1}
“Safe anytime-valid inference” (SAVI)
Australian Research Council:
More automation \rightarrow less scrutiny
Goal:
How: statistics! 📊
Election: Albo vs Dutton 🤼
p = \text{Proportion of votes for Albo}
\begin{cases} H_0\colon p \leqslant 0.5, & \text{Albo did not win} \\ H_1\colon p > 0.5, & \text{Albo won} \end{cases}
SPRT with a plug-in estimator of p:
S_t = S_{t-1} \times \frac{\Pr(X_t \mid \hat{p}_t)}{\Pr(X_t \mid p = 0.5)} \hat{p}_t = h(X_1, \dots, X_{t-1}) \in (0.5, 1]
“ALPHA supermartingale” (Stark 2023)
Rank the candidates in order of preference.
Examples
Iterative algorithm:
This produces an elimination order.
Example
[Wei, Michael, Garth]
Garth is declared the winner
H_0 = “someone else won the election”
H_0 includes all elimination orders with
alternative winners (“alt-orders”).
Example alt-orders
[Garth, Michael, Wei]
[Garth, Wei, Michael]
[Michael, Garth, Wei]
[Wei, Garth, Michael]
Need to reject every all-order
k candidates \Rightarrow \sim k! ballot types
k candidates \Rightarrow \sim k! alt-orders
Challenges
Enumerate all alt-orders: 1, \dots, m
H_0^i = “alt-order i is true”
H_0 = H_0^1 \cup H_0^2 \cup \dots \cup H_0^m
Must reject every alt-order
Example:
“Garth has more votes than Michael assuming that only
candidates in the set \mathcal{S} remain standing.”
Notation:
Equivalent to a two-candidate election.
Can test using ALPHA.
Alt-order: [Garth, Michael, Wei]
Requirements:
Alt-order is true \Leftrightarrow all of its requirements are true
Reject at least one requirement \Rightarrow reject the alt-order
Alt-order i is an intersection of its requirements: H_0^i = R_i^1 \cap R_i^2 \cap \dots \cap R_i^{r_i}
Simpler, more generic notation: H = H^1 \cap H^2 \cap \dots \cap H^r
Base TSM: for H^j
S_{j,t} = \prod_{i = 1}^t s_{j, i}
Intersection TSM: for H
S_t = \prod_{i = 1}^t \frac{\sum_j w_{j, i} \, s_{j, i}}{\sum_jw_{j, i}}
The weights w_{j, i} can depend on data up until time i - 1.
How to choose the weights w_{j, i}?
How to choose the weights w_{j, i}?
Ideas:
Compared about 30 schemes. “Largest” was often the best.
k! alt-orders
\rightarrow 💥 explosion of decompositions & intersections
Use combinatorial optimisation methods…
graph TD
A("[...1]") --> B("[...2,1]")
A("[...1]") --> C("[...3,1]")
A("[...1]") --> D("[...4,1]")
B("[...2,1]") --> E("[4,3,2,1]")
B("[...2,1]") --> F("[3,4,2,1]")
C("[...3,1]") --> G("[4,2,3,1]")
C("[...3,1]") --> H("[2,4,3,1]")
D("[...4,1]") --> I("[3,2,4,1]")
D("[...4,1]") --> J("[2,3,4,1]")
graph TD
A("[...1]") --> B("[...2,1]")
A("[...1]") --> C("[...3,1]")
A("[...1]") --> D("[...4,1]")
B("[...2,1]") --> E("[4,3,2,1]")
B("[...2,1]") --> F("[3,4,2,1]")
style C fill:#fff0f5,stroke:#db7093,color:#db7093
style D fill:#fff0f5,stroke:#db7093,color:#db7093
‘Exhaustive’ implementation: up to 6 candidates
‘Incremental’ implementation: 55+ candidates
Sequential analysis allows for “safe” inference
Modern tools use TSMs (and e-processes)
Complex inference problems can be tackled sequentially with finite-sample guarantees.
Chugg, Ramdas, Grünwald (2026). E-values as statistical evidence: A comparison to Bayes factors, likelihoods, and p-values. arXiv:2603.24421.
Ek, Blom, Stark, Stuckey, Vukcevic (2024). Improving the Computational Efficiency of Adaptive Audits of IRV Elections. In: Electronic Voting. E-Vote-ID 2024. Lecture Notes in Computer Science 15014:37–53.
Ek, Stark, Stuckey, Vukcevic (2023). Adaptively Weighted Audits of Instant-Runoff Voting Elections: AWAIRE. In: Electronic Voting. E-Vote-ID 2023. Lecture Notes in Computer Science 14230:35–51.
Ramdas, Grünwald, Vovk, Shafer (2023). Game-Theoretic Statistics and Safe Anytime-Valid Inference. Statist. Sci. 38(4):576–601.
Stark (2023). ALPHA: Audit that learns from previously hand-audited ballots. Ann. Appl. Stat. 17(1):641–679.
Wald (1945). Sequential tests of statistical hypotheses. Ann. Math. Stat. 16(2):117–186.
The coin flipping graphic was designed by Wannapik.
The following photographs were provided by the Australian Electoral Commission and licensed under CC BY 3.0:
The Higgins ballot paper (available from The Conversation) was originally provided by Hshook/Wikimedia Commons and is licensed under CC BY-SA 4.0.
The photograph of Abraham Wald is freely available from Wikipedia.
The photograph of the 18th century print is freely available from the Digital Commonwealth; the original sits at the Boston Public Library.


“Martingales”: 🎲 gambling strategies from 18th century France ♣️
These strategies cannot “beat the house”.
Martingales (in mathematics): represent the 💰 wealth over time of a gambler playing a fair game.
Test statistic: S_t, a TSM under H_0
Intrepretation:
Gambler gets rich \rightarrow evidence against H_0
Ville’s inequality: “one in a million chance of becoming a millionaire”
Let S be a non-negative random variable (S \geqslant 0).
For any \alpha > 0, \Pr\left(S \geqslant \frac{1}{\alpha}\right) \leqslant \alpha \cdot \mathbb{E}(S)
Let S = E, an e-variable. Under H_0 we have: \Pr\left(E \geqslant \frac{1}{\alpha}\right) \leqslant \alpha
Reject H_0 if E \geqslant 1 / \alpha
Markov’s inequality \Rightarrow type I error control
Note
A, B, C are e-variables
A, B, C independent \Rightarrow the product is an e-variable: E = A \cdot B \cdot C
The average is always an e-variable: E = \frac{A + B + C}{3}
(Easier than combining p-values!)
P_t = \frac{1}{E_t}
E_t > \frac{1}{\alpha} \quad \Longleftrightarrow \quad P_t < \alpha
Fixed-sample hypothesis test \longleftrightarrow confidence interval (CI)
Sequential hypothesis test \longleftrightarrow confidence sequence (CS)


Xerox bug 🐛:


Source: https://www.dkriesel.com/
Reanalysing the data with different test statistics (“betting strategies”) and only reporting the best one.
This is not safe stats.
Fundamental principle:
Declare your bet before you play.
Pre-registration is still an important tool.
However, anytime-valid methods retain flexibility even after pre-specification.