rust-random / rust-random/rand
Implement an exact Bernoulli distribution
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 512
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 7
Description
Background
The current implementation has a probability limit of 1 / (2^32-1) for the integer constructor and a limit of 1 / (2^64) for the f64 constructor. Assuming a couple nanoseconds per flip, the former's precision limitation could become visible even with only a single core in a matter of seconds. The latter is certainly more robust, taking at least a thousand or so processor-years, but even then distributed computing environments could conceivably reach this precision limitation within a few months.
Feature request
Implement an exact Bernoulli distribution. I have created an implementation which I'd be glad to send out a PR to integrate. Mostly looking for feedback if that is desirable before doing so.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named in the issue. Start by reading the current integer and f64 Bernoulli constructors, then compare the linked Popog/bernoulli implementation with rand's existing API; done means an exact Bernoulli distribution is integrated after the design is agreed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100