diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /331/CH3/EX3.11/Example_3_11.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '331/CH3/EX3.11/Example_3_11.sce')
-rwxr-xr-x | 331/CH3/EX3.11/Example_3_11.sce | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/331/CH3/EX3.11/Example_3_11.sce b/331/CH3/EX3.11/Example_3_11.sce new file mode 100755 index 000000000..3363c479d --- /dev/null +++ b/331/CH3/EX3.11/Example_3_11.sce @@ -0,0 +1,74 @@ +//Caption:Relationship between Mean, Median and Mode +//Example3.11 +//Page48 +clear; +clc; +X = [0,2;2,4;4,6;6,8;8,10;10,12;12,14;14,16;16,18]; +f = [10,15,20,30,8,5,4,3,5]; +cum_f = 0; +for i = 1:length(f) + cum_f = cum_f+f(i); + sigmaf(i) = cum_f; +end +N = cum_f; //total number of salesman +cen = N/2; +for i = 1:length(f) + if ((sigmaf(i)< cen) &(cen< sigmaf(i+1))) then + L = X(i+1,1); + Fre = f(i+1); + F = sigmaf(i) + C = diff(X(i+1,:)); + end +end +disp(L,'Lower limit of the median class L =') +disp(Fre,'Frequency of the Median class f =') +disp(F,'Cumulative frequency of the previous class F=') +disp(C,'Width of the class interval C=') +Median = L+(((N/2)-F)*C/Fre); +disp(Median,'Median of the travelling allowance of the salesman is Rs =') +disp('Crores') +[Maxf,i]= max(f); +f1 = abs(f(i)-f(i-1));//Absolute difference between freq. of the modal class and +//that of its immediately preceding class +f2 = abs(f(i)-f(i+1));//Absolute difference beween freq. of the modal class and +//that of its immediately succeeding class +Mode = L+((f1/(f1+f2))*C); +disp(Mode,'Mode of the annual revenues of the firms is =') +disp('crores') +Mean = (3*Median-Mode)/2; +disp(Mean,'Mean of the annual revenue of the firm is =') +disp('crores') +//Result +//Lower limit of the median class L = +// +// 6. +// +// Frequency of the Median class f = +// +// 30. +// +// Cumulative frequency of the previous class F= +// +// 45. +// +// Width of the class interval C= +// +// 2. +// +// Median of the travelling allowance of the salesman is Rs = +// +// 6.3333333 +// +// Crores +// +// Mode of the annual revenues of the firms is = +// +// 6.625 +// +// crores +// +// Mean of the annual revenue of the firm is = +// +// 6.1875 +// +// crores
\ No newline at end of file |