# cupy.random.binomial¶

cupy.random.binomial(n, p, size=None, dtype=<class 'int'>)[source]

Binomial distribution.

Returns an array of samples drawn from the binomial distribution. Its probability mass function is defined as

$f(x) = \binom{n}{x}p^x(1-p)^{n-x}.$
Parameters
• n (int) – Trial number of the binomial distribution.

• p (float) – Success probability of the binomial distribution.

• size (int or tuple of ints) – The shape of the array. If None, a zero-dimensional array is generated.

• dtype – Data type specifier. Only numpy.int32 and numpy.int64 types are allowed.

Returns

Samples drawn from the binomial distribution.

Return type

cupy.ndarray