Alphabets and Words
Alphabets and Words
Example 1.0.2 In computing, we use the alphabet {0, 1}. It has length 2.
Example 1.0.3 A frequently used alphabet is the set of ASCII symbols. This set, in-
cluding its encoding by the numbers between 0 and 127, can be found in Table 1.1
1
2
Because alphabets are finite sets, their symbols can be identified with nonnegative
integers. If an alphabet has length m, then its symbols are identified with the numbers
in Zm = {0, 1, ..., m − 1}. In the following definition, we need finite sequences, which we
briefly recall. An example of a finite sequence is (2,3, 1,2,3). It has five components. The
first component is 2, the second is 3, etc. We also write this sequence as 23123. For formal
reasons, we also need the empty sequence ( ). It has zero components.
P
Definition 1.0.4 Let be an
Palphabet. P
1. A word or string over is a finite sequence of symbols from 2 including the
empty sequence, which is denoted byPε and is called the empty string.
2. The length of a word w over is the number of its components. It is denoted by
|w|. The empty word has lengthP 0. P
3. The set ofP all words over including the empty string is denoted by ∗.
4. If v, w ∈ ∗, then vw = vow is the string that is obtained by concatenating v and
w. It is called the concatenation of v andP w. In particular, we have voε = εov = v. P
5. If n is a nonnegative integer, then n is the set of all words of length n over .
Example
P 1.0.5 A word over the alphabet is COLA. It has length four. Another word
over is COCA. The concatenation of COCA and COLA is COCACOLA.
1.1 Permutations
To characterize block ciphers, a very general class of encryption schemes, we need the
notion of a permutation.
Proof. We prove the assertion by induction on n. Clearly, S1 has order 1. Suppose Sn−1
has order (n − 1)!. Consider the permutations of the set {1, ..., n}. We count the number
of permutations that send 1 to a fixed number x. In such permutations, the numbers 2, ,
n are bijectively mapped to the numbers 1, 2, . . . , x − 1, x + 1, ..., n. By the induction
hypothesis, there are (n − 1)! such bijections. But since there are n possibilities to map 1
to a number, the order of Sn is (n − 1)! = n!.
3
Let X = {0, l}” be the set of all bitstrings of length n. A permutation of X in which just
the positions of the bits are permuted is called a bit permutation. To formally describe such
a bit permutation, we choose it π ∈ Sn . Then f : {0, 1}n → {0, 1}n , b1 , ...bn → bπ(1) ...bπ(n)
is fact a bit permutation, and every bit permutation can be uniquely written in this way.
Therefore, there are n! bit permutations of bitstrings of length n. Special bit permutations
are circular left- or right-shifts . A circular left-shift of i positions maps the bitstring
(bo , b1 , ..., bn−1 ) to (bimodn , b(i+1)modn , ..., b(i+n−1)modn ). Circular right-shifts are defined
analogously.