Skip to content

Add Bernoulli distribution #300

@dhardy

Description

@dhardy

Add a Bernoulli distribution (i.e. boolean with probability p).

This is basically just rng.gen() < p, but the uniform distribution used to generate a float has precision limited to ε (smallest representable number above 1); we can do better.

We may decide not to implement this as a distribution but with a simple function calling rng.sample(HighPrecision01) < p or similar.

See also #293: add Rng::gen_bool or similar

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyParticipation: easy jobF-new-intFunctionality: new, within Rand

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions