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 --- 1895/CH11/EX11.9/EXAMPLE11_9.SCE | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 1895/CH11/EX11.9/EXAMPLE11_9.SCE (limited to '1895/CH11/EX11.9') diff --git a/1895/CH11/EX11.9/EXAMPLE11_9.SCE b/1895/CH11/EX11.9/EXAMPLE11_9.SCE new file mode 100755 index 000000000..5eaf36344 --- /dev/null +++ b/1895/CH11/EX11.9/EXAMPLE11_9.SCE @@ -0,0 +1,26 @@ +//ANALOG AND DIGITAL COMMUNICATION +//BY Dr.SANJAY SHARMA +//CHAPTER 11 +//Information Theory +clear all; +clc; +printf("EXAMPLE 11.9(PAGENO 492)"); +//given +Px_1 = .4//probability of first symbol +Px_2 = .3//probability of second symbol +Px_3 = .2//probability of third symbol +Px_4 = .1//probability of fourth symbol + +//calculations +H_X = -Px_1*log2(Px_1)-Px_2*log2(Px_2)-Px_3*log2(Px_3)-Px_4*log2(Px_4);//entropy +Px1x2x1x3 = Px_1*Px_2*Px_1*Px_3;//product of probabilities +Ix1x2x1x3 =-log2(Px1x2x1x3);//information of four symbols +Px4x3x3x2 = Px_4*Px_3*Px_3*Px_2;//product of probabilities +Ix4x3x3x2 = -log2(Px4x3x3x2);//information of four symbols + +//results +printf("\n\ni.Entorpy = %.2f bits/symbol",H_X); +printf("\n\nii.Amount of information contained in x1x2x1x3 = %.2f bits/symbol",Ix1x2x1x3); +printf("\nThus,Ix1x2x1x3 < 7.4[=4*H_X]bits/symbol") +printf("\n\niii.Amount of information contained in x4x3x3x2 =%.2f bits/symbol",Ix4x3x3x2); +printf("\nThus we conclude that\nIx4x3x3x2 > 7.4[=4*H_X]bits/symbol") -- cgit