Expand description

Stochasta aims to be a simple stochastic analysis library.

Example

use stochasta::CardDeck;
use stochasta::Probability;

let coin = CardDeck::from(vec!["heads", "tails"]);

assert_eq!(coin.size(), 2);
assert_eq!(coin.probability(&"heads"), Probability::new(1, 2));
assert_eq!(coin.probability(&"tails"), Probability::new(1, 2));

More examples may be found under the examples directory.

Modules

Optional module for providing standard playing cards.

Structs

A deck of cards.
A representation of a sequence of drawn cards.
A representation of a card drawing process.
A probability is a rational number (ℚ) in the range of 0 and 1 (both inclusive).

Enums

Errors that may happen when trying to create a probability.

Constants

A probability of 100%.
A probability of 0%.