The Gaussian distribution also known as the Normal distribution, is given by the following
equation:
π¦(π₯) = ππ₯π β(π₯βπ)^2/2π^2
where parameter π is the mean and π the standard deviation.
(i) Write a MATLAB code to create a 1000 point Gaussian distribution of random numbers
having π = 0 and π = 1. (20)
(ii) Plot this distribution. (10)
(iii) Prove that the full widthβhalf maximum (FWHM), of the above distribution is given by :
FWHM = 2πβ2ln 2 (10)
i: >>x=normrnd(0,1,1000);
ii:
>> y=@(x)exp(-x.^2/2);
>> x=-5:0.01:5;
>> plot(x,y(x))
"iii:\\\\\\max \\left( f\\left( x \\right) \\right) =\\max \\left( \\frac{1}{\\sqrt{2\\pi \\sigma ^2}}\\exp \\left( -\\frac{x^2}{2\\sigma ^2} \\right) \\right) =f\\left( 0 \\right) =\\frac{1}{\\sqrt{2\\pi \\sigma ^2}}\\\\f\\left( x \\right) =\\frac{1}{2}\\max \\left( f \\right) \\Rightarrow f\\left( x \\right) =\\frac{1}{2\\sqrt{2\\pi \\sigma ^2}}\\Rightarrow \\frac{1}{\\sqrt{2\\pi \\sigma ^2}}\\exp \\left( -\\frac{x^2}{2\\sigma ^2} \\right) =\\frac{1}{2\\sqrt{2\\pi \\sigma ^2}}\\Rightarrow \\\\\\Rightarrow \\frac{x^2}{2\\sigma ^2}=\\ln 2\\Rightarrow x=\\pm \\sigma \\sqrt{2\\ln 2}\\Rightarrow FWHM=x_2-x_1=\\sigma \\sqrt{2\\ln 2}-\\left( -\\sigma \\sqrt{2\\ln 2} \\right) =2\\sigma \\sqrt{2\\ln 2}"
Comments
Leave a comment