All problems
Polar Transform Pair
Problem
Apply the 2-bit polar transform to a pair of bits: [u0, u1] -> [u0 ^ u1, u1]. This is the kernel from which larger polar codes are built recursively.
Hint
The transform is its own inverse over GF(2).
Test cases
case 1
in: [[0,0]]
expected: [0,0]
case 2
in: [[1,0]]
expected: [1,0]
case 3
in: [[0,1]]
expected: [1,1]
case 4
in: [[1,1]]
expected: [0,1]
Starter codePython
def polar_encode_pair(bits):
# Your code here
pass4 test cases · run your code against them in the editor