categorical
This crate provides a type representing a categorical probability distribution: Categorical<T,P>.
A Categorical is a collection of objects of type T, each associated with a probability of type P.
You can combine two Categoricals and compute the probability of each combination (assuming the two distributions are sampled independently).
use ;
let die_roll = new_uniform;
// roll two dice and pick the higher number
let max_of_two = combined;
let double_wins: f64 =
combined
.probability_of;
println!;
License: MIT OR Apache-2.0