---
title: "(4,3) even parity code is linear, odd parity is not"
subject: "Communication Systems"
chapter: 8
key: "semester_6/communication_systems:even-odd-parity-linear-block"
source: https://www.bctengineer.com/q/semester_6/communication_systems/even-odd-parity-linear-block
site: BCT Engineering
---

# (4,3) even parity code is linear, odd parity is not

Communication Systems · Chapter 8: Error Detection and Correction Coding

- Asked in: 2081 Baisakh (CS II), 7 marks
- Video: [Unit 5 L5 | Block codes | Even parity Block Code | Odd Parity Block codes | Linear block codes](https://www.youtube.com/watch?v=AfTqwtIq9sE) — Techno Tutorials ( e-Learning)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/communication_systems/even-odd-parity-linear-block
- Whole chapter: https://www.bctengineer.com/md/semester_6/communication_systems/chapter-8

## Question

Prove that (4,3) even parity code is a linear block code and (4,3) odd parity code is not a linear block code.

## Short answer

(4,3) even parity code is linear: all-zero word is codeword and sum of any two codewords is a codeword. (4,3) odd parity code is not linear because all-zero word is missing and sum of two codewords has even weight, not in code.

## Answer

A block code is **linear** if (1) the all-zero word is a codeword and (2) the modulo-2 sum of any two codewords is also a codeword (closure). For binary codes, (2) implies (1) since $\mathbf{c}\oplus\mathbf{c}=\mathbf{0}$.

A (4,3) parity code takes 3 message bits $m_1m_2m_3$ and adds one parity bit $p$.

#### Even parity code is linear

$p=m_1\oplus m_2\oplus m_3$, so every codeword has an even number of 1s:

| Message | Codeword | Message | Codeword |
|---|---|---|---|
| 000 | 0000 | 100 | 1001 |
| 001 | 0011 | 101 | 1010 |
| 010 | 0101 | 110 | 1100 |
| 011 | 0110 | 111 | 1111 |

**General proof:** let $\mathbf{c}_1,\mathbf{c}_2$ be codewords, with weights $w_1,w_2$ both even. Then

$$
w(\mathbf{c}_1\oplus\mathbf{c}_2)=w_1+w_2-2\,w(\mathbf{c}_1\cdot\mathbf{c}_2)
$$

where $\mathbf{c}_1\cdot\mathbf{c}_2$ counts positions where both are 1. Even + even − even = even, so the sum is again an even-weight 4-bit word, i.e. a codeword. Also $0000$ is a codeword.

Equivalently, the code can be generated by a matrix:

$$
G=\begin{bmatrix}1&0&0&1\\0&1&0&1\\0&0&1&1\end{bmatrix},\qquad \mathbf{c}=\mathbf{m}G
$$

and $\mathbf{m}_1G\oplus\mathbf{m}_2G=(\mathbf{m}_1\oplus\mathbf{m}_2)G$, which is a codeword.

Example: $0011\oplus0101=0110$ (codeword), $1001\oplus1111=0110$ (codeword). **Hence the (4,3) even parity code is a linear block code.**

#### Odd parity code is not linear

$p=m_1\oplus m_2\oplus m_3\oplus1$, so every codeword has an odd number of 1s:

| Message | Codeword | Message | Codeword |
|---|---|---|---|
| 000 | 0001 | 100 | 1000 |
| 001 | 0010 | 101 | 1011 |
| 010 | 0100 | 110 | 1101 |
| 011 | 0111 | 111 | 1110 |

1. The all-zero word $0000$ has even weight, so it is **not** a codeword.
2. Closure fails: for odd $w_1,w_2$, $w_1+w_2-2(\cdot)$ is even, so the sum of two codewords always has even weight and is never a codeword. Example: $0001\oplus0010=0011$, weight 2, not in the code.

**Hence the (4,3) odd parity code is not a linear block code.**

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What conditions must a block code satisfy to be linear?
   A. All codewords have the same weight
   B. The all-zero word is a codeword and the modulo-2 sum of any two codewords is a codeword
   C. Its length is a power of 2
   D. Codewords have an even number of bits
   Answer: B. Closure under modulo-2 addition (which implies the zero word is present) defines a linear code. (Key point: Linearity test)

2. Why is the modulo-2 sum of two even-weight codewords again a codeword?
   A. w(c1+c2) = w1 + w2 - 2w(c1.c2) is even
   B. The sum always has weight 1
   C. Even weights add to an odd number
   D. Parity bits are ignored in the sum
   Answer: A. Even + even - even is even, so the sum is an even-weight 4-bit word, which is a codeword. (Key point: Even parity proof)

3. Which fact shows the (4,3) odd parity code is not linear?
   A. 0000 has even weight so it is not a codeword
   B. It has 16 codewords
   C. It has a generator matrix
   D. All codewords have weight 3
   Answer: A. A linear code must contain the all-zero word, but 0000 has even weight and is excluded from the odd code. (Key point: Odd parity fails: zero word)

4. Why does closure fail for the odd parity code, e.g. 0001 XOR 0010?
   A. The result 0011 has even weight (2), so it is not in the code
   B. The result 0011 is in the code
   C. The result has weight 1
   D. The result is 0000
   Answer: A. The sum of two odd-weight words is always even-weight, so never a codeword. (Key point: Odd parity fails: closure)

## Related in Communication Systems

- [Short note: Syndrome calculation in linear systematic block code](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ashort-note-syndrome-calculation) — Communication Systems, chapter 8
- [(6, 3) code from parity check matrix](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Alinear-block-code-6-3-h-matrix) — Communication Systems, chapter 8
- [Convolutional vs block codes; (7,4) cyclic code for 1011](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1011) — Communication Systems, chapter 8, asked 2×
- [Convolutional vs block coder; (7,4) cyclic code for 1010](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aconv-vs-block-cyclic-7-4-1010) — Communication Systems, chapter 8, asked 2×
- [Analog and digital system block diagrams; linear and non-linear distortion](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Aanalog-digital-block-linear-nonlinear-distortion) — Communication Systems, chapter 1
- [Hamming distance and weight; (6,3) code check for 100101](https://www.bctengineer.com/question.md?key=semester_6%2Fcommunication_systems%3Ahamming-6-3-h-100101) — Communication Systems, chapter 8

## Related in other subjects

- [Design a C(8,4) linear block code](https://www.bctengineer.com/question.md?key=semester_5%2Fdata_communication%3Alinear-block-code-84) — Data Communication, chapter 8
- [Parity bits and 3-bit odd parity generator](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Aparity-odd-generator-3bit) — Digital Logic, chapter 4, asked 2×
- [8085 ALP: odd parity transfer with bit change](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Aalp-8085-odd-parity-transfer) — Microprocessor, chapter 2
- [Handshaking theorem; even number of odd vertices](https://www.bctengineer.com/question.md?key=semester_4%2Fdiscrete_structure%3Ahandshaking-even-odd-degree-proof) — Discrete Structure, chapter 4, asked 3×
