Professional Documents
Culture Documents
Exp 1
Exp 1
clc;
close all;
N =100000;
u=rand(1,N);
X=-log(1-u);
range = 0:0.1:5;
h = histc(X,range);
Theory_pdf = exp(-range);
sim_pdf=h/(0.1*sum(h));
plot(range,Theory_pdf);
hold on;
plot(range,sim_pdf,'k *');
legend('Theory','Simulated');