Problem 12P

Use a computer to plot the function xne−x and the Gaussian approximation to this function, for n = 10, 20, and 50. Notice how the relative width of the peak (compared to n) decreases as n increases, and how the Gaussian approximation becomes more accurate as n increases. If your computer software permits it, try looking at even higher values of n.

Solution to 12P

Step 1

f(x)=xne-x is a gaussian approximation function which reaches maximum value when x=n. We are using Matlab to plot the function. For N=10,20 and 50. The relative width of the gaussian curve is decreased as n increased and the gaussian approximation becomes more accurate as n increases.

Matlab Code:

clear all

clf

clc

x = 0:.01:100;

plot(x,((x.^10).*exp(-x))/max((x.^10).*exp(-x)),'-g');hold on;

plot(x,((x.^20).*exp(-x))/max((x.^20).*exp(-x)),'-r');hold on;

plot(x,((x.^50).*exp(-x))/max((x.^50).*exp(-x)),'-k');hold on;

xlabel('n')

ylabel('x.^n.*exp(-x)')

title('plot of gaussian approximation for N=10,20 and 50')

legend('N=10','N=20','N=50')

grid on;