Information Theory ExercisesInformation Theory · Exercises
0 / 0

Workbench / Information Theory Exercises

B1·08

Channels and Noise

Exercises for chapter 8: channels as probabilities, why a flip costs more than an erasure, the binomial count of errors, the price of repetition, what distance buys, and checks against correcting, in your own words; codes and checks by hand, bursts of errors and the interleaving that spreads them out, CRC-32 written from scratch and checked against zlib, a Hamming code that detects two errors as well as fixing one, noise on plain and compressed text, the count of typical error patterns that chapter 9 needs, and senior exercises on silent corruption in storage, choosing a check digit for an identifier, and a link that drops one packet in a hundred.

20 topics · ~5 min read
Updated Suggest a correction

Start here: how these exercises work

Write your answer in the box first; hints open one at a time as you write, and the solution a couple of minutes after the last hint. Theory is in your own words, practice and programs come with real output (Python 3.13), cumulative projects use chapters 1 to 8 together, what the chapter leaves out explains what it skips, and senior exercises put the ideas into designs and reviews. The programs import the chapter's chan.py.

Theory

T1. A channel is its probabilities

Explain what it means to describe a channel by p(y∣x), and why the binary symmetric channel with p=0.5 is useless while the one with p=0.9 isn't.

T2. Why a flip costs more than a loss

Erasing 10 % of bits leaves 0.9 bits per use; flipping 10 % leaves 0.531. Explain the difference without formulas.

T3. The binomial count and long messages

Explain why a channel with an error rate of one in a billion still almost never delivers a 10 GB file perfectly, and what that implies for system design.

T4. The price of repetition

Explain why repetition codes can make errors as rare as you like but only by making the rate fall towards zero, and why that seemed to be a law of nature before 1948.

T5. What distance buys

Explain, with a picture of codewords as points, why a code with minimum distance 3 can correct one error but a code with minimum distance 2 can only detect one.

T6. Checks against corrections

Explain why systems usually detect errors and resend rather than correct them, and give two situations where correction is necessary.

Practice and programs

P1. By hand

(a) Find the Hamming(7,4) codeword for data 0110 (positions p1p2d1p3d2d3d4). (b) The block 1110000 arrives; find the syndrome and the data. (c) Compute the 3-bit CRC of 1011 with generator 1011, and explain the result. (d) What ISBN-10 check character completes 0-306-40615?

P2. Bursts of errors, and interleaving

Real channels make errors in bursts. Simulate a channel that's usually good (one flip in 2,000) but now and then enters a bad state (three flips in ten) for about ten bits, and compare Hamming(7,4) with and without interleaving: writing 7-bit codewords as the rows of a table and sending it column by column, so a burst hits many codewords once each.

P3. CRC-32 from scratch

Write CRC-32 bit by bit and with a 256-entry table, check both against zlib.crc32 (including the standard check value for "123456789", cbf43926), and compare their speeds.

P4. A Hamming code that also detects two errors

Add an overall parity bit to Hamming(7,4), making the 8-bit SECDED code (single error correction, double error detection) used in ECC memory. Test every single, double and triple error on every message.

Cumulative projects (chapters so far: 01–08)

C1. Noise on plain text and on compressed text

Send the plays through a binary symmetric channel with p from 10−7 to 10−5, once as plain text and once compressed with deflate, and count the wrong bytes after decoding. Use chapter 6's compression and this chapter's channel.

C2. How many ways can noise strike?

For a block of n bits through a channel with p=0.1, find the probability that the number of errors is within 3 standard deviations of np, and count the error patterns in that window, for n from 100 to 100,000. Compare 1nlog2(patterns) with h(0.1). Use chapter 2's counting and chapter 6's typical sets.

What the chapter leaves out

Linear codes and generator matrices

Hamming(7,4) is a linear code: the sum (exclusive or) of two codewords is a codeword, and every codeword is the data multiplied by a generator matrix, while the checks are a parity-check matrix whose product with a received block is the syndrome. Almost every practical code is linear, which makes encoding a matrix multiplication and lets the minimum distance be read off as the smallest number of 1s in a non-zero codeword.

Reed–Solomon codes

Irving Reed and Gustave Solomon (1960) built codes over symbols of several bits (bytes, usually), treating a block as the values of a polynomial. A Reed–Solomon code with 2t check symbols corrects any t wrong symbols, or 2t erased ones, so a burst that damages many bits of a few bytes costs only those bytes. With interleaving, they protect CDs, DVDs, QR codes, barcodes, RAID 6 and deep-space links.

Bounds on codes

How good can a code be? The Hamming bound says that balls of radius t around the codewords can't overlap, so their total size can't exceed 2n; Hamming codes meet it exactly ("perfect codes"). The Singleton bound says d≤n−k+1, and Reed–Solomon codes meet it. The Gilbert–Varshamov bound shows good codes exist. These bounds count codewords and distances; chapter 9's capacity is the probabilistic counterpart.

Soft decisions

The chapter's receivers decide 0 or 1 for each bit and then decode. Real receivers measure a voltage or a phase, and a value close to the threshold is less trustworthy than one far from it. Decoders that use this "soft" information (how confident each bit is) gain the equivalent of roughly doubling the signal power, and modern codes (turbo and LDPC) depend on it.

Senior exercises

S1. Silent corruption in storage

A team stores customer documents on a cluster of disks with RAID, and assumes the data is safe. An audit finds a few documents whose contents changed with no record of any write. Explain how that can happen despite RAID and the disks' own error correction, and what to change.

S2. A check digit for an identifier

Your product is introducing 10-digit customer numbers that support staff type into a tool and read out over the phone. Choose a check scheme and justify it, with the chapter's numbers.

A service's traffic between two data centres runs over a link that, after a hardware change, loses or damages about 1 % of packets. TCP still delivers everything correctly, but throughput has fallen sharply. Explain why, and what the options are.