example6.mws

Example 6: Understanding an Important Theorem

by Zavan Karian

> restart: with(plots, display): libname:="C:/mylib/statistics",libname: with(stat):

> f := x -> (3/2)*x^2;

f := proc (x) options operator, arrow; 3/2*x^2 end ...

> int(f(x), x=-1..1);

1

> mu := int(x*f(x), x=-1..1);

mu := 0

> var := int(x^2*f(x), x=-1..1)- mu^2;

var := 3/5

> F := int(f(t), t=-1..x);

F := 1/2*x^3+1/2

> A := ContinuousS(f(x), -1..1, 5);

A := [-.5242038871, -.7095721400, -.6776578358, -.3...

> A := ContinuousS(f(x), -1..1, 400):

> H := Histogram(A, -1..1, 12):

> P := plot(f(x), x=-1..1):

> display({P,H});

[Maple Plot]

>

> S4 := [seq(ContinuousS(f(x), -1..1, 4), i=1..300)]:

> S4[1];

[-.6818391032, .8768027182, .9309436746, .862010090...

> M4 := [seq(Mean(S4[i]), i=1..300)]:

> H4 := Histogram(M4, -1..1, 7):

> n4 := NormalPDF(mu, var/4, x):

> N4 := plot(n4, x=-1..1, color=blue):

> # interface(plotdevice=postscript, plotoutput=Fig6a);

> display({P, H4, N4});

[Maple Plot]

>

> S8 := [seq(ContinuousS(f(x), -1..1, 8), i=1..300)]:

> A[1];

.7893526922

> M8 := [seq(Mean(S8[i]), i=1..300)]:

> # interface(plotdevice=postscript, plotoutput=Fig6b);

> H8 := Histogram(M8, -1..1, 7):

> n8 := NormalPDF(mu, var/8, x):

> N8 := plot(n8, x=-1..1, color=blue):

> display({P, H8, N8});

[Maple Plot]

>

> A := [seq(ContinuousS(f(x), -1..1, 16), i=1..300)]:

> M16 := [seq(Mean(A[i]), i=1..300)]:

> H16 := Histogram(M16, -1..1, 13):

> n16 := NormalPDF(mu, var/16, x):

> N16 := plot(n16, x=-1..1, color=blue):

> display({P, H16, N16});

[Maple Plot]