Randomization is the deliberate use of a chance mechanism to determine assignments, selections, orderings, or computational choices. In statistics, its central application is to experimental design, where treatments are assigned to experimental units according to a specified probability rule rather than investigator discretion. Randomization can also determine the order of experimental runs, helping prevent treatment comparisons from becoming entangled with time trends or other uncontrolled influences. (itl.nist.gov)
Randomization provides a probabilistic foundation for causal inference and hypothesis testing. Properly implemented random assignment prevents treatment selection from depending systematically on participants’ characteristics, but it does not guarantee identical groups in any particular experiment. Its interpretation depends on the assignment design and on distinctions between random assignment, random sampling, allocation concealment, and blinding. (hsph.harvard.edu)
Beyond experiments, randomization is used in randomized algorithms, simulation, and machine learning. These applications share the deliberate introduction of probabilistic choices, although their purposes differ: generating reference distributions, improving computational performance, or constructing diverse predictors. The subject therefore encompasses assignment mechanisms, their historical development, design-based inference, practical implementation, and computational uses. (cs.cmu.edu)
Meaning and scope
Randomization is the deliberate use of a chance mechanism to make a selection, allocation, or ordering according to a specified probability distribution. The procedure determines which outcomes are possible and their probabilities before the particular outcome is known. Examples include drawing labeled slips from a thoroughly mixed container and using computer-generated random numbers to allocate experimental treatments. “Random” therefore does not mean arbitrary: an investigator’s unexplained choice supplies no specified chance mechanism. Nor is randomization synonymous with uncontrolled variation in measurements or outcomes. In experimental design, the randomized allocation is part of the procedure, whereas random error describes variation in the observed response. (stat.berkeley.edu)
Three operations must be distinguished. Random assignment determines which treatment an experimental unit receives; random selection determines which units or objects are chosen from a larger collection; and random ordering determines the sequence in which already specified units or operations are processed. Assignment changes the relationship between units and treatments, selection changes membership, and ordering changes sequence. These operations can be combined, but none automatically implies the others. For example, specimens may first receive treatments by random assignment and then be measured in an independently randomized order. Alternatively, treatments may already be fixed, with only the measurement sequence randomized. NIST illustrates randomized run order with three treatment levels, each used twice: six labeled slips are drawn successively to determine the treatment used on each run, rather than conducting all repetitions of one level before starting the next. (stat.berkeley.edu)
The distinction between random assignment and random sampling concerns where chance enters a study. Sampling governs entry into the sample from a defined sampling frame; assignment governs treatment allocation among units already available for an experiment. In a simple random sample of 100 people from a frame of 1,000, every subset of 100 has the same selection probability, and each person has inclusion probability . By contrast, randomly allocating recruited volunteers to two treatments does not make those volunteers a random sample of a wider population. Random assignment structures the within-study comparison, while probability sampling provides a basis for quantifying sampling uncertainty in population estimates. A study can employ either procedure, both, or neither; their inferential functions remain distinct. (stat.berkeley.edu)
In computer science, randomization means incorporating generated random choices into an algorithm, rather than merely applying a deterministic algorithm to data assumed to be random. A randomized algorithm can make different internal choices on the same fixed input—for example, selecting a pivot randomly when sorting a sequence. Computational randomization also includes generating samples from specified distributions and shuffling existing sequences. Such procedures commonly use deterministic pseudorandom generators: their outputs implement the intended statistical choices, although they are not intrinsically nondeterministic. This procedural meaning separates randomization from randomness as a property of a model or phenomenon. An outcome may be modeled probabilistically without anyone having deliberately randomized it; randomization occurs when a chance-governed choice is introduced into the method itself. (cs.yale.edu)
Historical development
Ronald A. Fisher began working at the Rothamsted Experimental Station, now Rothamsted Research, in 1919 and remained there for fourteen years. Agricultural experimentation presented a practical problem: differences in crop yields could reflect fertilizers or varieties, but also differences in soil fertility between plots. Fisher’s methods connected the arrangement of treatments with the estimation of experimental error. His 1926 paper, The Arrangement of Field Experiments, described, for example, testing five varieties on thirty-five plots: either assigning seven plots to each variety wholly at random, or dividing the land into seven compact blocks and randomly assigning the five varieties within each block. Randomization, replication, and blocking thus became coordinated elements of experimental design, rather than separate precautions against unreliable observations. (rothamsted.ac.uk)
Fisher’s The Design of Experiments (1935) explained how randomization could provide the probability basis for statistical hypothesis testing. Its “lady tasting tea” illustration concerned a woman’s claim that she could distinguish whether milk or tea had been poured into a cup first. The proposed experiment used eight cups, four prepared by each method, presented in random order; the participant knew the group sizes and had to identify the four cups of one preparation. There were possible allocations of the two preparations to the eight positions. Under the null hypothesis of no discriminatory ability, random allocation made the probability of a completely correct classification , approximately . The argument rested on the experimenter’s randomized arrangement, not on assuming that the participant herself guessed randomly. Fisher used the example to show how a deliberately constructed experiment could yield an exact assessment of chance agreement. (mystatclass.com)
Jerzy Neyman developed a related but distinct approach in his 1923 Polish paper on agricultural experiments, a section of which appeared in English translation in 1990. He represented each plot as having a potential yield under each crop variety, although only the yield under the assigned variety could be observed. An urn model of sampling without replacement represented treatment allocation and supported calculations for differences between average yields. This anticipated the modern potential-outcomes framework. Whereas Fisher’s randomization tests addressed hypotheses specifying no treatment effect on any experimental unit, Neyman’s work emphasized estimating average treatment differences and assessing the repeated-randomization variability of those estimates. These questions need not coincide when effects differ between plots. Their differing formulations became prominent in the discussion of Neyman’s 1935 paper on agricultural experimentation. (mimuw.edu.pl)
Neyman also advanced probability-based survey sampling. His 1934 paper, On the Two Different Aspects of the Representative Method, contrasted stratified random sampling with purposive selection, in which investigators deliberately chose apparently representative units. He linked random sampling to population estimation and confidence intervals whose error frequencies could be assessed over repeated samples. His examples included a Polish workers’ survey that divided the country into 113 strata containing 123,383 sampling districts. This work established a parallel application of deliberate chance procedures: selecting units for population inference, rather than assigning treatments within an experiment. (stat.cmu.edu)
The British Medical Research Council’s streptomycin trial, reported on October 30, 1948, supplied a documented clinical example. It compared streptomycin plus bed rest in 55 patients with pulmonary tuberculosis against bed rest alone in 52 patients. Austin Bradford Hill prepared allocation schedules using random sampling numbers, separately for each sex at each centre. Assignments were held in sealed envelopes marked with the hospital and a number; their contents were unavailable to investigators before allocation. This combined random sequence generation with concealment intended to prevent foreknowledge from influencing admission. The trial was not the first randomized experiment: earlier clinical examples existed, but its explicit documentation of allocation safeguards made it an important example in the development of the randomized controlled trial. (samples.jbpub.com)
Assignment mechanisms and probability models
For an experiment with units and two treatment conditions, the assignment is represented by the vector , where denotes treatment and denotes control. A realized allocation is written . The assignment mechanism specifies both the permissible set and a probability distribution over that set, with . Specifying only each unit’s treatment probability is insufficient: different mechanisms can give every unit the same marginal probability while allowing different allocations or dependence between assignments. The relevant sample space comprises entire assignment vectors, not individual treatment labels. (pmc.ncbi.nlm.nih.gov)
Under independent Bernoulli assignment, each follows a Bernoulli distribution with a common probability , independently of other units. Writing , the probability of a particular vector is
Equal allocation probabilities mean , making all vectors equally likely; unequal treatment-to-control probabilities, such as , remain compatible with independent assignment. The treatment count has a binomial distribution, with expectation and variance : the target allocation ratio therefore holds in expectation, not necessarily in the realized groups. More generally, prespecified unit-specific probabilities produce . (pmc.ncbi.nlm.nih.gov)
Complete randomization instead fixes the treatment count at , leaving controls, and selects uniformly among all allocations satisfying that constraint:
The binomial coefficient counts the possible subsets of treated units. Each unit has marginal treatment probability , but assignments lack statistical independence: assigning one unit to treatment reduces the number of treatment places remaining. For example, assigning three of six units gives permissible vectors, each with probability ; six independent fair-coin assignments instead permit 64 vectors, each with probability , including allocations with an empty group. (stat.berkeley.edu)
The two mechanisms are connected through conditioning. With a common Bernoulli probability , all vectors having exactly treated units have the same probability . Conditioning on therefore gives the uniform complete-randomization distribution. This equivalence need not hold when the differ: conditioning on a fixed count generally leaves allocations unequally weighted. Restrictions must consequently specify probabilities as well as permissible assignments. (pmc.ncbi.nlm.nih.gov)
With more than two treatments, the vector records a treatment label for each unit or ordered run position. The NIST experimental-design handbook illustrates six runs with two replications of each of three treatments, , , and . Although six individually distinguishable runs have permutations, exchanging the two copies of any treatment leaves its label sequence unchanged. Thus the number of distinct sequences is
Uniformly permuting two labels of each type gives every sequence probability . The same counting principle yields assignments for treatments with fixed counts summing to . (itl.nist.gov)
Balance and restricted randomization
Randomized block designs separate two operations: forming groups of comparable experimental units and randomly allocating treatments within those groups. Blocks are defined using characteristics established before treatment, such as production batch, experimental day, or baseline disease severity. Their formation need not involve chance; randomization occurs subsequently, within each block. In a randomized complete block design, every treatment appears in every block, with equal replication. Comparisons therefore occur among units sharing the blocking characteristics, reducing the contribution of between-block variation to experimental error. Blocking addresses selected sources of variation rather than making all experimental units interchangeable. (itl.nist.gov)
In randomized controlled trials, stratification applies this principle to subsets defined by pretreatment characteristics. For example, a hypothetical study using three recruitment centers and two severity categories would have strata, with a separate allocation procedure in each. Stratification alone does not enforce numerical balance: independent coin-toss assignments within a stratum can still produce unequal group sizes. Restrictions such as fixed treatment counts or permuted blocks supply that control. Cross-classifying many characteristics creates numerous potentially sparse strata; covariate-adaptive procedures offer another way to balance selected characteristics without maintaining a separate allocation schedule for every combination. (bmj.com)
Permuted-block randomization divides an enrollment sequence into blocks containing prescribed treatment counts and randomly orders the assignments within each block. For two treatments, and , equally allocated in blocks of four, the allowable sequences are AABB, ABAB, ABBA, BAAB, BABA, and BBAA. Uniform selection gives each sequence probability . Every completed block contains two assignments to each treatment, although an incomplete final block may leave unequal totals. Block sizes can vary randomly—for example, between four and six—to make block boundaries less apparent. Fixed, known sizes can make later assignments predictable: after AAB in a four-person block, the remaining assignment must be B. Variable sizes reduce such predictability but do not replace allocation concealment. These restrictions balance treatment counts, not necessarily age, severity, or other covariates. (pmc.ncbi.nlm.nih.gov)
Covariate-adaptive allocation instead uses the characteristics of incoming participants and the accumulated assignments. In minimization, each candidate treatment is evaluated according to the imbalance that would result on selected pretreatment factors. The procedure identifies the allocation producing the smaller imbalance; a randomized version assigns that treatment with a probability greater than one-half, such as , rather than with certainty. The CONSORT 2025 explanation describes this distinction between directly choosing the minimizing allocation and using a probability weighted toward it. A deterministic balancing rule is not itself randomization, even if the initial assignment or occasional ties are resolved randomly. Thus, describing a procedure merely as “minimization” does not specify its assignment probabilities. (bmj.com)
Balance can refer either to a design constraint or to a property of the assignment actually realized. Equal treatment counts within completed blocks are an exact constraint; similarity in covariate distributions generally remains a matter of degree. Ben B. Hansen and Jake Bowers’s 2008 study, Covariate Balance in Simple, Stratified and Clustered Comparative Studies, analyzed balance through the assignment distribution, showing why observed differences must be interpreted relative to the actual design. Even exact balance on chosen categories does not imply identical values within those categories, identical joint distributions of several characteristics, or balance on unmeasured variables. Random assignment governs the probabilities of these differences; it does not universally eliminate them in a particular experiment. (arxiv.org)
Experimental units and levels of randomization
The experimental unit is the entity to which a treatment is assigned; the unit of observation is the entity on which a response is measured. These units need not coincide. A treatment may be assigned to an entire school while outcomes are recorded for individual pupils, or applied to a batch of semiconductor wafers while measurements are taken on each wafer. Recording additional observations within an assigned unit does not create additional randomized treatment assignments. Experimental units must therefore be identified from the allocation procedure, rather than simply equated with the rows in a dataset. (itl.nist.gov)
In a cluster-randomized trial, groups rather than individuals receive randomized assignments. All members of a group share its allocation, and their outcomes may also be correlated because they share environments, personnel, or other conditions. The 2012 CONSORT extension by Marion Campbell, Gilda Piaggio, Diana Elbourne, and Douglas Altman explicitly distinguishes the levels at which interventions and outcomes are defined. For equal-sized clusters containing individuals, a common model gives the variance-inflation factor , where is the intracluster correlation coefficient. For illustration, and give a factor of : individual-level observations cannot be treated as though they arose from independent individual assignments. Analysis can use cluster-level summaries or individual-level methods that account for clustering. (bmj.com)
A factorial design specifies the treatment combinations, not the mechanism assigning them to experimental units. With three factors at two levels each, a full factorial contains combinations; two replicates require 16 runs. NIST’s factorial tables list these combinations in “standard order,” explicitly a nonrandomized ordering. In an unrestricted implementation, combinations can be randomly allocated to individual units or randomized in run order. The same combinations can instead be allocated through a hierarchical procedure when some settings apply to groups of units. Thus, an identical factorial treatment table can underlie experiments with different assignment structures and different sources of uncertainty. (itl.nist.gov)
A split-plot design uses randomization at two levels. Whole-plot factors are assigned to larger units; subplot factors are assigned to smaller units within them. For a hypothetical furnace experiment, temperature could be randomized among furnace batches, while a wafer-specific preparation treatment is randomized among wafers within each batch. Temperature cannot vary independently among wafers heated together. Batch-to-batch variation consequently contributes to uncertainty about temperature effects, whereas within-batch variation supports comparisons of wafer-level treatments. The corresponding analysis of variance or mixed model distinguishes whole-plot and subplot error, rather than imposing one residual variance on every comparison. (itl.nist.gov)
NIST gives a concrete measurement hierarchy with seven monitor wafers per batch and nine measurement sites per wafer, producing 63 observations per batch. Those 63 measurements are not 63 independent replications of a batch-level treatment. Its semiconductor processing example also shows how successive batch operations can create crossed, rather than simply nested, assignment levels: eight wafers share each implant treatment, then wafers from different implant batches are regrouped into annealing batches. Implant effects, annealing effects, and interactions between the two processes correspond to distinct experimental units and error terms. The analysis must reflect these actual processing and randomization relationships, even when the treatment combinations form a conventional factorial. (itl.nist.gov)
Randomization and causal identification
For a study containing units, the potential-outcomes framework defines as unit ’s outcome under treatment and as its outcome under control. These refer to the same outcome measurement under two specified interventions, not to outcomes of two different individuals. The individual treatment effect is , and the finite-sample average treatment effect is
Only one potential outcome is observed for each unit in a parallel-group experiment; randomization does not reveal the missing counterfactual or identify each individual effect. It instead supplies a probability-governed basis for estimating an average across the study units. In design-based analysis, the potential outcomes are treated as fixed and treatment assignment as random. (arxiv.org)
Let denote assignment to treatment and assignment to control. When assignment probabilities do not depend on units’ potential outcomes, randomization establishes the exchangeability needed for causal inference. In population notation, this is expressed as independence, . If probabilities depend on a pretreatment stratum , the corresponding statement is conditional independence, . The mechanism therefore prevents systematic selection into treatment according to prognosis, including prognosis determined by unmeasured characteristics. It does not require identical characteristics in the realized groups. With stratum-dependent probabilities, an unadjusted comparison may mix treatment effects with differences in stratum composition; stratum-specific comparisons can instead be averaged using the target population’s stratum weights. (miguelhernan.org)
Under complete randomization, exactly units receive treatment and receive control, with both counts positive. Assuming observed outcomes satisfy , the difference-in-means estimator is
Every unit has treatment probability . Consequently,
Here the expectation is over permissible assignments of the same units, not over newly sampled populations. Thus the estimator is unbiased even when individual effects differ. For example, assigning 40 of 100 units to treatment gives each unit probability ; its expected contribution to the treated mean is . This is the estimation principle associated with Jerzy Neyman’s 1923 analysis of randomized experiments. (arxiv.org)
Randomization’s independence property is distinct from the other conditions connecting an observed comparison to a specified causal effect. Consistency requires that the observed outcome equal the potential outcome under the intervention actually assigned and implemented. Treatment labels must therefore specify the relevant intervention sufficiently clearly: a label that conceals materially different doses or delivery procedures may not define a single potential outcome. Positivity requires in every relevant stratum. A procedure that assigns treatment randomly in some strata but deterministically in another does not identify both treatment-specific means in that latter stratum without additional assumptions. Randomizing an offer or assignment also does not automatically identify the effect of treatment actually received when adherence differs; these are different causal contrasts. (journals.sagepub.com)
The two-outcome notation additionally assumes no interference: another unit’s assignment does not alter unit ’s outcome. If interference occurs, potential outcomes generally take the form , depending on the assignment vector rather than only on . Vaccination provides a concrete example: an unvaccinated person’s infection outcome may depend on how many contacts are vaccinated. Michael Hudgens and M. Elizabeth Halloran’s 2008 analysis developed randomized comparisons distinguishing direct, indirect, total, and overall effects under specified interference structures. Randomization remains useful in such settings, but identifying these effects requires an assignment design and assumptions that specify which other units’ treatments matter. (pmc.ncbi.nlm.nih.gov)
Randomization-based statistical inference
Randomization-based inference treats the experimental units’ potential outcomes as fixed and derives uncertainty from the treatment-assignment mechanism. Ronald Fisher’s approach, presented in 1935, tests the sharp null hypothesis for every unit . “Sharp” means that the hypothesis specifies every missing potential outcome: under no treatment effect, each unit would show its observed response whichever treatment it received. The analyst can therefore hold responses fixed, enumerate assignments permitted by the experiment, and recompute a chosen test statistic for each assignment. This produces a reference distribution without assuming normally distributed outcomes or random sampling from a larger population. (arxiv.org)
The statistic may be a difference in means, a rank sum, or a studentized contrast. Let be the allowed assignment set, its assignment probabilities, and the observed statistic. For a prespecified upper-tail test, the exact p-value is
Thus equally likely assignments are counted, whereas unequal assignment probabilities require weighting. A two-sided test can instead order assignments by . Including ties makes the p-value conservative when its distribution is discrete: “exact” denotes finite-sample validity, not necessarily a rejection probability exactly equal to every chosen significance level. (stat.berkeley.edu)
For illustration, consider four fixed responses , with exactly two units assigned to treatment. Complete randomization gives equally likely assignments. If the treated responses are , the observed mean difference is ; the six possible differences are . Applying the preceding formula gives an upper-tail p-value of and an absolute-difference two-sided p-value of . When enumeration is impractical, the Monte Carlo method draws assignments from the actual design and recomputes the statistic. If of independent simulated assignments are at least as extreme as the observed assignment, the simulation-based p-value includes the observed statistic and avoids reporting zero. Belinda Phipson and Gordon Smyth examined this finite-simulation issue in 2010; simulation uncertainty remains distinct from experimental uncertainty. (stat.berkeley.edu)
Jerzy Neyman’s 1923 framework instead emphasizes estimating the average effect . Under complete randomization, the difference in observed group means, , is unbiased, with assignment-based variance
Here and are finite-population outcome variances, and is the variance of individual effects. Because both potential outcomes cannot be observed for the same unit, is not generally identifiable. The usual estimator consequently overestimates the variance in expectation unless effects are constant. Large-sample approximations support confidence intervals and tests of . This average-effect null allows positive and negative effects to cancel; unlike Fisher’s sharp null, it does not reconstruct all missing outcomes or directly determine an exact reference distribution. (arxiv.org)
A design-based randomization test and a permutation test justified by distributional exchangeability may use identical calculations but have different foundations. Exchangeability requires the joint distribution under the null to remain unchanged by the permitted rearrangements; randomized experiments instead supply known assignment probabilities. The rearrangements must reproduce the experimental design: blocked assignments preserve treatment counts within blocks, matched pairs permit within-pair swaps, and cluster assignments move whole clusters rather than individuals. For example, independently randomized pairs allow assignments, not every pooled allocation of treated units among individuals. Unrestricted label shuffling would introduce assignments the experiment could never generate and therefore use the wrong reference distribution. (arxiv.org)
Generating and implementing random assignments
Physical draws, random-number tables, and computer-generated sequences require a rule translating their outputs into treatment assignments or experimental run orders. The NIST handbook illustrates a physical procedure with six slips of paper: two for each of three treatment levels, drawn blindly without replacement before successive runs. The resulting sequence fixes the treatment counts while randomizing their order. A computer can perform the corresponding operation by generating a random permutation of the six labeled entries. A random-number table instead supplies digits that are read according to a specified starting point, direction, and coding rule. For example, in an equal-probability, two-treatment allocation, digits 0–4 can designate A and digits 5–9 designate B; successive digits then become successive allocations. The random output is therefore an input to the assignment procedure, not an allocation schedule until the mapping has been defined. (itl.nist.gov)
Computer-generated assignments usually rely on a pseudorandom number generator, a deterministic algorithm whose internal state changes as values are produced. A seed initializes that state; it is not a fresh random event for every subsequent assignment. NumPy, for example, distinguishes a bit generator, which manages state and produces raw random values, from a Generator, which transforms those values into samples from specified distributions. Its default_rng can initialize from an explicit integer seed or, when none is supplied, from nondeterministic operating-system data. Thus a nondeterministic source can initialize a sequence whose subsequent evolution is deterministic. Reproducibility and unpredictability are different properties: an authorized analyst may reproduce a schedule while enrollment personnel remain unable to inspect it. NumPy explicitly identifies its generators as suitable for statistical modeling and simulation, not cryptographic security. Exact computational reproduction also depends on the generator and sequence of calls, not solely on the seed. (numpy.org)
In a randomized controlled trial, allocation concealment protects forthcoming assignments until participants have entered the study. Knowledge of the next treatment could otherwise influence which eligible participant is enrolled, or when enrollment occurs. Implementation mechanisms include an independent telephone allocation service, pharmacy-controlled dispensing, and sequentially numbered, opaque, sealed envelopes opened only after consent and enrollment. These arrangements restrict access to a generated schedule rather than changing its underlying probabilities. A sequence can therefore be correctly generated yet inadequately concealed if recruiting staff can consult the list or inspect the next envelope. (pmc.ncbi.nlm.nih.gov)
Blinding concerns knowledge of the treatment after assignment. Participants, care providers, outcome assessors, or analysts may be kept unaware of allocation to limit changes in behavior, care, assessment, or analysis prompted by that knowledge. Identical-looking active-treatment and placebo preparations are one mechanism; separating treatment dispensing from outcome assessment is another. Concealment and blinding consequently protect different stages of a trial. A study comparing visibly different procedures can conceal allocation during recruitment even when participants and clinicians cannot subsequently be blinded. Reports are more informative when they identify the particular people blinded and the means used, rather than merely describing a study as “double-blind.” (pmc.ncbi.nlm.nih.gov)
Documentation makes the implementation reconstructible. The CONSORT 2010 explanation specified reporting the sequence-generation method, allocation ratio, restrictions such as blocking and stratification, the concealment mechanism, and who generated the sequence, enrolled participants, and assigned interventions. One published example reproduced there used Stata 9.0, stratification by center, a 1:1 ratio, and randomly varying block sizes of 2, 4, and 6. These details distinguish the statistical design from the operational responsibilities: naming the software describes part of generation, whereas identifying an independent allocation contact and the enrollment steps describes how the schedule was put into practice. (pmc.ncbi.nlm.nih.gov)
Limitations and interpretation of randomized studies
Random assignment does not make the realized treatment groups identical. Age, baseline severity, and other pretreatment characteristics can differ by chance, particularly in small studies; equal group sizes do not imply equal prognoses. Ben B. Hansen and Jake Bowers’s 2008 analysis of covariate balance explicitly considered these differences under individual, stratified, and cluster assignment. Such imbalance is compatible with a correctly implemented design rather than, by itself, proof that randomization failed. Likewise, an unbiased estimator need not produce the true effect in a particular experiment. Under complete randomization and the usual treatment-consistency and no-interference conditions, the difference in observed group means satisfies , where the expectation averages over permissible assignments of the same units. An individual realization can nevertheless overestimate, underestimate, or reverse the sign of the effect. Its standard error and confidence interval address this finite-sample uncertainty, not a guarantee of numerical accuracy. (arxiv.org)
Nonadherence changes what the randomized comparison identifies. Participants may never start their assigned intervention, discontinue it, or receive the alternative intervention. An intention-to-treat analysis compares participants according to their original assignments, regardless of these subsequent choices. With complete outcome ascertainment, this preserves the randomized comparison and estimates the effect of assignment under the adherence conditions operating in the study—not necessarily the effect of receiving treatment continuously. Conversely, an “as-treated” comparison groups participants by treatment received, while a simple “per-protocol” comparison retains only adherent participants. Neither grouping is generally randomized: illness, adverse effects, or personal circumstances may influence both adherence and outcomes. As Miguel Hernán and James Robins explain, estimating treatment-receipt or adherence effects therefore requires additional identification assumptions and appropriate adjustment, rather than merely relabeling the original groups. (pmc.ncbi.nlm.nih.gov)
Post-assignment exclusions and missing outcomes can similarly undermine the original comparison. For example, excluding participants who discontinue treatment because their condition worsens selects a subgroup whose prognosis may differ from that of retained participants. If assignment also affects discontinuation, conditioning on retention can introduce selection bias. Missingness is not automatically biased, but randomization does not ensure that the participants with observed outcomes remain comparable. Equal percentages of missing outcomes in the two groups are insufficient: the relationship between missingness and prognosis can differ. An analysis described as intention-to-treat still needs assumptions about unobserved outcomes; retaining assignment labels does not recover missing measurements. Imputation and weighting methods depend on those assumptions, while sensitivity analyses examine how conclusions change under alternative missingness mechanisms. (pmc.ncbi.nlm.nih.gov)
Randomized assignment within a study also does not establish external validity. Recruitment, eligibility criteria, volunteering, and access to participating institutions determine who enters the trial, independently of how treatment is assigned afterward. A treatment effect among enrolled participants need not equal that in a population with different effect-modifying characteristics or different treatment delivery. In their 2019 analysis, Issa Dahabreh, James Robins, Sebastien Haneuse, and Miguel Hernán distinguished randomized treatment assignment from the conditions needed to generalize results to trial-eligible nonparticipants. Transporting an effect requires assumptions connecting participants’ and nonparticipants’ potential outcomes, adequate representation of relevant population subgroups, and information about the target population. Additional monitoring or services associated with trial participation can themselves complicate this comparison. (arxiv.org)
Predictable or manipulated allocation represents an implementation failure, not an inherent consequence of chance imbalance. A genuinely random allocation list can lose its protection against selection if recruiters can see forthcoming assignments and use them to decide whom to enroll or when to enroll them. Andrew Vickers’s 2006 account illustrated this problem with an allocation list displayed where investigators could consult it before registering patients. Systematic alternation—assigning successive participants to A, B, A, B—is likewise not randomization: the next assignment is predetermined. Investigator choice is another allocation mechanism altogether. These procedures can create systematic differences between groups even when their final sizes are exactly equal; numerical balance cannot substitute for probability-governed assignment implemented without selective enrollment. (pmc.ncbi.nlm.nih.gov)
Randomization in computation and machine learning
A randomized algorithm uses probability-governed choices during execution, so its running time or output can vary even when its input is fixed. The distinction between Las Vegas and Monte Carlo procedures concerns what randomness is allowed to affect. A Las Vegas algorithm returns a correct answer, but its running time is random and is commonly bounded in expectation. A Monte Carlo algorithm has a specified running-time bound but permits an error probability: for every input , an algorithm computing may satisfy . These probabilities refer to the algorithm’s internal choices, not to a presumed distribution of inputs. Independent repetition can improve success probabilities, although the appropriate method of combining results depends on whether errors are one-sided, two-sided, or associated with an optimization objective. (cs.cmu.edu)
Randomized quicksort illustrates the Las Vegas approach. At each recursive step, it selects a pivot uniformly from the current subarray, partitions elements by comparison with that pivot, and recursively sorts the resulting parts. Every pivot sequence produces a correctly sorted result; randomization changes the amount of work. For any fixed input of distinct elements, its expected number of comparisons is , although unfavorable pivot choices can still produce quadratic work. In the standard analysis, elements with sorted ranks are compared with probability ; summing these probabilities establishes the expected bound. This is different from analyzing a deterministic pivot rule under the assumption that input order is random: the randomized algorithm’s guarantee applies separately to every fixed input. (cs.cmu.edu)
In mathematical optimization, randomized rounding converts fractional solutions into discrete decisions. After relaxing binary constraints to , a basic procedure independently sets with probability , and otherwise sets . Thus , and a linear objective satisfies . For example, a fractional selection value of becomes a 30% probability of including the corresponding object, rather than being deterministically rounded to zero. Preserving an objective or constraint in expectation does not ensure that each realized solution is feasible. Algorithms therefore use problem-specific scaling, probability bounds, repetition, or repair steps to control constraint violations and establish approximation guarantees. (cs.cmu.edu)
Computational simulation instead uses generated samples to represent a specified probability distribution and approximate numerical quantities. NumPy’s random-sampling interface, for example, provides pseudorandom samples from multiple distributions. In a basic Monte Carlo method, independent samples approximate through . If has finite variance , the estimator has variance , giving a standard error of ; reducing this error tenfold requires one hundred times as many samples. Here randomization generates numerical inputs to a model rather than assigning experimental treatments: the uncertainty describes numerical approximation under that model. (numpy.org)
In machine learning, random forests embed randomization in tree construction. Leo Breiman’s 2001 formulation describes tree predictors governed by independently sampled random vectors. In his implementation combining bootstrap sampling and random feature selection, each tree is trained on a sample drawn with replacement from the original training data, and each node searches for a split among a randomly selected subset of features. Classification combines the trees by voting. Random feature restrictions can reduce similarity between trees, but can also weaken individual predictors. Breiman’s analysis relates generalization error to strength, defined through the ensemble’s expected classification margin, and average correlation between tree margin functions. The mechanism therefore seeks lower correlation while maintaining strength, rather than merely maximizing randomness; independently generated construction choices do not imply statistically independent predictions from trees sharing the same training data. (mfm.uchicago.edu)
Reproducibility and quality of computational randomness
Exact reproducibility of a pseudorandom computation depends on more than recording a seed. The seed initializes a pseudorandom number generator, but the resulting sequence also depends on the generator algorithm, initialization procedure, and subsequent calls. NumPy’s compatibility policy specifies the same BitGenerator, seed, sequence of method calls and arguments, software build, environment, and machine as conditions for reproducing a stream. Arguments include the number of values requested: five calls to rng.random() are not guaranteed to match one call to rng.random(5), because implementations may use different algorithms for different block sizes. Moreover, identical random inputs do not necessarily produce identical downstream numerical results. NumPy documents that changing the LAPACK library used for matrix decomposition can change outputs from multivariate_normal, even when the seed remains unchanged. (numpy.org)
Compatibility of a software interface is therefore distinct from compatibility of its random-number stream. Robert Kern’s NumPy Enhancement Proposal 19, created on May 24, 2018, proposed relaxing the earlier policy of preserving distribution outputs across versions, which had obstructed faster or more accurate sampling algorithms. The proposal separated the core bit generator from the routines that transform its output into samples from particular probability distributions. It also identified preservation of the software environment—not an isolated seed—as the basis for bit-for-bit replication of an entire computation. Explicit generator objects make dependencies clearer than shared global random state, whose consumption can be altered by unrelated functions or concurrent execution. (numpy.org)
In parallel computing, initializing every worker with the same generator and seed reproduces the same stream rather than supplying separate realizations. Stream spawning addresses this unintended reuse by deriving distinct child states from a root initialization. In NumPy 2.2, SeedSequence mixes the original seed with each child’s position in a spawning tree; children can themselves spawn further streams. For example, SeedSequence(12345).spawn(10) creates ten child initializations for separate generators. The default mixing pool contains 128 bits, and the documentation gives a conservative collision-probability estimate of approximately for spawned streams: for about streams, this is approximately . These are probabilistic safeguards, not an unconditional mathematical guarantee of independence. Replaying a parallel calculation also requires preserving how the child streams are assigned to computational tasks. (numpy.org)
Statistical suitability and cryptographic suitability impose different requirements. Simulation generators supply deterministic sequences intended to behave as random samples for modeling; cryptography additionally requires protection against prediction by an adversary. NumPy explicitly states that its generators are designed for statistical modeling and simulation and are unsuitable for security or cryptographic purposes. Its documentation directs security-sensitive applications to Python’s secrets module. Seeding a simulation generator with nondeterministic operating-system data changes its initialization, but does not convert the underlying algorithm into a cryptographically secure generator. Thus, a source of unpredictable seed material and an unpredictable output-generation mechanism are separate components. (numpy.org)
Exact sequence replication also differs from statistical reproducibility across new realizations of a randomized procedure. Replaying one seed can reproduce a particular result without establishing its stability under fresh draws. In their 2019 study of simulation methodology, Tim P. Morris, Ian R. White, and Michael J. Crowther emphasized quantifying uncertainty from finitely many simulation repetitions through Monte Carlo standard errors. For example, if independent repetitions yield an estimated success proportion , its estimated Monte Carlo standard error is . At and , this is about , or 0.218 percentage points. Different streams can therefore produce different estimated performance measures while remaining consistent within simulation uncertainty; identical outputs and statistically compatible findings answer different reproducibility questions. (doi.org)
References
- 3.3.1. Completely randomized designsitl.nist.gov
- SticiGui Samplingstat.berkeley.edu
- SticiGui Experimentsstat.berkeley.edu
- RandomizedAlgorithmscs.yale.edu
- Random sampling — NumPy v2.5 Manualnumpy.org
- Statement on R A Fisherrothamsted.ac.uk
- Contribution to the Discussion of: “Interpreting Blocks and Random Factors”digicoll.lib.berkeley.edu
- Statistics and the Design of Experimentsmystatclass.com
- On the Application of Probability Theory to Agricultural Experiments. Essay on Principles. Section 9.mimuw.edu.pl
- Neymanian inference in randomized experimentsarxiv.org
- Comments on the Neyman-Fisher Controversy and Its Consequencesarxiv.org
- On the Two Different Aspects of the Representative Method: The Method of Stratified Sampling and the Method of Purposive Selectionstat.cmu.edu
- On the Two Different Aspects of the Representative Method: The Method of Stratified Sampling and the Method of Purposive Selectionerrorstatistics.com
- Essentials of Epidemiology, Chapter 1samples.jbpub.com
- Why the 1948 MRC trial of streptomycin used treatment allocation based on random numberspmc.ncbi.nlm.nih.gov
- Randomization-based inference for Bernoulli trial experiments and implications for observational studiespmc.ncbi.nlm.nih.gov
- Statistics 240 Lecture Notes, Chapter 3stat.berkeley.edu
- Berkeley Statistics Technical Report 809statistics.berkeley.edu
- 3.3.2. Randomized block designsitl.nist.gov
- CONSORT 2010 Explanation and Elaboration: updated guidelines for reporting parallel group randomised trialspmc.ncbi.nlm.nih.gov
- Covariate Balance in Simple, Stratified and Clustered Comparative Studiesarxiv.org
- A Glossary of DOE Terminologyitl.nist.gov
- Two-level full factorial designsitl.nist.gov
- How can I account for nested variation (restricted randomization)?itl.nist.gov
- A paradox from randomization-based causal inferencearxiv.org
- Causal Inference: What Ifmiguelhernan.org
- Neymanian inference in randomized experimentsarxiv.org
- Defining and Identifying Per-Protocol Effects in Randomized Trialspmc.ncbi.nlm.nih.gov
- Toward Causal Inference With Interferencepmc.ncbi.nlm.nih.gov
- Statistics 240 Lecture Notes: The randomization modelstat.berkeley.edu
- A Paradox From Randomization-Based Causal Inferencearxiv.org
- Permutation P-values Should Never Be Zero: Calculating Exact P-values When Permutations Are Randomly Drawngksmyth.github.io
- Exact testing with random permutationspmc.ncbi.nlm.nih.gov
- Completely randomized designsitl.nist.gov
- Compatibility policy — NumPy Manualnumpy.org
- Selection of Control, Randomization, Blinding, and Allocation Concealmentpmc.ncbi.nlm.nih.gov
- Covariate Balance in Simple, Stratified and Clustered Comparative Studiesarxiv.org
- Beyond the intention to treat in comparative effectiveness researchpmc.ncbi.nlm.nih.gov
- Randomized trials with missing outcome data: how to analyze and what to reportpmc.ncbi.nlm.nih.gov
- Generalizing causal inferences from randomized trials: counterfactual and graphical identificationarxiv.org
- How to randomizepmc.ncbi.nlm.nih.gov
- Great Ideas in Theoretical Computer Science: Course Notescs.cmu.edu
- Randomized Algorithms: Probability Basics and Randomized Quicksortcs.cmu.edu
- The Probabilistic Methodcs.cmu.edu
- Monte Carlo Approximationmath.cmu.edu
- Random Forestsmfm.uchicago.edu
- Compatibility policy — NumPy v2.2 Manualnumpy.org
- NEP 19 — Random number generator policynumpy.org
- Parallel random number generation — NumPy v2.2 Manualnumpy.org