All problems
Quantized Gaussian Entropy
Problem
Approximate the entropy in bits of a Gaussian with variance var after uniform quantization with step size step:
H ~ 0.5 * log2(2 * pi * e * var) - log2(step)
That is the differential entropy minus the quantization resolution.
Hint
Finer quantization (smaller step) increases the discrete entropy.
Test cases
case 1
in: [1,1]
expected: 2.047095585180641
case 2
in: [1,0.5]
expected: 3.047095585180641
case 3
in: [4,1]
expected: 3.047095585180641
case 4
in: [1,2]
expected: 1.047095585180641
Starter codePython
import math
def quantized_gaussian_entropy(var, step):
# Your code here
pass4 test cases · run your code against them in the editor