bundles / scipy 1.18.0 / scipy / stats / _stats_py / _count_paths_outside_method
function
scipy.stats._stats_py:_count_paths_outside_method
source: /scipy/stats/_stats_py.py:7751
Signature
def _count_paths_outside_method(m, n, g, h)Summary
Count the number of paths that pass outside the specified diagonal.
Parameters
m: intm > 0
n: intn > 0
g: intg is greatest common divisor of m and n
h: int0 <= h <= lcm(m,n)
Returns
p: floatThe number of paths that go low. The calculation may overflow - check for a finite answer.
Notes
Count the integer lattice paths from (0, 0) to (m, n), which at some point (x, y) along the path, satisfy: m*y <= n*x - h*g The paths make steps of size +1 in either positive x or positive y directions.
We generally follow Hodges' treatment of Drion/Gnedenko/Korolyuk. Hodges, J.L. Jr., "The Significance Probability of the Smirnov Two-Sample Test," Arkiv fiur Matematik, 3, No. 43 (1958), 469-86.
Aliases
scipy.stats._stats_py._count_paths_outside_method