Skip to contents

Message length and its probability, in bits (eq. 28.15, p. 352)

Usage

morie_msglen(p = NULL, length = NULL)

Arguments

p

probability of the event; give exactly one of p or length

length

message length in bits

Value

list(length, p, nats)

Examples

morie_msglen(p = 1 / 8)
#> $length
#> [1] 3
#> 
#> $p
#> [1] 0.125
#> 
#> $nats
#> [1] 2.079442
#>