BINOMDIST
- BINOMDIST(number_s, trials, probability_s, cumulative)[source]
Calculates the binomial distribution probability mass (PMF) or cumulative distribution (CDF).
BINOMDIST evaluates either the probability mass function (PMF) or the cumulative distribution function (CDF) of the binomial distribution for the given input(s).
- Parameters:
number_s (
Operand|int|float) –The number of successes in the trials.
Supported types:
INTEGER
DECIMAL
INTEGER_ARRAY
DECIMAL_ARRAY
trials (
Operand|int|float) –The number of independent trials.
Supported types:
INTEGER
DECIMAL
INTEGER_ARRAY
DECIMAL_ARRAY
probability_s (
Operand|int|float) –The probability of success on each trial (must be between 0 and 1).
Supported types:
INTEGER
DECIMAL
INTEGER_ARRAY
DECIMAL_ARRAY
cumulative (
Operand|bool) –Boolean flag to determine calculation type:
False / 0: PMF
True / 1: CDF
Supported types:
BOOLEAN
BOOLEAN_ARRAY
- Return type:
- Returns:
A formula object evaluating to the binomial distribution value(s).
Returns DECIMAL if all inputs are scalar
Returns DECIMAL_ARRAY if any input is an array
Supported types:
DECIMAL
DECIMAL_ARRAY
- Raises:
ValueError – If number_s, trials, or probability_s are not numeric types
ValueError – If cumulative is not boolean-compatible
Examples
Probability mass function (PMF):
BINOMDIST(3, 10, 0.5, False) # Returns the probability of exactly 3 successes in 10 trials
Cumulative distribution function (CDF):
BINOMDIST(3, 10, 0.5, True) # Returns the probability of at most 3 successes in 10 trials
Array inputs:
BINOMDIST(my_table["successes"], 10, 0.5, True) # Returns an array of CDF values for each row