Here is my MATLAB code to plot P(X>x) for an exponential r.v. for E(X) = 10. I am pretty certain that my calculations are correct. The plot looks weird. Can anyone help?
clear; clc; U=rand(1,100000); lambda = 1/10; expValue = -log(1-U)/lambda; prob=exp(-lambda*expValue); plot(U,log(prob));