Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/numeric/random/bernoulli distribution"

From cppreference.com
< cpp‎ | numeric‎ | random
(fmt)
(place that space here)
Line 7: Line 7:
 
Produces random boolean values, according to the discrete probability function. The probability of {{cpp|true}} is  
 
Produces random boolean values, according to the discrete probability function. The probability of {{cpp|true}} is  
  
:{{math|P(b{{!}}p) {{=}}}}{{mparen|{||{{math|p}} if {{cpp| b {{==}} true}} | {{math|1 − p}} if {{cpp|b {{==}} false}}|style=text-align:right}}
+
:{{math|P(b{{!}}p) {{=}}}}{{mparen|{||{{math|p}} if {{cpp|b {{==}} true }} | {{math|1 − p}} if {{cpp|b {{==}} false}}|style=text-align:right}}
  
 
===Member types===
 
===Member types===

Revision as of 08:29, 21 January 2012

Template:cpp/numeric/random/bernoulli distribution/sidebar

Defined in header <random>
class bernoulli_distribution;
(since C++11)

Produces random boolean values, according to the discrete probability function. The probability of Template:cpp is

P(b|p) =

p if Template:cpp
1 − p if Template:cpp

Contents

Member types

Template:tdcl list begin Template:tdcl list hitem Template:tdcl list item Template:tdcl list item Template:tdcl list end

Member functions

Template:cpp/numeric/random/distribution/dcl list constructorTemplate:cpp/numeric/random/distribution/dcl list resetTemplate:cpp/numeric/random/distribution/dcl list operator()Template:cpp/numeric/random/bernoulli distribution/dcl list pTemplate:cpp/numeric/random/distribution/dcl list paramTemplate:cpp/numeric/random/distribution/dcl list minTemplate:cpp/numeric/random/distribution/dcl list max
Generation
Characteristics

Non-member functions

Template:cpp/numeric/random/distribution/dcl list operator cmpTemplate:cpp/numeric/random/distribution/dcl list operator ltltgtgt

Example

Template:example cpp