Skip to content
DeepForgeby svx
All problems
HardInformation Theoryinfo-360

Mixed Erasure-Flip Channel Capacity

Problem

Compute the capacity in bits of a channel that flips each bit with probability p and erases it with probability e, independently, assuming p + e <= 1. Conditioning on the erasure indicator gives the capacity (1 - e) * (1 - H2(p / (1 - e))), which is 0.0 when e equals 1.

Hint

Ignore erased positions, then treat the surviving positions as a BSC with crossover p/(1-e).

Test cases

case 1
in: [0.1,0.2]
expected: 0.3651484454403229
case 2
in: [0,0.5]
expected: 0.5
case 3
in: [0,0]
expected: 1
case 4
in: [0.25,0.75]
expected: 0.25
case 5
in: [0.1,0]
expected: 0.5310044064107188
Starter codePython
import math
def erasure_flip_capacity(p, e):
    # Your code here
    pass

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