Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-310

Reed-Solomon Symbol Overhead

Problem

A Reed-Solomon code that corrects t arbitrary symbol errors needs 2t parity symbols, so k message symbols become a block of n = k + 2t symbols. Return the parity fraction 2t / (k + 2t), which is 0.0 when t is 0. Assume k >= 1 and t >= 0.

Hint

Error correction costs twice as much redundancy as erasure correction.

Test cases

case 1
in: [10,2]
expected: 0.2857142857142857
case 2
in: [8,1]
expected: 0.2
case 3
in: [4,0]
expected: 0
case 4
in: [12,3]
expected: 0.3333333333333333
Starter codePython
def reed_solomon_overhead(k, t):
    # Your code here
    pass

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