A uniform distribution gives every outcome the same probability in a finite set, or equal probability density across a specified continuous interval. The distinction matters operationally: discrete distributions assign probability to values, while continuous densities assign probability through integration over ranges. section 2.1.7
A continuous uniform(0, 1) variable can turn randomness into an explicit deterministic assignment. Draw a value, compare it with a probability threshold, and return the corresponding outcome. section 6.2.1
Stick-breaking simulation
Partition a one-meter stick into regions whose lengths match the target probabilities. For a coin with an 80% heads probability, draw 0.15 from uniform(0, 1); because 0.15 falls in the first 80% of the stick, return heads. Repeated draws produce heads about 80% of the time. Formally, draw nᵧ ~ Uniform(0, 1) and assign y := I(nᵧ ≤ pₓ), where pₓ is the selected coin’s heads probability. section 6.2.1
Figure 6.8 Generate from a uniform distribution on 0 to 1 meters, break the stick at that point, and return the outcome associated with the region where the break occurred. Repeated generation of uniform variates will cause breaks in the “heads” region 80% of the time, because its length is 80% of the full stick length.
Shows how interval length, uniform sampling, and repeated breaks realize categorical probabilities. section 6.2.1








