scipy.special.bdtrin(k, y, p, out=None) = <ufunc 'bdtrin'>#

Inverse function to bdtr with respect to n.

Finds the number of events n such that the sum of the terms 0 through k of the Binomial probability density for events with probability p is equal to the given cumulative probability y.


Number of successes (float).


Cumulative probability (probability of k or fewer successes in n events).


Success probability (float).

outndarray, optional

Optional output array for the function values

nscalar or ndarray

The number of events n such that bdtr(k, n, p) = y.

See also



Formula 26.5.24 of [1] is used to reduce the binomial distribution to the cumulative incomplete beta distribution.

Computation of n involves a search for a value that produces the desired value of y. The search relies on the monotonicity of y with n.

Wrapper for the CDFLIB [2] Fortran routine cdfbin.



Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972.


Barry Brown, James Lovato, and Kathy Russell, CDFLIB: Library of Fortran Routines for Cumulative Distribution Functions, Inverses, and Other Parameters.