A projection maps each input to a chosen output. For a discrete distribution, it samples the underlying distribution, applies a function, and returns the mapped value. Several inputs may collapse into one output, so the projected support can be smaller. section 12.7
Projection changes more than the displayed labels: it recomputes each output’s weight by grouping all underlying inputs that map to it, summing their weights, and reducing them by their greatest common divisor. A one-value result can become a singleton distribution. section 12.7
The same operation composes naturally with other finite-distribution machinery:
- Map die faces to categories to create an unfair categorical distribution. section 12.7
- Form a joint distribution of independent rolls, then project each pair to its maximum, minimum, or another aggregate. section 13.5
- Add a projection after a Cartesian product to return a derived value instead of a tuple. section 6.4
Turning six faces into three colors
Assign the six faces of a fair die the labels green, blue, red, blue, red, blue. Projection merges the six equally weighted inputs into green:1, blue:3, and red:2, producing a three-category unfair die. section 12.7
var advantage = d20.ToJoint(_ => d20)
.Project(pair => Math.Max(pair.Item1, pair.Item2));
Console.WriteLine(advantage.ShowWeights());
Projecting the joint distribution of two d20 rolls onto their larger value models rolling with advantage; the resulting weights rise from 1 for a 1 to 39 for a 20. section 13.5





