RosettaCodeData/Task/Entropy/Mathematica/entropy-1.math
2023-07-01 13:44:08 -04:00

2 lines
109 B
Text

shE[s_String] := -Plus @@ ((# Log[2., #]) & /@ ((Length /@ Gather[#])/
Length[#]) &[Characters[s]])