def williams_correction(n, a, G):
 q = (1.0 + ((a + 1.0) / (6.0 * n)))
 return (G / q)

def williams_correction ( n , a , G ) : q = ( 1.0 + ( ( a + 1.0 ) / ( 6.0 * n ) ) ) return ( G / q )
return the williams corrected g statistic for g goodness of fit test .