Notes

Recap

Definition-of-an-Alphabet-in-Coding-Theory

Definition-of-a-Code-in-Coding-Theory

Definition-of-Hamming-Distance

Does Hamming distance have geometry?

How do we define something having geometry?

Definition-of-Metric-Spaces-and-Distance-Functions

Examples

There are some familiar examples of these metric spaces, as we often measure distance:

Euclidean distance

From linear algebra and calculus, on -dimensional real vector space , the standard Euclidean distance is a metric, turning into a metric space: I.e. measuring distance in a 2d plane using the Pythagorean Theorem, which can be generalised to -dimensions.

Spherical distance

Like on an approximated Earth, a round sphere is a metric space using the great circle distance. That is, given two points on the sphere’s surface, draw a great circle passing through both - their distance is measured as the length of the shortest (sub)arc so drawn between them. Explicitly, given the radius of the sphere and that and are coordinates in longitude-latitude coordinate form and respectively:

Another example is the discrete metric, where you simply take any set and define:

This is very hard to visualise, though.

Is Hamming distance a metric?

Let be a -ary alphabet. Then the Hamming distance on the set of words of length over is a metric. This can be proven using skills from the Proof module last year, defining necessary variables and then directly proving each axiom in the Definition of Metric Spaces and Distance Functions. From this proof, we can also correlate that words over an alphabet build metric spaces, as do codes.

Why is this useful?

Having and codes as metric spaces means we can take advantage of geometric concepts, such as geodesics: the shortest path between any two points.

The Hamming distance on an alphabet and a code from it represents the shortest path between any given pair of words. Logically, this makes sense: the Hamming distance represents the smallest number of changes to correct one word to its original. This can be mathematically proven, too, using induction.

Given that it’s a metric space, we can also draw these spaces as (metric) graphs, like we did in the Algebra module, e.g. is a cube where each edge represent a Hamming distance of and each vertex is a possible codeword. The minimum distance along these graphs (shortest path) is the Hamming distance, again.

Definition-of-Minimum-Code-Distance

Can this relate to error detection and correction?

Definition-of-Error-Detection

Definition-of-Error-Correction

The main theorem that relates these ideas with geometry, is the Distance Theorem:

Definition-of-Distance-Theorem

How do we prove the Distance Theorem?

To prove this theorem, we need to define a solid sphere:

Definition-of-a-Solid-Sphere

Then, you can prove the first half of the theorem by proving (as the theorem then follows from this), where represents the number of detected errors. The proof then assumes this, and proves (given that is the smallest possible distance between valid codewords of ) that a received word is in the solid sphere of radius is less than by construction.

To prove error correction, we require a lemma based on two geometric observations:

  1. Two solid spheres of radius (where errors are corrected) around any pair codewords do not contain any valid codewords in common,
  2. A word within a solid sphere for any given codeword, you require a larger solid sphere to jump to another valid codeword. These are quite logical, but can be written mathematically and hence proven, too. The first is proven by assuming the false claim and then contradicting itself, and the second by directly proof (re-writing the lemma as an inequality and simplifying it with the triangle inequality).

Then, we can prove this half of the theorem by proving that, if , then corrects errors. We then take the aforementioned lemmas, the general principle (that we assume a few errors as possible occurred during transmission), and corollary about geodesics mentioned before, to directly prove the statement.

What’s the main strategy used to prove the Distance Theorem?

The strategy is so useful, it’s named:

Definition-of-Nearest-Neighbour-Decoding

Does this theorem tell us anything else?

The distance theorem then also correlates how many errors a code can detect ( errors) and correct (up to ), where is the floor function and .

For example, a code (a repetition code of length over ) has , so can detect up to errors and correct error.

A repetition code of length over an alphabet length can then detect errors and correct errors.

This can be logically worked out, by thinking about how the code could work, but these formulae are very useful for more complex codes. Sometimes, more errors can be detected and correct, but in general this is not the case (and can be generally proven: the distance theorem is optimal).

What is decoding?

In this module, we’re focusing on the correct transmission of data, hence for the purposes of this module, decoding is simply getting the correct codeword from the transmission, i.e. correcting any errors from transmission. Thus, incorrect decoding happens if undetected transmission errors occur.

Is there any notation regarding incorrect decoding?

Given a code and a word , denote by

  • - the probability of correctly decoding ,
  • - the probability of incorrectly decoding ,
  • - the probability of not detecting errors when is transmitted.

These can sometimes be hard to calculate, but our goals is naturally to minimise .

What is the chance of incorrect decoding?

For , with transmission in a symmetric channel with symbol error probability .

Say is sent and is received. Out of the five symbols of , the following can happen:

  1. none are wrong, which can happen in ways, each with chance
    • Simplified, this is just one way with chance .
  2. one is wrong, which can happen in ways, each with chance .
    • Simplified, this is five ways with chance of .
  3. two are wrong, which can happen in ways, each with chance .
    • Simplified, this is ten ways with chance of .
  4. three are wrong, which can happen in ways, each with chance .
    • Simplified, this is ten ways with chance of .
  5. four are wrong, which can happen in ways, each with chance .
    • Simplified, this is five ways with chance of .
  6. all are wrong, which can happen in ways, each with chance .
    • Simplified, this is one way with chance of .

But, looking at the Distance Theorem and , we know that corrects up to errors. Thus, in the first three cases we can decode , which combined have a probability of…

Which thus leads to a very low chance of incorrectly decoding ().

This neatly demonstrates all the previously mentioned points.

What are parameters of a code?

Definition-of-Parameters-of-a-Code

EXAMPLE

is a -code, i.e. the codewords have length , codewords in total, with a minimum Hamming distance of where are possible symbols to use.

A more generalised answer for repetition codes, given that a code is formed from a -ary alphabet by considering messages of length and repeating each of these symbols times to their left, would result with being a -code.

For example, talking , where original messages are length and we repeat symbols twice, so . Thus, there are possible initial messages:

This is a -code, or -code.

What makes an efficient code?

A ‘good’ -code should…

  1. have a large to detect and correct many errors,
  2. have relatively small to speed up transmission
  3. have relatively large to permit a wide variety of messages.

These last two points conflict, however, leading to the Main Problem of Coding Theory:

Definition-of-the-Main-Problem-of-Coding-Theory

Some examples of are as follows…

  • . This can be proven using different definitions and then using the squeeze theorem.
  • . This is similarly proven as before.

Practical

Coding Theory Practical 2