Questions tagged [encoding-scheme]
143 questions
45
votes
9 answers
Is UTF-8 the final character encoding for all future time?
It seems to me that Unicode is the "final" character encoding. I cannot imagine anything else replacing it at this point. I'm frankly confused about why UTF-16 and UTF-32 etc. exist at all, not to mention all the non-Unicode character encodings…
Timone
- 467
- 1
- 4
- 3
32
votes
4 answers
Is Morse Code binary, ternary or quinary?
I am reading the book: "Code: The Hidden Language of Computer Hardware and Software" and in Chapter 2 author says:
Morse code is said to be a binary (literally meaning two by two) code
because the components of the code consists of only two things…
Koray Tugay
- 358
- 1
- 3
- 15
22
votes
3 answers
Why is this code uniquely decodable?
Source alphabet: $\{a, b, c, d, e, f\}$
Code alphabet: $\{0, 1\}$
$a\colon 0101$
$b\colon 1001$
$c\colon 10$
$d\colon 000$
$e\colon 11$
$f\colon 100$
I thought that for a code to be uniquely decodable, it had to be prefix-free.
But in this code,…
2000mroliver
- 333
- 2
- 6
18
votes
4 answers
Huffman encoding: why is there no need for a separator?
Char Code
==== ====
E 0000
i 0001
y 0010
l 0011
k 0100
. 0101
space 011
e 10
r 1100
s 1101
n 1110
a 1111
Original…
BufBills
- 291
- 2
- 5
13
votes
1 answer
How do I find the shortest representation for a subset of a powerset?
I'm looking for an efficient algorithm for the following problem or a proof of NP-hardness.
Let $\Sigma$ be a set and $A\subseteq\mathcal{P}(\Sigma)$ a set of subsets of $\Sigma$. Find a sequence $w\in \Sigma^*$ of least length such that for each…
avakar
- 626
- 3
- 12
9
votes
2 answers
Does a binary code with length 6, size 32 and distance 2 exist?
The problem is to prove or disprove the existence of $C$, s.t., $|c| = 6,\forall c\in C$; $|C| = 32$; $d(c_i,c_j)\geq2,1\leq i
Miangu
- 185
- 6
8
votes
1 answer
Understanding compression/encoding in linear time
I'm reading the paper N. J. Larsson, A. Moffat: Offline Dictionary-Based Compression, which describes a compression algorithm that, if I understand it correctly, is quite similar to Byte pair encoding.
Given a string $S$ of length $n$, I'm trying to…
Eff
- 219
- 1
- 9
8
votes
2 answers
What is an "encoding" of a TM?
I'm currently working on a reduction from $A_{TM}$ to another language, and have been reading through some example proofs. I've come across the situation where, for example, we have $L = \{ \langle M,w \rangle | \text{ ...etc} \}$, where obviously…
user3472798
- 481
- 2
- 5
- 9
8
votes
2 answers
How does one choose an optimal alphabet for finding a Huffman encoding?
Huffman encoding will perform best when the distribution of symbols of an alphabet that the string to be encoded uses is dyadic.
Given an arbitrary bit string S, how can we find the best alphabet for encoding? Suppose S is an ASCII file. Then given…
VF1
- 327
- 1
- 14
7
votes
3 answers
What is the minimum required storage for a sparse, depth-first octree?
For a numerical simulation framework, I use a hierarchical Cartesian grid in 3D to discretize the computational domain. I am thus looking for the most space-efficient way to store the resulting octree on disk, given the following conditions:
It is…
6
votes
1 answer
Optional prefix code for the naturals
The naturals $\mathbb{N}$ can be encoded with a binary unary code such as
$$
\begin{align}
1&=0_b\\
2&=10_b\\
3&=110_b\\
&...
\end{align}
$$
The length this the encoding grows linearly with the natural number it represents. For…
Anon21
- 355
- 1
- 9
6
votes
2 answers
Can nested structures be encoded more "readably" with a single delimiter?
Imagine you have two systems of delimiting. One with paired delimiters, [ and ]:
[abc]
Then another system which uses a single interstitial delimiter, /:
a/b/c
It's easy to see how to encode structure in the first case, as they nest…
6
votes
1 answer
Error correcting permutation code
Let's say you have $n$ symbols. You can encode a $\log_2(n!)$-bit message by permutating the symbols. I will call this a permutation code (if you have seen this concept before, I would love to see a reference).
Let's say we are encoding a message…
Christopher King
- 788
- 1
- 5
- 19
6
votes
4 answers
Is there any practical trick to mentally count in Gray code?
When I was fairly young, I taught myself to count in binary. I thought it would be a fun party trick to impress people. I soon found out that it was not.
Over the years I've come to appreciate Gray code/reflected binary code for its property of only…
smitelli
- 191
- 1
- 3
5
votes
3 answers
Defining computable functions on arbitrary sets
Turing machines take inputs that are strings of symbols from some alphabet, and they give outputs that are strings of symbols from the same alphabet. To show that a function is computable, we have to exhibit a Turing machine that computes it. In the…
N. Virgo
- 1,006
- 5
- 21