Download presentation
Presentation is loading. Please wait.
1
Lecture 3 Strings and Things (Section 1.1)
Theory of Information Lecture 3 Theory of Information Lecture 3 Strings and Things (Section 1.1)
2
Theory of Information Lecture 3
Congruency Modulo n Theory of Information Lecture 3 Remember that Zn={0,1,…,n-1} If and are integers, the following three conditions are equivalent: 1. and have the same remainder when divided by n 2. - is divisible by n 3. there is an integer k for which =+kn When any (and hence all) of these conditions hold, we say that and are congruent modulo n, and write (mod n)
3
Examples of Congruency
Theory of Information Lecture 3 53(mod 2)? 14143(mod 2)? 14410(mod 5)? 1934124(mod 10)? -515(mod 5)? -78(mod 2)? -5 -2 147101316(mod 3)?
4
Theory of Information Lecture 3
Residue Theory of Information Lecture 3 Given an integer , there is exactly one element in Zn congruent to (modulo n). Such an integer is called the residue of modulo n. The residue of 25 modulo 7 is The residue of 32 modulo 7 is The residue of 9925 modulo 2 is The residue of 8764 modulo 2 is Give me a number whose residue modulo 7 is 7
5
Theory of Information Lecture 3
Modular Arithmetic Theory of Information Lecture 3 Let a,bZn. It, together with the following operations, is called integers modulo n: a+nb= the residue of a+b modulo n anb= the residue of ab modulo n Z5={0,1,2,3,4}. Let us just write + and instead of +5 and 5 . 1+3= 1+4= 2+3= 4+4= 23= 44= 04= 14= 0+3=
6
Arithmetic Tables for Z2
Theory of Information Lecture 3 Multiplication modulo 2: 1 Addition modulo 2: 1
7
Theory of Information Lecture 3
Fields Theory of Information Lecture 3 DEFINITION A field is a nonempty set F, together with two binary operations on F, called addition (+) and multiplication (, often omitted), satisfying the following properties: Associativity: +(+)=(+)+; ()=(). Commutativity: +=+; =. Distributivity: (+)= +. Properties of 0 and 1: There are two distinct () elements: 0 (zero) and 1 (one) such that, for all F, we have 0+= and 1=. Inverse properties: a) For every F, there is another element of F denoted by - and called the negative of , such that +(-)=0; b) For every nonzero F, there is another element of F denoted by -1 and called the inverse of , such that (-1)=1. With ordinary addition and multiplication, are the following sets fields? {0,1,…} {…-2,-1,0,1,2,…} The set of rational numbers
8
Integers Modulo 2 Is a Field
Theory of Information Lecture 3 For Z2={0,1} (as well as all other Zn), associativity, commutativity and distributivity hold because they hold for the ordinary + and . What is the negative of: 0? 1? What is the inverse of: 1? Subtraction - means +(-). In our case, 0-0= 0-1= 1-0= 1-1=
9
Integers Modulo 3 Is a Field
Theory of Information Lecture 3 What is the negative of: 0? 1? 2? What is the inverse of: 1? 2?
10
Integers Modulo 4 Is not a Field
Theory of Information Lecture 3 Z2={0,1,2,3} What would be the inverse of 2? 20= 21= 22= 23=
11
Theory of Information Lecture 3
When is Zn a field? Theory of Information Lecture 3 An integer n is said to be prime iff n has no divisors other than 1 and n. Prime numbers: 2,3,7,11,13,17,19,23,29,31,41,… THEOREM The set Zn of integers modulo n is a field if and only if n is a prime number.
12
Theory of Information Lecture 3
Strings Theory of Information Lecture 3 An alphabet is a finite, nonempty set S={s1,…,sn} of symbols. A string, or word over S is a finite sequence of elements of S. E.g., when S={a,b,…,z}, then school, bbb, a, xyz are strings/words over S. So is the empty string (theta). Stings over the alphabet {0,1} are called binary strings, and the symbols 0 and 1 are called bits. The complement of a binary string x is the result of replacing in x every 0 by 1 and every 1 by 0. Denoted by xc. Strings over {0,1,2} are called ternary strings.
13
Theory of Information Lecture 3
Strings Theory of Information Lecture 3 The juxtaposition (concatenation) of strings x and y is xy. len(x) denotes the length of string x. len(0010)=4, len(0)=1, len()=0. When S is an alphabet: S* stands for the set of all strings over S Sn stands for the set of all strings over S whose length is n Sn stands for the set of all strings over S whose length is n THEOREM Let S be an alphabet of size k. |Sn|=kn |Sn|= 1+k+k2+…+kn
14
Theory of Information Lecture 3
Strings Theory of Information Lecture 3 THEOREM 1.1.4 In (Z2)n, the number of strings with exactly k 0s is ( ) In (Zr)n, the number of strings with exactly k 0s is ( )(r-1)n-k n k n k Proof. Part 1: There is one string with exactly k 0s for every way of choosing k of the n positions in which to place 0s. Part 2: For each choice of where to place 0s, there are (r-1)n-k ways to arrange the remaining (r-1) symbols in the remaining (n-k) positions.
15
Theory of Information Lecture 3
Homework Theory of Information Lecture 3 Example of the textbook. Exercises 1,3,4,5,7,8 of Section 1.1 of the textbook.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.