R/formulas.R
entropy_bits.Rd
Shannon entropy for binary vectors
entropy_bits(v)
A binary vector
The Shannon entropy of the vector
The probability \(p(1)\) corresponds to the normalized hamming_weight of the vector.
entropy_shannon
entropy_bits(c(0, 0, 0)) #> [1] 0 entropy_bits(c(1, 1, 1)) #> [1] 0 entropy_bits(rbits(20)) #> [1] 0.9709506