Skip to main content

MIN_SAMPLES

Constant MIN_SAMPLES 

Source
pub const MIN_SAMPLES: usize = 6;
Expand description

How many samples a side needs before a comparison will call anything.

Six, and the reason is exact rather than a rule of thumb. The distribution-free interval for a median is a pair of order statistics, and the widest one available is the whole range: [min, max] fails to cover the true median only when every sample falls on the same side of it, which for n samples has probability 2 * (1/2)^n. Asking for 95% confidence therefore asks for 2^(n-1) >= 20, which first holds at n = 6. Below six samples there is no 95% statement to be made about one median, let alone about the difference of two, so a comparison that made one would be inventing it.

This is a floor and not a recommendation. docs/VM_ARCHITECTURE.md takes its tables at fifteen.