pub struct Binomial { /* private fields */ }
Expand description
The binomial distribution Binomial(n, p)
.
This distribution has density function:
f(k) = n!/(k! (n-k)!) p^k (1-p)^(n-k)
for k >= 0
.
§Example
use rand_distr::{Binomial, Distribution};
let bin = Binomial::new(20, 0.3).unwrap();
let v = bin.sample(&mut rand::thread_rng());
println!("{} is from a binomial distribution", v);
Implementations§
Trait Implementations§
Source§impl Distribution<u64> for Binomial
impl Distribution<u64> for Binomial
impl Copy for Binomial
Auto Trait Implementations§
impl Freeze for Binomial
impl RefUnwindSafe for Binomial
impl Send for Binomial
impl Sync for Binomial
impl Unpin for Binomial
impl UnwindSafe for Binomial
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes