src/Probability/Distribution/Discrete/Uniform.php
public function cdf(int $k): float
    {
        $a = $this->a;
        $b = $this->b;

        if ($k < $a) {
            return 0;
        }
        if ($k > $b) {
            return 1;
        }

        $n = $b - $a + 1;

        return ($k - $a + 1) / $n;
    }
public function cdf(int $k): float
    {
        $a = $this->a;
        $b = $this->b;

        if ($k < $a) {
            return 0;
        }
        if ($k > $b) {
            return 1;
        }

        $n = $b - $a + 1;

        return ($k - $a + 1) / $n;
    }
public function cdf ( int $ k ) : float { $ a = $ this -> a ; $ b = $ this -> b ; if ( $ k < $ a ) { return 0 ; } if ( $ k > $ b ) { return 1 ; } $ n = $ b - $ a + 1 ; return ( $ k - $ a + 1 ) / $ n ; }
Cumulative distribution function

k - a + 1
pmf = ---------
n

Percentile n = b - a + 1

@param int $k percentile

@return float
Cumulative distribution function