This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
Section: 18.104.22.168.4 [rand.dist.bern.negbin] Status: C++17 Submitter: Stephan T. Lavavej Opened: 2014-06-14 Last modified: 2017-08-01
View all issues with C++17 status.
22.214.171.124.4 [rand.dist.bern.negbin] p2 requires "0 < p <= 1". Consider what happens when p == 1. The discrete probability function specified by p1 involves "* p^k * (1 - p)^i". For p == 1, this is "* 1^k * 0^i", so every integer i >= 0 is produced with zero probability. (Let's avoid thinking about 0^0.)Wikipedia states that p must be within (0, 1), exclusive on both sides. Previous resolution [SUPERSEDED]:
Change 126.96.36.199.4 [rand.dist.bern.negbin] p2 as indicated: [Drafting note: This should be read as: Replace the symbol "≤" by "<" — end drafting note]explicit negative_binomial_distribution(IntType k = 1, double p = 0.5);
-2- Requires: 0 < p
≤1 and 0 < k.
SG6 suggests better wording.
Moved to Ready with the node.
There remains concern that the constructors are permitting values that may (or may not) be strictly outside the domain of the function, but that is a concern that affects the design of the random number facility as a whole, and should be addressed by a paper reviewing and addressing the whole clause, not picked up in the issues list one distribution at a time. It is still not clear that such a paper would be uncontroversial.
This wording is relative to N4140.
Add a note after paragraph 1 before the synopsis in 188.8.131.52.4 [rand.dist.bern.negbin]:
A negative_binomial_distribution random number distribution produces random integers distributed according to the discrete probability function
Drafting note: should be in math font, and p == 1 should be in code font.