H2(x)= -P(x1)*Log2(p1)-P(x2)*Log(p2).-P(xn)*Log2(Pn)
H2(x)= -P(白/白)*Log2(白/白)-P(黑/白)*Log2(黑/白)-P(白/黑)*Log(白/黑)-P(黑/黑)Log2(黑/黑)
=-0.9*Log2(0.49)-0.1*Log2(0.21)-0.2*Log2(0.21)-0.8*Log2(0.09)
=0.926 + 0.225 + 0.45 + 2.779
=4.38
H2(x)= -P(x1)*Log2(p1)-P(x2)*Log(p2).-P(xn)*Log2(Pn)
H2(x)= -P(白/白)*Log2(白/白)-P(黑/白)*Log2(黑/白)-P(白/黑)*Log(白/黑)-P(黑/黑)Log2(黑/黑)
=-0.9*Log2(0.49)-0.1*Log2(0.21)-0.2*Log2(0.21)-0.8*Log2(0.09)
=0.926 + 0.225 + 0.45 + 2.779
=4.38