% eda12_01
% distribution of square of a random variable

L=101;
emin=0.01;
emax=3;
De=(emax-emin)/(L-1);
e=emin+De*[0:L-1]';

pe = sqrt(2/pi)*exp(-0.5*e.^2);
Ae = De*sum(pe);

Emin=0.01;
Emax=3;
DE=(Emax-Emin)/(L-1);
E=Emin+DE*[0:L-1]';

pE = sqrt(1./(2*pi*E)).*exp(-0.5*E);
AE = DE*sum(pE);

eda_draw(' ',pe,'caption p(e)',' ',pE,'caption p(E)');

Ae
AE