CakeFest 2024: The Official CakePHP Conference

stats_dens_pmf_hypergeometric

(PECL stats >= 1.0.0)

stats_dens_pmf_hypergeometricВероятностная мера гипергеометрического распределения

Описание

stats_dens_pmf_hypergeometric(
    float $n1,
    float $n2,
    float $N1,
    float $N2
): float

Возвращает вероятностную меру для n1, где n2, N1 и N2 являются количеством неудачных попыток, числом успешных выборок и числом неудачных выборок соответственно.

Список параметров

n1

Число успешных попыток, при которых вычисляется вероятностная мера

n2

Количество неудачных попыток

N1

Число успешных выборок

N2

Число неудачных выборок

Возвращаемые значения

Вероятностная мера для n1 или false в случае возникновения ошибки.

add a note

User Contributed Notes 1 note

up
0
brendan at gamblingtec dot com
4 years ago
You can use this method to work out lottery odds:

/**
* N is the population size OR total balls in the lottery draw
* K is the number of success states in the population OR the number of correct balls drawn from the pool
* n is the number of draws OR the number of times we draw from the pool to get the winning numbers.
*/

$N = 49; //Total balls in the pool
$K = 1; //Successful matches to win

$method = new Hypergeometric($N, $K, $K);
$odds = $method->pmf($K);

return 1/$odds;

//Will return 49
To Top