The auxiliary-unary distribution #
This module exposes the exact sampler shape and counting theory for Hirahara's
uniform distribution with auxiliary unary input. At positive parameter m, a
sample is pair x (List.replicate t true) for uniform t ∈ {1, ..., m} and
uniform x ∈ {0,1}^{m-t}.
The selected binary length is strictly below every positive slice parameter.
The retained binary component has the selected length.
The unary component fills the remainder of the size parameter.
The auxiliary unary clock is nonempty on every positive slice.
The two decoded component lengths sum to the slice parameter.
The mth seed space contains max 1 m * 2^m equiprobable seeds.
The joint seed event selecting binary length n and fixed prefix x has
probability exactly 1 / (m * 2^n).
A seed produces a specified canonical auxiliary-unary pair exactly when it selects the pair's binary length and binary contents.
Exact mass of a fixed auxiliary-unary input. For n < m, every
pair x 1^(m-n) with |x| = n has probability 1 / (m * 2^n).