Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [coding-theory]

The challenge involves the topic of encoding and coding theory, as in error correction and compression. (Not to be confused with program source code).

Filter by
Sorted by
Tagged with
17 votes
5 answers
882 views

In this challenge, we consider an encoding from positive integers (up to a limit) to binary sequences. Some examples: ...
Bubbler's user avatar
  • 79.3k
15 votes
10 answers
1k views

A Gray code is a permutation on binary numbers where incrementing or decrementing a number only ever causes a single bit to change. For example, a Gray code for the binary numbers up to 7 (so, with 3 ...
pxeger's user avatar
  • 25.3k
23 votes
21 answers
4k views

Fibonacci coding is a universal code, which can encode positive integers of any size in an unambiguous stream of bits. To encode an integer \$ n \$: Find the largest Fibonacci number less than or ...
pxeger's user avatar
  • 25.3k
27 votes
11 answers
2k views

Background An \$n\$-bit Gray code is an ordering of \$2^n\$ binary sequences so that adjacent sequences always differ by exactly one bit. A Beckett-Gray code is a special kind of Gray code. In ...
Bubbler's user avatar
  • 79.3k
8 votes
3 answers
1k views

Given a stream of bits, output the shortest possible Hamming code that encodes it. The steps to generate the Hamming code are as follows, although your submission does not necessarily have to conform ...
Doorknob's user avatar
  • 72.1k
42 votes
14 answers
5k views

Introduction A Gray Code is an alternative to binary representation in which a number is incremented by toggling only one bit, rather than a variable amount of bits. Here are some gray codes along ...
Patrick Roberts's user avatar
7 votes
6 answers
1k views

Introduction Maximum-length sequences, usually known as m-sequences, are binary sequences with some interesting properties (pseudo-noise appeareance, optimal periodic autocorrelation) which make them ...
Luis Mendo's user avatar
  • 107k
14 votes
7 answers
1k views

Or else he will huff and puff and blow your house down! That was completely irrelevant. This challenge is actually about Huffman coding. The gist of it is the frequency of characters in a given text ...
El'endia Starman's user avatar
13 votes
1 answer
779 views

First, some definitions. A Hadamard matrix is a square matrix whose entries are either +1 or −1 and whose rows are mutually orthogonal. The Hadamard conjecture proposes that a Hadamard matrix of ...
user avatar
6 votes
1 answer
667 views

Write a program or function that takes a base n and a number x, and returns or outputs the n-...
matsjoyce's user avatar
  • 1,359
21 votes
8 answers
5k views

The Hamming(7,4) code goes back to 1950. Back then Richard Hamming worked as a mathematician at Bell Labs. Every Friday Hamming set the calculating machines to perform a series of calculation, and ...
Jakube's user avatar
  • 22k