I have problem with Entropy instruction A first example
entro1 = Entropy[{1, 1, 1, 1, 1, 1}] // N
entro2 = Entropy[{0, 1, 1, 4, 1, 1}] // N
entro3 = Entropy[{0, 1, 1, 8, 1, 1}] // N
entro4 = Entropy[{0, 0, 10, 0, 0, 0}] // N
maxentropy = Log[6] // N
Out[369]= 0.
Out[370]= 0.867563
Out[371]= 0.867563
Out[372]= 0.450561
Out[373]= 1.79176
OK for the result entro1 and entro2, but why entro2=entro3, and why entro4 with a maximum concentration is not equal with maxentropy
And now a problem more difficult
country = "France";
ny = ToExpression@
DialogInput[
DynamicModule[{name = ""},
Column[{"Combien de villes retenir?",
InputField[Dynamic[name], String],
ChoiceButtons[{DialogReturn[name], DialogReturn[]}]}]]];
don = Take[
QuantityMagnitude[CityData[#, "Population"]] & /@
CityData[{All, country}], ny] // N;
(*Calcul de entropy totale*)
entrotot = Entropy[don] // N
hmaxtot = Log[ny] // N
hrelativetot = N[(entrotot/hmaxtot)*100]
The result is alway entrotot = hmaxtot when I enter different values of ny, the number of cities? What is the formula for the calculus of Entropy[]?