summaryrefslogtreecommitdiff
path: root/1895/CH11/EX11.32/EXAMPLE11_32.SCE
diff options
context:
space:
mode:
Diffstat (limited to '1895/CH11/EX11.32/EXAMPLE11_32.SCE')
-rwxr-xr-x1895/CH11/EX11.32/EXAMPLE11_32.SCE21
1 files changed, 21 insertions, 0 deletions
diff --git a/1895/CH11/EX11.32/EXAMPLE11_32.SCE b/1895/CH11/EX11.32/EXAMPLE11_32.SCE
new file mode 100755
index 000000000..ca4d84394
--- /dev/null
+++ b/1895/CH11/EX11.32/EXAMPLE11_32.SCE
@@ -0,0 +1,21 @@
+//ANALOG AND DIGITAL COMMUNICATION
+//BY Dr.SANJAY SHARMA
+//CHAPTER 11
+//Information Theory
+clear all;
+clc;
+printf("EXAMPLE 11.32(PAGENO 518)");
+//given
+a1 = 1
+a2 = 2
+a3 = .5
+
+//calculations
+H_X1 = log2(a1);//Entropy for first case
+H_X2 = log2(a2);//Entropy for second case
+H_X3 = log2(a3);//Entropy for third case
+
+//results
+printf("\n\ni.Entropy for first case = %.2f ",H_X1);
+printf("\n\nii.Entropy for second case = %.2f",H_X2);
+printf("\n\niii.Entropy for third case = %.2f ",H_X3);