$0.2$ is not the probability - and should not go into Log
. The fact that
$0.2$ is listed 5 times also got nothing to do with calculations. In reality
$0.2$ in data1
is the only element in the list and its probability is 1
when you picking elements randomly from the list (not
$0.2$). So you have 1 Log[1]
and it is zero:
data1 = {0.20, 0.2, 0.2, 0.2, 0.2};
Entropy[data1]
(*0*)
Please consider these two identical results:
Entropy[Append[Table[0.2, 35], 0.3]]
$$\frac{35}{36} \log \left(\frac{36}{35}\right)+\frac{\log (36)}{36}$$
Entropy[Append[Table[a, 35], b]]
$$\frac{35}{36} \log \left(\frac{36}{35}\right)+\frac{\log (36)}{36}$$