From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 331/CH9/EX9.11/Example_9_11.sce | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 331/CH9/EX9.11/Example_9_11.sce (limited to '331/CH9/EX9.11') diff --git a/331/CH9/EX9.11/Example_9_11.sce b/331/CH9/EX9.11/Example_9_11.sce new file mode 100755 index 000000000..03ce9df0f --- /dev/null +++ b/331/CH9/EX9.11/Example_9_11.sce @@ -0,0 +1,51 @@ +//Caption:Run Test for Randomness +//Example9.11 +//Page326 +//run test of randomness of large samples +//Ho: The occurrence of the runs of the given stream of symbols (W,L) is random +//H1: The occurrence of the runs of the given stream of symbols (W,L) is not random + +clc; +n1 = 24; //Frequency of occurrence of letter 'W' +n2 = 16; //Frequency of occurrence of letter 'L' +r = 17;//number or runs +alpha = 0.05;//significance level +alpha = alpha/2; +Mean_r = ((2*n1*n2)/(n1+n2))+1; +Var_r = (2*n1*n2)*(2*n1*n2-n1-n2)/(((n1+n2)^2)*(n1+n2-1)); +Std = sqrt(Var_r); +Z_calc = (r-Mean_r)/Std; +Z_Stand = standard_normal_zstat(alpha); +disp(Mean_r,'Mean of r u =') +disp(Var_r,'variance of r =') +disp(Std,'Standard deviation of r =') +disp(Z_calc,'Calculated Z value = ') +disp(Z_Stand,'Standard z value from table=') +if (Z_calc>-Z_Stand)&(Z_calc