ArticleslgStudy

science

Elias delta coding

Elias delta coding 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 Elias delta coding rather than just read about it. In short: Elias δ code or Elias delta code is a universal code encoding the positive integers developed by Peter Elias. Encoding To code a number X ≥ 1: Let N = ⌊log2 X⌋; be the highest power of 2 in X, so 2N ≤ X < 2N+1.

Key takeaways

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

Reference excerpt

Elias δ code or Elias delta code is a universal code encoding the positive integers developed by Peter Elias.

Encoding To code a number X ≥ 1:

Let N = ⌊log2 X⌋; be the highest power of 2 in X, so 2N ≤ X < 2N+1. Let L = ⌊log2 N + 1⌋ be the highest power of 2 in N + 1, so 2L ≤ N + 1 < 2L+1. Write L zeros, followed by the (L + 1)-bit binary representation of N + 1, followed by all but the leading bit (i.e. the last N bits) of X. An equivalent way to express the same process:

Separate X into the highest power of 2 it contains (2N) and the remaining N binary digits. Encode N + 1 with Elias gamma coding. Append the remaining N binary digits to this representation of N + 1. To represent a number x, Elias delta (δ) uses ⌊log2(x)⌋+2⌊log2(⌊log2(x)⌋+1)⌋+1 bits. This is useful for very large integers, where the overall encoded representation's bits end up being fewer than what one might obtain using Elias gamma coding due to the log2(⌊log2(x)⌋+1) portion of the previous expression. The code begins, using γ′ instead of γ:

To decode an Elias delta-coded integer:

Read and count zeros from the stream until you reach the first one. Call this count of zeros L. Considering the one that was reached to be the first digit of an integer, with a value of 2L, read the remaining L digits of the integer. Call this integer N + 1 and subtract one to get N. Put a one in the first place of the final output, representing the value 2N. Read and append the following N digits. Example: 001010011

2 leading zeros in 001 read 2 more bits, i.e. 00101 decode N + 1 = 00101 = 5 get N = 5 − 1 = 4 remaining bits for the complete code, i.e. 0011 encoded number = 24 + 3 = 19 This code can be generalized to zero or negative integers in the same ways described in Elias gamma coding.

Example code

Encoding

Decoding

Generalizations

Elias delta coding does not code zero or negative integers. One way to code all non-negative integers is to add 1 before coding and then subtract 1 after decoding. One way to code all integers is to set up a bijection, mapping integers all integers (0, 1, −1, 2, −2, 3, −3, ...) to strictly positive integers (1, 2, 3, 4, 5, 6, 7, ...) before coding. This bijection can be performed using the "ZigZag" encoding from Protocol Buffers (not to be confused with Zigzag code, nor the JPEG zigzag entropy coding).

Code length The code lengths for Elias delta coding are:

1, 4, 4, 5, 5, 5, 5, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, … (sequence A140341 in the OEIS).

See also Elias gamma (γ) coding Elias omega (ω) coding Golomb-Rice code

References

Further reading Hamada, Hozumi (June 1983). "URR: Universal representation of real numbers". New Generation Computing. 1 (2): 205–209. doi:10.1007/BF03037427. ISSN 0288-3635. S2CID 12806462. Retrieved 2018-07-09. (NB. The Elias δ code coincides with Hamada's URR representation.)

Worked examples

Example 1 — a first encounter with Elias delta coding

Start with the simplest possible case. Write down what Elias delta coding 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 Elias delta coding 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 Elias delta coding 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 Elias delta coding

In research
Elias delta coding 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 Elias delta coding 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
Elias delta coding is common in secondary-school and first-year university syllabi. It links to neighbouring topics Data compression, Entropy coding, Numeral systems, so understanding it makes those chapters shorter.
In everyday life
Look for Elias delta coding 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 “Elias delta coding” →

How to study Elias delta coding in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Elias delta coding 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 Elias delta coding out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Elias delta coding in simple terms?

Elias δ code or Elias delta code is a universal code encoding the positive integers developed by Peter Elias. Encoding To code a number X ≥ 1: Let N = ⌊log2 X⌋; be the highest power of 2 in X, so 2N ≤ X < 2N+1.

Why does Elias delta coding 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 Elias delta coding?

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 Elias delta coding.

Tags

  • Data compression
  • Entropy coding
  • Numeral systems

Keep exploring