41 lines
750 B
Plaintext
41 lines
750 B
Plaintext
|
|
{{alias}}( n, p )
|
|
Returns the expected value of a binomial distribution.
|
|
|
|
If provided `NaN` as any argument, the function returns `NaN`.
|
|
|
|
If provided a number of trials `n` which is not a nonnegative integer, the
|
|
function returns `NaN`.
|
|
|
|
If `p < 0` or `p > 1`, the function returns `NaN`.
|
|
|
|
Parameters
|
|
----------
|
|
n: integer
|
|
Number of trials.
|
|
|
|
p: number
|
|
Success probability.
|
|
|
|
Returns
|
|
-------
|
|
out: number
|
|
Expected value.
|
|
|
|
Examples
|
|
--------
|
|
> var v = {{alias}}( 100, 0.1 )
|
|
10.0
|
|
> v = {{alias}}( 20, 0.5 )
|
|
10.0
|
|
> v = {{alias}}( 10.3, 0.5 )
|
|
NaN
|
|
> v = {{alias}}( 20, 1.1 )
|
|
NaN
|
|
> v = {{alias}}( 20, NaN )
|
|
NaN
|
|
|
|
See Also
|
|
--------
|
|
|