|
  
brand
Format: brand( probability, trials )
Arguments: (real) probability Optional
probability of success per trial; default = 0.5
(int) trials Optional number of trials;
default = 1
Returns: (int) Pseudo-random number drawn from a
Binomial distribution
Description: Numbers returned by the brand
primitive represent the number of successes in an experiment
given the probability of an individual success and the number of
trials. For example, the number of times heads comes up when you
flip a coin 10 times. The result returned by brand is
always an integer between 0 and the number of trials.
When trials = 1, brand returns a number form a
Bernoulli distribution.
Examples: brand = random
integer equally likely to be 0 or 1
brand(80%) = random integer 0
or 1 with an 80% chance of being a 1
brand(0.5,10) = random integer
representing the number of heads when a coin is flipped 10 times,
PDF graphed below
See Also: rand, drand, trand, nrand, lrand, prand, grand, betarand, crand, setrand, correlate
|