ELI5: Explain Like I'm 5

Elias delta coding

Okay kiddo, today we are going to learn about Elias Delta coding! It's a way of writing down numbers in a special way so that they take up less space.

Now imagine you have a number, let's say 5. The normal way to write it down takes up one bit because it's just one digit. But with Elias Delta coding, we break the number up into two parts: a "prefix" and a "suffix".

The prefix is a special code that tells us how many binary digits long the suffix is. In the case of 5, the prefix would be 3 because when we write 5 in binary (which means using only 0's and 1's) it looks like 101. And 101 is three digits long. So the prefix for 5 would be 3.

Now we write the prefix first, followed by the suffix. The suffix is just the binary version of the number minus 1. So in this case, the suffix would be 100 because 5-1=4 and 100 is the binary version of 4.

So the Elias Delta coding for 5 would be 1100. We can see that it's two digits long, which is one less than the value of our prefix (3).

This might seem like a strange way to write numbers, but it's actually really useful when we are dealing with really big numbers. Since computers have a limited amount of memory, we need to find ways to write down numbers that take up less space. Elias Delta coding is just one way to do that!

I hope that helps you understand Elias Delta coding, kiddo!
Related topics others have asked about: