
clear
clf

j=0;
for i=0.001:.001:1-0.001;
   j=j+1;
   p=i;
   q=1-p;
   H(j)=-(p*log2(p)+q*log2(q));
   x(j)=p;
end


plot(x,H)
grid
xlabel(' p ')
ylabel(' Information entropy H ')
