number of trials
success probability
entropy
var v = entropy( 100, 0.1 );
// returns ~2.511
var v = entropy( 20, 0.5 );
// returns ~2.223
var v = entropy( 10.3, 0.5 );
// returns NaN
var v = entropy( 20, 1.1 );
// returns NaN
var v = entropy( 20, NaN );
// returns NaN
Returns the entropy of a binomial distribution.
Notes
n
which is not a nonnegative integer, the function returnsNaN
.p < 0
orp > 1
, the function returnsNaN
.