-- Draw pdf and cdf for electron-positron annihilation N = 12 -- number of bins pi = float(pi) -- use numerical value of pi a = pi / N I = 2 cos(theta) + 2 log(1 - cos(theta)) - 2 log(1 + cos(theta)) F = (I - eval(I,theta,a)) / (eval(I,theta,pi-a) - eval(I,theta,a)) f = d(F,theta) "Probability density function" xrange = (0,pi) yrange = (0,1) draw(f,theta) "Cumulative distribution function" xrange = (0,pi) yrange = (0,1) draw(F,theta) "Bin probability (first and last not observed)" P = zero(N) for(k,2,N-1, P[k] = eval(F,theta,k pi/N) - eval(F,theta,(k-1) pi/N)) h(x) = test(x <= 0, 0, x > N, 0, P[ceiling(x)]) xrange = (0,N) yrange = (0,1) draw(h,x)
Run