#sum of three independent random variables (X, Y, T)
# Z = X + Y
# W = Z + T
# Fz(z)=E[Fy(z-X)]
# Fw(w)=E[Fz(w-T)]
aa(x) = (x**3)/6.0
bb(x) = -(x**3)/3.0 + 3*x*x/2.0 - 3*x/2.0 + 1/2.0
cc(x) = (x**3)/6.0 - 3*x*x/2.0 + 9*x/2.0 - 7/2.0
distrib(x)= (x<0) ? 0 : (x<1) ? aa(x) : (x<2) ? bb(x) : (x<3) ? cc(x) : 1
set xtics 1
set ytics 5
set grid
set key off
set xlabel "Evocations"
set ylabel "Success chance (%)"
set terminal png
set output "rage_evoc.png"
plot [0:27] 100*(1-distrib((50-2*x)*3/100)) with lines lw 1.3
#pause -1