Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-303

BEC Mutual Information

Problem

Compute the mutual information in bits of a binary erasure channel with erasure probability pe when the input is 1 with probability px1. The formula is I = (1 - pe) * H(px1), where H is the binary entropy function in bits; degenerate inputs with px1 = 0 or 1 carry no information.

Hint

Erasures only scale the information down by the fraction of symbols that arrive.

Test cases

case 1
in: [0.5,0]
expected: 1
case 2
in: [0.5,0.5]
expected: 0.5
case 3
in: [0.25,0.2]
expected: 0.6490224995673063
case 4
in: [1,0.3]
expected: 0
Starter codePython
import math
def bec_mutual_information(px1, pe):
    # Your code here
    pass

4 test cases · run your code against them in the editor