Reed-Muller Codes - Polynomial View of Encoding

Theory

Monomials and Polynomials over F2\mathbb{F}_2

A monomial is an algebraic expression that consists of a single product of variables. For our purposes, we are interested in monomials with mm variables, X1,X2,,XmX_1, X_2, \dots, X_m, where each variable can only be present or absent. This is because we operate in the binary field F2\mathbb{F}_2, where any variable XiX_i squared is just itself (Xi2=XiX_i^2 = X_i). Thus, a monomial can be written as: M=Xj1Xj2Xjd M = X_{j_1} X_{j_2} \dots X_{j_d} where {j1,j2,,jd}\{j_1, j_2, \dots, j_d\} is a subset of the variable indices {1,2,,m}\{1, 2, \dots, m\}. The number of variables that are multiplied together in the monomial (i.e., dd, in the above monomial) is the degree of the monomial.

A Boolean polynomial is a sum of such monomials, with coefficients also from F2\mathbb{F}_2 (meaning, they are either 0 or 1). An example of a polynomial in four variables is: f(X1,X2,X3,X4)=1+X1+X3+X1X2+X2X3X4 f(X_1, X_2, X_3, X_4) = 1 + X_1 + X_3 + X_1X_2 + X_2X_3X_4 The degree of a polynomial is the highest degree among all of its monomials. In the example above, the monomial X2X3X4X_2X_3X_4 has degree 3, which is the highest, so the polynomial has degree 3.

The Evaluation of a Polynomial

The core operation for constructing Reed-Muller codes is the evaluation of a polynomial. Given a polynomial f(X1,,Xm)f(X_1, \dots, X_m) and a specific binary vector v=(v1,v2,,vm)F2m\mathbf{v} = (v_1, v_2, \dots, v_m) \in \mathbb{F}_2^m, we can evaluate the polynomial by substituting the components of v\mathbf{v} for the variables XiX_i. Evalv(f)=f(v1,v2,,vm) \text{Eval}_{\mathbf{v}}(f) = f(v_1, v_2, \dots, v_m) The result of this evaluation will be either 0 or 1.

The complete evaluation vector of a polynomial, denoted Eval(f)\text{Eval}(f), is the ordered list of its evaluations for every single possible input vector in F2m\mathbb{F}_2^m. Since there are 2m2^m such vectors, the evaluation vector will have a length of n=2mn=2^m. We conventionally list the evaluations by taking the input vectors vF2m\mathbf{v} \in \mathbb{F}_2^m in lexicographical order (i.e., treating them as binary numbers from 0 to 2m12^m-1).

Example: Evaluation of a Polynomial

Let's consider the polynomial f(X1,X2,X3)=X1+X2X3f(X_1, X_2, X_3) = X_1 + X_2X_3 over F23\mathbb{F}_2^3. Its degree is 2. To find its evaluation vector, we compute its value for all 23=82^3 = 8 input vectors, from (0,0,0)(0,0,0) to (1,1,1)(1,1,1).

Input Vector (v1,v2,v3)(v_1, v_2, v_3) in lexicographic order Calculation of f(v1,v2,v3)=v1+v2v3f(v_1, v_2, v_3) = v_1 + v_2v_3 Output
(0,0,0)(0,0,0) 0+(00)=0+00 + (0 \cdot 0) = 0 + 0 0
(0,0,1)(0,0,1) 0+(01)=0+00 + (0 \cdot 1) = 0 + 0 0
(0,1,0)(0,1,0) 0+(10)=0+00 + (1 \cdot 0) = 0 + 0 0
(0,1,1)(0,1,1) 0+(11)=0+10 + (1 \cdot 1) = 0 + 1 1
(1,0,0)(1,0,0) 1+(00)=1+01 + (0 \cdot 0) = 1 + 0 1
(1,0,1)(1,0,1) 1+(01)=1+01 + (0 \cdot 1) = 1 + 0 1
(1,1,0)(1,1,0) 1+(10)=1+01 + (1 \cdot 0) = 1 + 0 1
(1,1,1)(1,1,1) 1+(11)=1+11 + (1 \cdot 1) = 1 + 1 0

Assembling these output bits in order gives us the evaluation vector: Eval(X1+X2X3)=(0,0,0,1,1,1,1,0) \text{Eval}(X_1 + X_2X_3) = (0, 0, 0, 1, 1, 1, 1, 0)

Reed-Muller Codes

Reed-Muller (RM) codes are a family of linear block codes specified by two parameters: mm and rr, denoted as RM(r,m)RM(r, m).

  • The parameter mm determines the number of variables in our polynomials, which in turn sets the codeword length to n=2mn = 2^m.
  • The parameter rr (where 0rm0 \le r \le m) specifies the maximum allowable degree for our polynomials.

The code RM(r,m)RM(r, m) is then formally defined as the set of all evaluation vectors of all possible Boolean polynomials in mm variables having a degree of at most rr.

The number of distinct monomials of degree up to rr determines the dimension of the code, kk. Specifically, the message bits we wish to encode correspond to the coefficients of these monomials. The dimension is thus k=j=0r(mj)k = \sum_{j=0}^{r} \binom{m}{j}.

Encoding of RM Codes

Apart from a standard generator matrix multiplication (which shall be discussed in the another experiment), the encoding process for RM(r,m)RM(r, m) maps a message to a polynomial, and then generates the codeword by evaluating that polynomial.

  1. Construct the Polynomial: Use the message bits as the coefficients for the set of allowed monomials (all those with degree r\le r) to form a message polynomial f(X1,,Xm)f(X_1, \dots, X_m).
  2. Generate the Codeword: Compute the evaluation vector Eval(f)\text{Eval}(f) by evaluating the polynomial for all 2m2^m input vectors in F2m\mathbb{F}_2^m. This evaluation vector is the final codeword c\mathbf{c}.

Example 1: Encoding for RM(1,3)RM(1, 3)

Let's encode a message using the RM(1,3)RM(1, 3) code.

  • Parameters: m=3,r=1m=3, r=1.
  • Codeword length: n=23=8n = 2^3 = 8.
  • Allowed monomials: Degree 1\le 1. These are {1,X1,X2,X3}\{1, X_1, X_2, X_3\}.
  • Dimension: k=(30)+(31)=1+3=4k = \binom{3}{0} + \binom{3}{1} = 1 + 3 = 4.

Suppose our message is u=(1,1,0,1)\mathbf{u} = (1, 1, 0, 1). We map these bits to the coefficients of the allowed monomials in a fixed order (e.g., constant, then X1X_1, X2X_2, X3X_3): f(X1,X2,X3)=(1)1+(1)X1+(0)X2+(1)X3=1+X1+X3 f(X_1, X_2, X_3) = (1) \cdot 1 + (1) \cdot X_1 + (0) \cdot X_2 + (1) \cdot X_3 = 1 + X_1 + X_3 Now, we generate the 8-bit codeword by evaluating this polynomial:

Input (v1,v2,v3)(v_1, v_2, v_3) f(v1,v2,v3)=1+v1+v3f(v_1, v_2, v_3) = 1 + v_1 + v_3 Output
(0,0,0)(0,0,0) 1+0+01+0+0 1
(0,0,1)(0,0,1) 1+0+11+0+1 0
(0,1,0)(0,1,0) 1+0+01+0+0 1
(0,1,1)(0,1,1) 1+0+11+0+1 0
(1,0,0)(1,0,0) 1+1+01+1+0 0
(1,0,1)(1,0,1) 1+1+11+1+1 1
(1,1,0)(1,1,0) 1+1+01+1+0 0
(1,1,1)(1,1,1) 1+1+11+1+1 1

The resulting codeword for the message (1,1,0,1)(1, 1, 0, 1) is c=(1,0,1,0,0,1,0,1)\mathbf{c} = (1, 0, 1, 0, 0, 1, 0, 1).

Example 2: Encoding for RM(2,4)RM(2, 4)

Let's examine a more complex example. Consider the RM(2,4)RM(2, 4) code.

  • Parameters: m=4,r=2m=4, r=2.
  • Codeword length: n=24=16n = 2^4 = 16.
  • Allowed monomials: All monomials with degree 0, 1, or 2. This includes 11, {X1,X2,X3,X4}\{X_1, X_2, X_3, X_4\}, and {X1X2,X1X3,X1X4,X2X3,X2X4,X3X4}\{X_1X_2, X_1X_3, X_1X_4, X_2X_3, X_2X_4, X_3X_4\}.
  • Dimension: k=(40)+(41)+(42)=1+4+6=11k = \binom{4}{0} + \binom{4}{1} + \binom{4}{2} = 1 + 4 + 6 = 11.

Let's say our 11-bit message corresponds to a message polynomial f(X1,X2,X3,X4)=X1X2+X3f(X_1, X_2, X_3, X_4) = X_1X_2 + X_3. This is a valid polynomial because its degree is 2, which is r\le r.

To find the codeword, we must evaluate this polynomial for all 16 input vectors from (0,0,0,0)(0,0,0,0) to (1,1,1,1)(1,1,1,1).

  • For input (0,0,0,0)(0,0,0,0): f(0,0,0,0)=(00)+0=0f(0,0,0,0) = (0 \cdot 0) + 0 = 0.
  • For input (0,0,0,1)(0,0,0,1): f(0,0,0,1)=(00)+0=0f(0,0,0,1) = (0 \cdot 0) + 0 = 0. This is incorrect. f(0,0,0,1)=(00)+0=0f(0,0,0,1) = (0 \cdot 0) + 0 = 0 is wrong, it should be f(0,0,0,1)=00+0=0f(0,0,0,1) = 0 \cdot 0 + 0 = 0 which is correct. The next one is f(0,0,1,0)=00+1=1f(0,0,1,0) = 0 \cdot 0 + 1 = 1. Let me re-evaluate the calculation in the previous turn.

Let's re-calculate for f(X1,X2,X3,X4)=X1X2+X3f(X_1, X_2, X_3, X_4) = X_1X_2 + X_3. The evaluation depends on the values of X1,X2X_1, X_2 and X3X_3. The input vectors are (v1,v2,v3,v4)(v_1, v_2, v_3, v_4).

  • If v1=0,v2=0v_1=0, v_2=0: F=00+v3=v3F = 0 \cdot 0 + v_3 = v_3. For inputs (0000,0001,0010,0011)(0000, 0001, 0010, 0011), v3v_3 is (0,0,1,1)(0,0,1,1). So outputs are (0,0,1,1)(0,0,1,1).
  • If v1=0,v2=1v_1=0, v_2=1: F=01+v3=v3F = 0 \cdot 1 + v_3 = v_3. For inputs (0100,0101,0110,0111)(0100, 0101, 0110, 0111), v3v_3 is (0,0,1,1)(0,0,1,1). So outputs are (0,0,1,1)(0,0,1,1).
  • If v1=1,v2=0v_1=1, v_2=0: F=10+v3=v3F = 1 \cdot 0 + v_3 = v_3. For inputs (1000,1001,1010,1011)(1000, 1001, 1010, 1011), v3v_3 is (0,0,1,1)(0,0,1,1). So outputs are (0,0,1,1)(0,0,1,1).
  • If v1=1,v2=1v_1=1, v_2=1: F=11+v3=1+v3F = 1 \cdot 1 + v_3 = 1+v_3. For inputs (1100,1101,1110,1111)(1100, 1101, 1110, 1111), v3v_3 is (0,0,1,1)(0,0,1,1). So outputs are (1+0,1+0,1+1,1+1)=(1,1,0,0)(1+0, 1+0, 1+1, 1+1) = (1,1,0,0).

Concatenating these blocks gives the full 16-bit codeword: c=(0,0,1,1,0,0,1,1,0,0,1,1,1,1,0,0) \mathbf{c} = (0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0) This vector is one of the valid codewords in the RM(2,4)RM(2, 4) code space.