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.1/EXAMPLE11_1.SCE | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 1895/CH11/EX11.1/EXAMPLE11_1.SCE (limited to '1895/CH11/EX11.1') diff --git a/1895/CH11/EX11.1/EXAMPLE11_1.SCE b/1895/CH11/EX11.1/EXAMPLE11_1.SCE new file mode 100755 index 000000000..d60e79a05 --- /dev/null +++ b/1895/CH11/EX11.1/EXAMPLE11_1.SCE @@ -0,0 +1,25 @@ +//ANALOG AND DIGITAL COMMUNICATION +//BY Dr.SANJAY SHARMA +//CHAPTER 11 +//Information Theory +clear all; +clc; +printf("EXAMPLE 11.1(PAGENO 488)"); +//given + +Px_1=1/2;//probability 1 +Px_2=1/4;//probability 2 +Px_3=1/8;//probability 3 +Px_4=1/8;//probability 4 + +//calculations +Ix_1 = log2(1/(Px_1))//information content in first probability +Ix_2 = log2(1/(Px_2))//information content in first probability +Ix_3 = log2(1/(Px_3))//information content in first probability +Ix_4 = log2(1/(Px_3))//information content in first probability + +//results +printf("\n\ni. Information content of first symbol = %.2f bit",Ix_1); +printf("\n\nii. Information content of second symbol = %.2f bits",Ix_2); +printf("\n\niii. Information content of third symbol = %.2f bits",Ix_3); +printf("\n\niV. Information content of fourth symbol = %.2f bits",Ix_4); -- cgit