COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences. Revision: 1.3

Similar documents
COMP9020 Lecture 3 Session 2, 2016 Sets, Functions, and Sequences. Revision: 1.3

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Week Some Warm-up Questions

Chapter 1 : The language of mathematics.

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Mathematics Review for Business PhD Students

Automata Theory and Formal Grammars: Lecture 1

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Mathematics Review for Business PhD Students Lecture Notes

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

Set Theory. CSE 215, Foundations of Computer Science Stony Brook University

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

Sets McGraw-Hill Education

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

0 Sets and Induction. Sets

BASIC MATHEMATICAL TECHNIQUES

Automata and Languages

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

With Question/Answer Animations. Chapter 2

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Analysis I. Classroom Notes. H.-D. Alber

Introduction to Automata

Propositional Logic, Predicates, and Equivalence

Today s topics. Introduction to Set Theory ( 1.6) Naïve set theory. Basic notations for sets

Part IA Numbers and Sets

Sets and Motivation for Boolean algebra

Chapter 0 Introduction. Fourth Academic Year/ Elective Course Electrical Engineering Department College of Engineering University of Salahaddin

CISC 1100: Structures of Computer Science

MAT115A-21 COMPLETE LECTURE NOTES

Background for Discrete Mathematics

CS 2336 Discrete Mathematics

BOOLEAN ALGEBRA INTRODUCTION SUBSETS

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

MATH 201 Solutions: TEST 3-A (in class)

Notation Index. gcd(a, b) (greatest common divisor) NT-16

A set is an unordered collection of objects.

ICS141: Discrete Mathematics for Computer Science I

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Section 0. Sets and Relations

MAS114: Solutions to Exercises

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

2.1 Sets. Definition 1 A set is an unordered collection of objects. Important sets: N, Z, Z +, Q, R.

Introduction to Proofs

Sets. Introduction to Set Theory ( 2.1) Basic notations for sets. Basic properties of sets CMSC 302. Vojislav Kecman

Discrete Basic Structure: Sets

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Spring

Sets and Functions. MATH 464/506, Real Analysis. J. Robert Buchanan. Summer Department of Mathematics. J. Robert Buchanan Sets and Functions

n CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161

Topics in Logic and Proofs

Number Theory and Counting Method. Divisors -Least common divisor -Greatest common multiple

In N we can do addition, but in order to do subtraction we need to extend N to the integers

CS 173: Discrete Structures. Eric Shaffer Office Hour: Wed. 1-2, 2215 SC

Notes. Functions. Introduction. Notes. Notes. Definition Function. Definition. Slides by Christopher M. Bourke Instructor: Berthe Y.

Chapter 2 - Basics Structures MATH 213. Chapter 2: Basic Structures. Dr. Eric Bancroft. Fall Dr. Eric Bancroft MATH 213 Fall / 60

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

1 Chapter 1: SETS. 1.1 Describing a set

Today s Topics. Methods of proof Relationships to logical equivalences. Important definitions Relationships to sets, relations Special functions

Math 13, Spring 2013, Lecture B: Midterm

Applied Cryptography and Computer Security CSE 664 Spring 2017

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

Notes on Sets, Relations and Functions

SETS. JEE-Mathematics

A Semester Course in Basic Abstract Algebra

Contribution of Problems

1. SET 10/9/2013. Discrete Mathematics Fajrian Nur Adnan, M.CS

LESSON RELATIONS & FUNCTION THEORY

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

Set Theory. CPT Section D Quantitative Aptitude Chapter 7 Brijeshwar Prasad Gupta

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

CSE 20. Final Review. CSE 20: Final Review

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

C-N Math 207 Discrete Math

C-N Math 207 Discrete Math

Exercises for Unit VI (Infinite constructions in set theory)

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

Assignment #2 COMP 3200 Spring 2012 Prof. Stucki

A B is shaded A B A B

SETS. Chapter Overview

Chapter 2 - Basics Structures

CSCE 222 Discrete Structures for Computing

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. College Algebra for STEM

Foundations of Mathematics

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages

SETS AND FUNCTIONS JOSHUA BALLEW

Sets, Functions and Relations

Foundations Revision Notes

SET THEORY. 1. Roster or Tabular form In this form the elements of the set are enclosed in curly braces { } after separating them by commas.

ECEN 5022 Cryptography

Review 1. Andreas Klappenecker

Transcription:

1 COMP9020 Lecture 3 Session 2, 2014 Sets, Functions, and Sequences Revision: 1.3

2 Notation for Numbers Definition Integers Z = {... 2, 1, 0, 1, 2,...} Reals R. : R Z floor of x, the greatest integer x. : R Z ceiling of x, the least integer x Example π = 3 = e

3 Simple properties x = x, hence x = x x + t = x + t and x + t = x + t, for all t Z Fact Let k, m, n Z such that k > 0 and m n. The number of multiples of k in the interval [n.. m] is m k n 1 k.

4 Examples 1.1.4(b) 2 0.6 1.2 = 1; 2 0.6 1.2 = 0 (d) 3 3 = 1; the same for every noninteger 1.1.19(a) Give x, y s.t. x + y < x + y. 3π + e = 9 + 2 = 11 < 12 = 9.42 + 2.71 = 3π + e

5 Divisibility Let m, n Z. m n means m is a divisor of n, defined by n = km for some k Z Also stated: n is divisible by m, m is a divisor of n m n - negation of m n Notion of divisibility applies to all integers positive, negative and zero. 1 m, 1 m, m m, m m, for every m 0 n 0 for every n; 0 n except n = 0

6 Notions derived from divisibility Numbers > 1 divisible only by 1 and themselves are primes. The greatest common divisor of n, m Z is gcd(m, n) = max { d N : d m d n }. Numbers m and n s.t. gcd(m, n) = 1 are said to be relatively prime or co-prime. The least common multiple of n, m Z is lcm(m, n) = min { d N : m d n d }. NB gcd(m, n) and lcm(m, n) are always taken as positive gcd( 4, 6) = gcd(4, 6) = gcd( 4, 6) = gcd(4, 6) = 2 lcm( 5, 5) =... = 5

7 Absolute Value x = { x, if x 0 x, if x < 0 NB gcd(m, n) lcm(m, n) = m n

Examples 1.2.2 True or False. Explain briefly. (a) n 1 only if n = 1 (for n Z also n = 1) (b) n n always (c) n n 2 always 1.2.7(b) gcd(0, n) = n 1.2.12 Can two even integers be relatively prime? No; why? 1.2.20(b) Find m, n, s st 1 m + 1 n = 1 s with s < lcm(n, m). In fact, if such s exists it must be s < m, s < n. NB Representing fractions (i.e. rational numbers) in the form r = 1 n 1 + 1 n 2 +... + 1 n k, n 1 > n 2 >... > n k 8 is called Egyptian fractions. Note that all denominators must be different; it is always possible, but not always easy.

Examples 1.2.2 True or False. Explain briefly. (a) n 1 only if n = 1 (for n Z also n = 1) (b) n n always (c) n n 2 always 1.2.7(b) gcd(0, n) = n 1.2.12 Can two even integers be relatively prime? No; why? 1.2.20(b) Find m, n, s st 1 m + 1 n = 1 s with s < lcm(n, m). In fact, if such s exists it must be s < m, s < n. NB Representing fractions (i.e. rational numbers) in the form r = 1 n 1 + 1 n 2 +... + 1 n k, n 1 > n 2 >... > n k 9 is called Egyptian fractions. Note that all denominators must be different; it is always possible, but not always easy.

Examples 1.2.2 True or False. Explain briefly. (a) n 1 only if n = 1 (for n Z also n = 1) (b) n n always (c) n n 2 always 1.2.7(b) gcd(0, n) = n 1.2.12 Can two even integers be relatively prime? No; why? 1.2.20(b) Find m, n, s st 1 m + 1 n = 1 s with s < lcm(n, m). In fact, if such s exists it must be s < m, s < n. NB Representing fractions (i.e. rational numbers) in the form r = 1 n 1 + 1 n 2 +... + 1 n k, n 1 > n 2 >... > n k 10 is called Egyptian fractions. Note that all denominators must be different; it is always possible, but not always easy.

11 Sets A set is defined by the collection of its elements. Sets are typically described by: (a) Explicit enumeration of their elements S 1 = {a, b, c} = {a, a, b, b, b, c} = {b, c, a} =... three elements S 2 = {a, {a}} S 3 = {a, b, {a, b}} S 4 = {} S 5 = {{{}}} S 6 = { {}, {{}} } two elements zero elements three elements one element two elements

12 (b) Specifying the properties their elements must satisfy; the elements are taken from some universal domain. A typical description involves a logical property P(x) S = { x : x X P(x) } = { x X : P(x) } We distinguish between an element and the set comprising of this single element. Thus always a {a}. Set {} is empty (no elements); set {{}} is nonempty it has one element. There is only one empty set; only one set consisting of a single a; only one set of all natural numbers.

13 (c) Constructions from other sets (already defined) Union, intersection, set difference, symmetric difference, complementation Power set P(X ) = { A : A X } Cartesian product (below) Empty set, also written {} X for all sets X. S T S is a subset of T ; includes the case of T T S T a proper subset: S T and S T NB An element of a set and a subset of that set are two different concepts a {a, b}, a {a, b}; {a} {a, b}, {a} / {a, b}

14 Cardinality Number of elements in a set X ; (various notations) X = #(X ) = card(x ) Always P(X ) = 2 X [m.. n] interval of integers; it is empty if n < m [m.. n] = n m + 1, for n m = 0 P( ) = { } P( ) = 1 P(P( )) = {, { }}... {a} = 1 P({a}) = {, {a}} P({a}) = 2...

15 Examples 1.3.2 Find the cardinalities of sets 1 { 1 n : n [1.. 4] } = 4 four indices, no repetitions of values 2 { n 2 n : n [0.. 4] } = 4 one repetition of value 3 { 1 n 2 : n P 2 n n < 11 } = 5 4 { 2 + ( 1) n : n N } = 2 which are the two elements?

16 Sets of Numbers Natural numbers N = {0, 1, 2,...} Positive integers P = {1, 2,...} common notation N >0 = Z >0 = N \ 0 Integers Z = {..., n, (n 1),..., 1, 0, 1, 2,...} Rational numbers (fractions) Q = { } m n : m, n Z, n 0 Real numbers R In P N Z different symbols denote different numbers. In Q and R the standard representation is not necessarily unique.

17 NB Proper ways to introduce reals include Dedekind cuts and Cauchy sequences, neither of which will be discussed here. Natural numbers etc. are either axiomatized or constructed a from sets (0 = def {}, n + 1 = def n {n}) a If we need to emphasise that an object (expression, formula) is defined through an equality we use the symbol def =. It denotes that the object on the left is defined by the formula/expression given on the right.

18 Number sets and their containments Derived sets of positive numbers P N Z Q R P = N >0 = Z >0 = {n : n 1} Q >0 = {r : r = k l > 0} R >0 Derived sets of integers 2Z = { 2x : x Z } 3Z + 1 = { 3x + 1 : x Z } the even numbers

19 Intervals of numbers (applies to any type) [a, b] = { x : a x b } (a, b) = { x : a < x < b } [a, b] [a, b) (a, b] (a, b) NB (a, a) = (a, a] = [a, a) = ; however [a, a] = {a}. Intervals of P, N, Z are finite: if m n [m.. n] = {m, m + 1,..., n} [m.. n] = n m + 1

20 Set Operations Union A B; Intersection A B Note that there is a correspondence between set operations and logical operators (to be discussed in Topic-2) One can match set A with that subset of the universal domain, where the property a holds, then match B with the subset where b holds. Then A B a or b; A B a and b We say that A, B are disjoint if A B =. NB A B = B A B A B = B A B

21 Other set operations A \ B difference, set difference, relative complement. It corresponds (logically) to a but not b A B symmetric difference A B = def (A \ B) (B \ A) It corresponds to a and not b or b and not a; it is termed xor (exclusive or) A c = A set complement w.r.t. the universe. It corresponds to not a.

22 Cartesian Product S T = def { (s, t) : s S, t T }, where (s, t) is an ordered pair n i=1s i def = { (s 1,..., s n ) : s k S k, for 1 k n } S 2 = S S, S 3 = S S S,..., S n = n 1 S,... S =, for every S S T = S T, n i=1 S i = n i=1 S i

23 Venn diagrams p23 26: are a simple graphical tool to reason about the algebraic properties of set operations. De Morgan laws p 25, Table 1: are the rules satisfied by set operations, esp. those involving complementation. They are often termed set algebra rules, due to their partial correspondence to the algebra of positive integers.

24 Examples 1.4.4 Σ = {a, b} (a) All subsets of Σ :, {a}, {b}, {a, b} (b) P(Σ) = 4 1.4.7 A A? =, A? = A for all A 1.4.8 Relate the cardinalities A B = A + B A B hence A B + A B = A + B A \ B = A A B A B = A + B 2 A B

25 Formal Languages Σ alphabet, a finite, nonempty set Examples (of various alphabets and their intended uses) Σ = {a, b,..., z} for single words (in lower case) Σ = {,, a, b,..., z} for composite terms Σ = {0, 1} for binary integers Σ = {0, 1,..., 9} for decimal integers The above cases all have a natural ordering; it is not required in general, thus the set of all Chinese characters forms a (formal) alphabet.

26 word - any finite string of symbols from Σ ω = aba, ω = 01101... 1,... also: empty word λ length(ω) # of symbols in ω length(aaa) = 3, length(λ) = 0 The only operation on words (discussed here) is concatenation, written as juxtaposition νω, ωνω, abω, ωbν,... NB λω = ω = ωλ length(νω) = length(ν) + length(ω)

27 Notation: Σ k set of all words of length k We often identify Σ 0 = {λ}, Σ 1 = Σ. Σ set of all words (of all lengths) Σ + set of all nonempty words (of any positive length) Σ = Σ 0 Σ 1 Σ 2... ; Σ n = Σ + = Σ 1 Σ 2... = Σ \ {λ} n i=0 Σ i A language is a subset of Σ. Typically, only the subsets that can be formed (or described) according to certain rules are of interest. Such a collection of descriptive/formative rules is termed a grammar.

28 Examples 1.3.10 Number of elements in the sets (cont d) (e) Σ where Σ = {a, b, c} Σ = (f) { ω Σ : length(ω) 4 } where Σ = {a, b, c} Σ 4 = 3 0 + 3 1 +... + 3 4 = 35 1 3 1 = 243 1 2 = 121

29 Examples 1.3.10 Number of elements in the sets (cont d) (e) Σ where Σ = {a, b, c} Σ = (f) { ω Σ : length(ω) 4 } where Σ = {a, b, c} Σ 4 = 3 0 + 3 1 +... + 3 4 = 35 1 3 1 = 243 1 2 = 121

30 Functions and their Properties We deal with functions as a set-theoretic concept, it being a special kind of correspondence (between two sets). f : S T describes pairing of the sets: it means that f assigns to every element s S a unique element t T. To emphasise where a specific element is sent, we can write f : x y, which is equivalent to f (x) = y. S domain of f, symbol: Dom(f ) T codomain of f, symbol: Codom(f ) { f (x) : x Dom(f ) } image of f, symbol: Im(f ) Im(f ) Codom(f ) We observe that every function maps its domain onto its image, but only into its codomain.

31 Function is called 1 1 (one-to-one) or injective if different x implies different f (x), i.e. f (x) = f (y) x = y Examples (of functions that are not 1 1) absolute value floor, ceiling length of a word most functions of two or more arguments, when viewed as a function of a single pair of arguments

32 Composition of Functions Auxilliary notation f : x y, f : A B The former means that x is mapped to y; the latter means that B is the image of A under f. NB Observe the difference between and Composition of functions is described as g f : x g(f (x)), requiring Im(f ) Dom(g)

33 If a function maps a set into itself, i.e. when Dom(f ) = Codom(f ) (and thus Im(f ) Dom(f )), the function can be composed with itself iterated f f, f f f,..., written also f 2, f 3,... Composition is associative h (g f ) = (h g) f, can write h g f Identity function on S i S (x) = x, x S; Dom(i) = Codom(i) = Im(i) = S For g : S T g i S = g, i T g = g

34 Examples 1.5.3 Regarding length : {a, b} N (c) length(λ) = 0 (d) Im(length) = N 1.5.4 Σ as above and g(n) = def { ω Σ : length(ω) n }, n N. Here g(n) is a function that has a complex object as its value for any given argument it maps N into P(Σ ). (a c) g(0)? = {λ} g(1)? = {λ, a, b}, g(2)? = {λ, a, b, aa, ab, ba, bb} In general g(n) = n i=0 Σi = Σ n.

35 Examples (cont d) (d) Are all g(n) finite? Yes. (e) Give an example of a set in P(Σ ) that is not in Im(g) any infinite subset of Σ (infinite language) any finite language that excludes some intermediate length words, e.g. {λ, a}, {a, b}, {λ, a, aa},... Find g(n) It is 2 0 + 2 1 +... + 2 n = 2 n+1 1 1.5.6 Regarding gcd : P P P (c) Im(gcd) = P as gcd(n, n) = n x 3 x 1 1.5.7 f (x) = x 0 x < 1 x 3 x < 0 (c) Im(f )? = R 0

36 Examples (cont d) (d) Are all g(n) finite? Yes. (e) Give an example of a set in P(Σ ) that is not in Im(g) any infinite subset of Σ (infinite language) any finite language that excludes some intermediate length words, e.g. {λ, a}, {a, b}, {λ, a, aa},... Find g(n) It is 2 0 + 2 1 +... + 2 n = 2 n+1 1 1.5.6 Regarding gcd : P P P (c) Im(gcd) = P as gcd(n, n) = n x 3 x 1 1.5.7 f (x) = x 0 x < 1 x 3 x < 0 (c) Im(f )? = R 0

37 Examples (cont d) (d) Are all g(n) finite? Yes. (e) Give an example of a set in P(Σ ) that is not in Im(g) any infinite subset of Σ (infinite language) any finite language that excludes some intermediate length words, e.g. {λ, a}, {a, b}, {λ, a, aa},... Find g(n) It is 2 0 + 2 1 +... + 2 n = 2 n+1 1 1.5.6 Regarding gcd : P P P (c) Im(gcd) = P as gcd(n, n) = n x 3 x 1 1.5.7 f (x) = x 0 x < 1 x 3 x < 0 (c) Im(f )? = R 0

38 Examples (cont d) (d) Are all g(n) finite? Yes. (e) Give an example of a set in P(Σ ) that is not in Im(g) any infinite subset of Σ (infinite language) any finite language that excludes some intermediate length words, e.g. {λ, a}, {a, b}, {λ, a, aa},... Find g(n) It is 2 0 + 2 1 +... + 2 n = 2 n+1 1 1.5.6 Regarding gcd : P P P (c) Im(gcd) = P as gcd(n, n) = n x 3 x 1 1.5.7 f (x) = x 0 x < 1 x 3 x < 0 (c) Im(f )? = R 0

39 gcd Example Reconsider gcd as a higher-order function, defined by m if m = n gcd(f )(m, n) = f (m n, n) if m > n f (m, n m) if m < n Its type is now gcd : (P 2 P) (P 2 P) that is, it maps each partial function (from pairs of positive integers to a positive integer) to a (partial) function of the same type. The worst such function is the nowhere defined function f (m, n) =.

40 Consider the sequence gcd Example cont d f, gcd(f ), gcd(gcd(f )),..., gcd i (f ),... and observe that the i th element of this sequence is an approximation of the gcd function that works as long as the depth of the recursion is less than i 1. Since we proved that the original gcd function terminates, we can deduce that the limit of this sequence exists, and is the original gcd. It also is the least fixpoint of gcd i.e. the simplest solution f to the equation f = gcd(f ). This, in a nutshell, explains how the semantics of recursive procedures is defined in CS. How all this works is somewhat beyond the scope of COMP9020 but still serves the purpose of motivating why we discuss functions, their composition, iteration, and fixpoints.

41 Properties of Functions We ve met: one-to-one (1 1), onto Inverse function f 1 : T S; for a given f : S T exists exactly when f is both 1 1 and onto. Image of a subdomain A under a function f (A) = { f (s) : s A } = { t T : t = f (s) for some s A } Inverse image - f (B) = { s S : f (s) B } S; it is defined for every f If f 1 exists then f (B) = f 1 (B) f ( ) =, f ( ) =

42 Examples 1.7.5 f and g are shift functions N N defined by f (n) = n + 1, and g(n) = max(0, n 1) (c) f is 1 1, not onto: f (N) = N \ {0} = P (d) g is onto, not 1 1: g(0) = g(1) (e) f and g do not commute: g f : n (n + 1) 1 = n, thus g f = i N f g : 0 1, hence f g i N NB f g is the identity when restricted to P

43 NB For a finite set S and f : S S the properties 1 onto, and 2 1 1 are equivalent. (Proof suggestion?) Examples 1.7.6(c) Is length : Σ N onto? Yes: length ({n}) = Σ n (d) length (2)? = {aa, ab, ac, bb,..., cc}

44 NB For a finite set S and f : S S the properties 1 onto, and 2 1 1 are equivalent. (Proof suggestion?) Examples 1.7.6(c) Is length : Σ N onto? Yes: length ({n}) = Σ n (d) length (2)? = {aa, ab, ac, bb,..., cc}

45 Examples 1.7.12 Verify that f : R R R R defined by f (x, y) = (x + y, x y) is invertible. The inverse is f 1 (a, b) = ( a+b 2, a b 2 ); substituting shows that f f 1 = i R R

46 Sec. 1.8 Supplementary exercises 1.8.2(b) When (A \ B) \ C = A \ (B \ C)? From Venn diagram (A \ B) \ C = A B C; A \ (B \ C) = (A B) (A C). Equality would require that A C A B C; however, these two sets are disjoint, thus equal only when both are empty. One verifies that A C = is also a satisfactory condition and that, in this case, both set expressions simplify to A \ B. 1.8.9 How many third powers are 1, 000, 000 and end in 9? (solve without calculator). n 3 = 9 (mod 10) only when n = 9 (mod 10), and n 3 1, 000, 000 when n 10. Hence all such n are 9, 19,..., 99. Try the same question for n 4.

47 Examples 1.8.16 Σ = {a, b}; relate it to Σ (a) Is there an onto Σ Σ? No: Σ = 2, Σ =. (b) Is there an onto Σ Σ? Yes, eg f (ω) = a when length(ω) - odd, f (ω) = b when length(ω) - even. The following is not completely correct f : ω first letter of ω Reason: f (λ) is not defined.