def cumulative_distribution(distribution):
 cdf = [0.0]
 psum = float(sum(distribution))
 for i in range(0, len(distribution)):
  cdf.append((cdf[i] + (distribution[i] / psum)))
 return cdf

def cumulative_distribution ( distribution ) : cdf = [ 0.0 ] psum = float ( sum ( distribution ) ) for i in range ( 0 , len ( distribution ) ) : cdf . append ( ( cdf [ i ] + ( distribution [ i ] / psum ) ) ) return cdf
return cumulative distribution function for the given image .