ArticleslgStudy

science

Erasure code

Erasure code is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Erasure code rather than just read about it. In short: In coding theory, an erasure code is a forward error correction (FEC) code under the assumption of bit erasures (rather than bit errors), which transforms a message of k symbols into a longer message (code word) with n symbols such that the original message can be recovered from a subset of the n symbols. The fraction r = k/n is called the code rate.

Erasure code — main illustration
Erasure code — illustration

Key takeaways

  • Erasure code belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Erasure code to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Erasure code from memory before moving on to harder problems.

Reference excerpt

In coding theory, an erasure code is a forward error correction (FEC) code under the assumption of bit erasures (rather than bit errors), which transforms a message of k symbols into a longer message (code word) with n symbols such that the original message can be recovered from a subset of the n symbols. The fraction r = k/n is called the code rate. The fraction k'/k, where k' denotes the number of symbols required for recovery, is called reception efficiency. The recovery algorithm expects that it is known which of the n symbols are lost.

History Erasure coding was invented by Irving Reed and Gustave Solomon in 1960. There are many different erasure coding schemes. The most popular erasure codes are Reed-Solomon coding, low-density parity-check code (LDPC codes), and turbo codes. As of 2023, modern data storage systems can be designed to tolerate the complete failure of a few disks without data loss, using one of 3 approaches:

Replication RAID (redundant array of inexpensive disks) Erasure coding While technically RAID can be seen as a kind of erasure code, RAID is generally applied to an array attached to a single host computer (which is a single point of failure), while "erasure coding" generally implies multiple hosts, sometimes called a redundant array of inexpensive servers (RAIS). The erasure code allows operations to continue when any one of those hosts stops. Compared to block-level RAID systems, object storage erasure coding has some significant differences that make it more resilient.

Optimal erasure codes

Optimal erasure codes have the property that any k out of the n code word symbols are sufficient to recover the original message (i.e., they have optimal reception efficiency). Optimal erasure codes are maximum distance separable codes (MDS codes).

Parity check

Parity check is the special case where n = k + 1. From a set of k values {vi}1≤i≤k, a checksum is computed and appended to the k source values:

vk+1=−∑i=1kvi. The set of k + 1 values {vi}1≤i≤k+1 is now consistent with regard to the checksum. If one of these values, ve, is erased, it can be easily recovered by summing the remaining variables:

ve=−∑i=1,i≠ek+1vi. RAID 5 is a widely used application of the parity check erasure code using XOR.

Polynomial oversampling

Example: Err-mail (k = 2) In the simple case where k = 2, redundancy symbols may be created by sampling different points along the line between the two original symbols. This is pictured with a simple example, called err-mail: Alice wants to send her telephone number (555629) to Bob using err-mail. Err-mail works just like e-mail, except

About half of all the mail gets lost. Messages longer than 5 characters are illegal. It is very expensive (similar to air-mail). Instead of asking Bob to acknowledge the messages she sends, Alice devises the following scheme.

She breaks her telephone number up into two parts a = 555, b = 629, and sends 2 messages – "A=555" and "B=629" – to Bob. She constructs a linear function, f(i)=a+(b−a)(i−1), in this case f(i)=555+74(i−1), such that f(1)=555 and f(2)=629.

She computes the values f(3), f(4), and f(5), and then transmits three redundant messages: "C=703", "D=777" and "E=851". Bob knows that the form of f(k) is f(i)=a+(b−a)(i−1), where a and b are the two parts of the telephone number. Now suppose Bob receives "D=777" and "E=851".

Bob can reconstruct Alice's phone number by computing the values of a and b from the values (f(4) and f(5)) he has received. Bob can perform this procedure using any two err-mails, so the erasure code in this example has a rate of 40%. Note that Alice cannot encode her telephone number in just one err-mail, because it contains six characters, and that the maximum length of one err-mail message is five characters. If she sent her phone number in pieces, asking Bob to acknowledge receipt of each piece, at least four messages would have to be sent anyway (two from Alice, and two acknowledgments from Bob). So the erasure code in this example, which requires five messages, is quite economical. This example is a little bit contrived. For truly generic erasure codes that work over any data set, we would need something other than the f(i) given.

General case The linear construction above can be generalized to polynomial interpolation. Additionally, points are now computed over a finite field. First we choose a finite field F with order of at least n, but usually a power of 2. The sender numbers the data symbols from 0 to k − 1 and sends them. He then constructs a (Lagrange) polynomial p(x) of order k such that p(i) is equal to data symbol i. He then sends p(k), ..., p(n − 1). The receiver can now also use polynomial interpolation to recover the lost packets, provided he receives k symbols successfully. If the order of F is less than 2b, where b is the number of bits in a symbol, then multiple polynomials can be used. The sender can construct symbols k to n − 1 'on the fly', i.e., distribute the workload evenly between transmission of the symbols. If the receiver wants to do his calculations 'on the fly', he can construct a new polynomial q, such that q(i) = p(i) if symbol i < k was received successfully and q(i) = 0 when symbol i < k was not received. Now let r(i) = p(i) − q(i). Firstly we know that r(i) = 0 if symbol i < k has been received successfully. Secondly, if symbol i ≥ k has been received successfully, then r(i) = p(i) − q(i) can be calculated. So we have enough data points to construct r and evaluate it to find the lost packets. So both the sender and the receiver require O(n (n − k)) operations and only O(n − k) space for operating 'on the fly'.

Real world implementation This process is implemented by Reed–Solomon codes, with code words constructed over a finite field using a Vandermonde matrix. Most practical erasure codes are systematic codes—each one of the original k symbols can be found copied, unencoded, as one of the n message symbols. (Erasure codes that support secret sharing never use a systematic code).

… excerpt ends here. Continue reading the full article.

Illustrations

Erasure code illustration

Worked examples

Example 1 — a first encounter with Erasure code

Start with the simplest possible case. Write down what Erasure code claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Erasure code before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Erasure code ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Erasure code

In research
Erasure code appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Erasure code in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Erasure code is common in secondary-school and first-year university syllabi. It links to neighbouring topics Coding theory, so understanding it makes those chapters shorter.
In everyday life
Look for Erasure code outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Erasure code” →

How to study Erasure code in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Erasure code means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Erasure code out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Erasure code in simple terms?

In coding theory, an erasure code is a forward error correction (FEC) code under the assumption of bit erasures (rather than bit errors), which transforms a message of k symbols into a longer message (code word) with n symbols such that the original message can be recovered from a subset of the n s…

Why does Erasure code matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Erasure code?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Erasure code.

Tags

  • Coding theory

Keep exploring