Binary entropy function (source code)

= Binary entropy function
{title2=$H_2(x)$}
{wiki}

The binary entropy function is
$$
H_2(x)=-x\log_2x-(1-x)\log_2(1-x).
$$
It is concave on $[0,1]$ and satisfies $H_2(x)\geq2x$ for $0\leq x\leq1/2$ by comparison with the chord from $(0,0)$ to $(1/2,1)$.