diff options
Diffstat (limited to '2606/CH11/EX11.2')
-rwxr-xr-x | 2606/CH11/EX11.2/ex11_2.jpg | bin | 0 -> 9222 bytes | |||
-rwxr-xr-x | 2606/CH11/EX11.2/ex11_2.sce | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/2606/CH11/EX11.2/ex11_2.jpg b/2606/CH11/EX11.2/ex11_2.jpg Binary files differnew file mode 100755 index 000000000..f5822b3de --- /dev/null +++ b/2606/CH11/EX11.2/ex11_2.jpg diff --git a/2606/CH11/EX11.2/ex11_2.sce b/2606/CH11/EX11.2/ex11_2.sce new file mode 100755 index 000000000..01de456f7 --- /dev/null +++ b/2606/CH11/EX11.2/ex11_2.sce @@ -0,0 +1,24 @@ +//Page Number: 11.12
+//Example 11.2
+clc;
+//Given
+//Probabilities of four symbols
+Px=[0.4 0.3 0.2 0.1];
+
+//(a) H(X)
+//As H(X)=-Sum of(P(xi)log2P(xi))
+//Where i=0 to n;
+HofX=0;
+for i=1:4
+ HofX=HofX+(Px(i)*log2(Px(i)));
+end
+disp('b/symbol',-HofX,'H(X):');
+
+//(b)Amount of information in x1x2x1x3 and x4x3x3x2
+Px1x2x1x3=Px(1)*Px(2)*Px(1)*Px(3);
+Ix1x2x1x3=-log2(Px1x2x1x3);
+disp('b/symbol',Ix1x2x1x3,'Ix1x2x1x3:');
+
+Px4x3x3x2=Px(4)*Px(3)*Px(3)*Px(2);
+Ix4x3x3x2=-log2(Px4x3x3x2);
+disp('b/symbol',Ix4x3x3x2,'Ix4x3x3x2:');
|