mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-10 17:28:40 +00:00
This commit is contained in:
parent
250f64556d
commit
a480f4712f
|
|
@ -27,6 +27,8 @@ final class GeometricDistribution
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
|
* Example: dice roll
|
||||||
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @codeCoverageIgnore
|
* @codeCoverageIgnore
|
||||||
*/
|
*/
|
||||||
|
|
@ -34,6 +36,14 @@ final class GeometricDistribution
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* How often to roll to get a specific value with at least percent chance
|
||||||
|
*/
|
||||||
|
public static function getHowOften(float $p, float $percent) : float
|
||||||
|
{
|
||||||
|
return log(1.0 - $percent) / log(1 - $p);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get probability mass function.
|
* Get probability mass function.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user