All problems
Trellis State Count
Problem
Return the number of states in a convolutional code trellis with the given constraint length: 2^(constraint_length - 1).
Hint
The state is the contents of the memory register, one bit shorter than the constraint length.
Test cases
case 1
in: [2]
expected: 2
case 2
in: [3]
expected: 4
case 3
in: [4]
expected: 8
case 4
in: [7]
expected: 64
Starter codePython
def trellis_state_count(constraint_length):
# Your code here
pass4 test cases · run your code against them in the editor