Skip to content
DeepForgeby svx
All problems
MediumInformation Theoryinfo-200

Tanner Graph Degrees

Problem

Return [check_degrees, variable_degrees] for the parity-check matrix H. Check degrees are the row sums and variable degrees are the column sums of H.

Hint

Degrees count the edges incident to each check node and variable node.

Test cases

case 1
in: [[[1,1,0],[0,1,1]]]
expected: [[2,2],[1,2,1]]
case 2
in: [[[1,1,0,0],[0,1,1,0],[0,0,1,1]]]
expected: [[2,2,2],[1,2,2,1]]
case 3
in: [[[1,1],[1,1]]]
expected: [[2,2],[2,2]]
case 4
in: [[[0,0],[0,0]]]
expected: [[0,0],[0,0]]
Starter codePython
def tanner_degrees(h_matrix):
    # Your code here
    pass

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