Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-224

Griesmer Bound

Problem

Return the Griesmer lower bound on the length of a binary linear code with k information bits and minimum distance d:

n >= sum_{i=0}^{k-1} ceil(d / 2^i)

Hint

The Hamming code meets the Griesmer bound with equality.

Test cases

case 1
in: [4,3]
expected: 7
case 2
in: [3,4]
expected: 7
case 3
in: [2,4]
expected: 6
case 4
in: [1,5]
expected: 5
Starter codePython
import math
def griesmer_bound(k, d):
    # Your code here
    pass

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