mtalg.random.binomial

binomial(n: Number, p: Number, size: int | tuple | None = None) ndarray | Number[source]

Draw from a binomial distribution.

Parameters:
  • n – Parameter of the distribution, >= 0. Floats are also accepted, but they will be truncated to integers.

  • p – Parameter of the distribution, >= 0 and <=1.

  • size – Output shape.

Returns:

numpy.ndarray or scalar.