summaryrefslogtreecommitdiff
path: root/1631/CH2/EX2.24/Ex2_24.sce
blob: 28c5b37995246471a3c892675076d81b8cbf6298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//Caption:  mean ,mean Square Standard deviation
//Example 2.24
//page no 
//Find mean,mean Square ,Standard deviation
clc;
clear;
function y=f(x)
         y=x/(2*%pi); //for 0<=x<=2*%pi
endfunction

a=0;
b=2*%pi;
mx=intg(a,b,f);//mean value
disp(mx,"Mean value mx=");

function y=fX(x)
         y=x^2/(2*%pi); //for 0<=x<=2*%pi
endfunction
a=0;
b=2*%pi;
//X^2=E(X^2) 
X2=intg(a,b,fX);//mean square value
disp(X2,"Mean square value X^2 =");

sigma2=X2-mx^2;//variance
sigma=sqrt(sigma2);//Standard deviation
disp(sigma,"Standard deviation sigma=")