cunumeric.random.hypergeometric#

cunumeric.random.hypergeometric(ngood, nbad, nsample, size=None)#

Draw samples from a Hypergeometric distribution.

Samples are drawn from a hypergeometric distribution with specified parameters, ngood (ways to make a good selection), nbad (ways to make a bad selection), and nsample (number of items sampled, which is less than or equal to the sum ngood + nbad).

Parameters:
  • ngood (int) – Number of ways to make a good selection. Must be nonnegative.

  • nbad (int) – Number of ways to make a bad selection. Must be nonnegative.

  • nsample (int) – Number of items sampled. Must be at least 1 and at most ngood + nbad.

  • size (int or tuple of ints, optional) – Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned.

Returns:

out – Drawn samples from the parameterized hypergeometric distribution. Each sample is the number of good items within a randomly selected subset of size nsample taken from a set of ngood good items and nbad bad items.

Return type:

ndarray or scalar

Availability:

Multiple GPUs, Multiple CPUs