Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Similar documents
Infinity and Uncountability. Countable Countably infinite. Enumeration

Cardinality of Sets. Washington University Math Circle 10/30/2016

Comparing sizes of sets

Section 1.7 Sequences, Summations Cardinality of Infinite Sets

Section 2.4 Sequences and Summations

Calculating Cardinalities

1. Draw the state graphs for the finite automata which accept sets of strings composed of zeros and ones which:

Chapter 1: Number and Operations

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

Bulgarian Math Olympiads with a Challenge Twist

To illustrate what is intended the following are three write ups by students. Diagonalization

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Slides for Faculty Oxford University Press All rights reserved.

SET DEFINITION 1 elements members

Recursively Enumerable Languages, Turing Machines, and Decidability

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

HW 1 CMSC 452. Morally DUE Feb 7 NOTE- THIS HW IS THREE PAGES LONG!!! SOLUTIONS THROUGOUT THIS HW YOU CAN ASSUME:

CHAPTER 7. Copyright Cengage Learning. All rights reserved.

A B. bijection. injection. Section 2.4: Countability. a b c d e g

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

Recursively Defined Functions

Cantor s Diagonal Argument for Different Levels of Infinity

Recursive Definitions Structural Induction Recursive Algorithms

MITOCW watch?v=4dj1oguwtem

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Some basic set theory (and how it relates to Haskell)

CSE 120. Computer Science Principles

Let A(x) be x is an element of A, and B(x) be x is an element of B.

.Math 0450 Honors intro to analysis Spring, 2009 Notes #4 corrected (as of Monday evening, 1/12) some changes on page 6, as in .

CSE 20 DISCRETE MATH WINTER

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

1.3 Functions and Equivalence Relations 1.4 Languages

3. Determine whether f is a function from the set of all bit strings to the set of integers if

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Functions 2/1/2017. Exercises. Exercises. Exercises. and the following mathematical appetizer is about. Functions. Functions

Source of Slides: Introduction to Automata Theory, Languages, and Computation By John E. Hopcroft, Rajeev Motwani and Jeffrey D.

A.1 Numbers, Sets and Arithmetic

2.1 Sets 2.2 Set Operations

Example: Which of the following expressions must be an even integer if x is an integer? a. x + 5

2 Review of Set Theory

Therefore, after becoming familiar with the Matrix Method, you will be able to solve a system of two linear equations in four different ways.

Material from Recitation 1

Basic Properties The Definition of Catalan Numbers

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Alphabets, strings and formal. An introduction to information representation

Discrete Structures. Fall Homework3

Discrete mathematics , Fall Instructor: prof. János Pach

Dr. Relja Vulanovic Professor of Mathematics Kent State University at Stark c 2008

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

CHAPTER 4. COMPUTABILITY AND DECIDABILITY

CS100: DISCRETE STRUCTURES

A Study of the Perfect Cuboid Problem

Functions and Sequences Rosen, Secs. 2.3, 2.4

Functions. How is this definition written in symbolic logic notation?

CS402 - Theory of Automata Glossary By

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Discrete Mathematics Lecture 4. Harper Langston New York University

Outline. Language Hierarchy

Math 221 Final Exam Review

Finite Math - J-term Homework. Section Inverse of a Square Matrix

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Introduction. Sets and the Real Number System

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014

Solutions to First Exam, Math 170, Section 002 Spring 2012

CONNECTED SPACES AND HOW TO USE THEM

8 th Grade Pre Algebra Pacing Guide 1 st Nine Weeks

CpSc 421 Final Solutions

2015 Mu Alpha Theta National Convention Alpha Algorithms. 1. What is the smallest prime that divides 703? a) 13 b) 17 c) 29 d) 37 e) NOTA

CS 125 Section #4 RAMs and TMs 9/27/16

Computing data with spreadsheets Example: Computing triangular numbers and their square roots. Recall, we showed 1 ` 2 ` ` n npn ` 1q{2.

Problem Set 4: Streams and Lazy Evaluation

CS 341 Homework 1 Basic Techniques

Turing Machines. A transducer is a finite state machine (FST) whose output is a string and not just accept or reject.

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

Chapter 18 out of 37 from Discrete Mathematics for Neophytes: Number Theory, Probability, Algorithms, and Other Stuff by J. M. Cargal.

2 Sets. 2.1 Notation. last edited January 26, 2016

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

Definition MATH Benjamin V.C. Collins, James A. Swenson MATH 2730

Chapter 1. Math review. 1.1 Some sets

Module 7 Highlights. Mastered Reviewed. Sections ,

2.4 Multiplication and Division of Integers

A Proof of Pythagorian s Theorem

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

Figure 1.1: This is an illustration of a generic set and its elements.

MATH 215B MIDTERM SOLUTIONS

Using Arithmetic of Real Numbers to Explore Limits and Continuity

Reducibilities relations with applications to symbolic dynamics

Solve the matrix equation AX B for X by using A.(1-3) Use the Inverse Matrix Calculator Link to check your work

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

UNIT 1: INTEGERS Definition Absolute Value of an integer How to compare integers

Catalan Numbers. Table 1: Balanced Parentheses

Transcription:

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or elements of the set. a) Use capital letters to stand for sets (A, B, C, S, T, X, Y are common choices). b) Special sets (with reserved letters): P: the positive integers 1,2,3, N: the natural numbers 0,1,2,3, E: the even integers 2, 4, 6, O: the odd integers 1, 3, 5, Z: the integers 0, 1, -1, 2, -2, Q: the rational numbers R: the real numbers φ: the empty set (has no members) c) More examples of sets (everything inside the curly parentheses): S = {1, 2, 3} S = {1, 2, 3,, n} S = {1} [a singleton set: just one element] S = {P, {1}, φ} [a set of sets] d) Power set: P* = the set of all subsets of P [again, a set of sets] e) Two basic relations: (subset), (member). A B means A is a subset of B: every element of A is an element of B. a A means a is an element of A. [Typically use lower-case for elements of a set.] f) Size of sets. Finite sets. All the examples in part c) are finite sets. The size of a finite set is the number of elements it contains. F is bigger than E if F has more elements than E. Infinite sets. All the examples in part b), apart from the empty set, are infinite sets. Any infinite set is bigger than any finite set. But how do we compare two infinite sets? - Sometimes one is bigger (Ex: R is bigger than P) - Sometimes both have the same size (Ex: P and E) To make these relationships precise, we need the idea of a function.

II. Functions a) Total functions Informal: A function f:x Y is a rule that assigns one member of Y to each member of X. Examples: 1) f(n) = 2n is a function from P P (or from P E) 2) f(1) = 2, f(2) = 1, f(3) = 1 is a function f:{1, 2, 3} {1, 2} As example 2) illustrates, it is often possible to define a function using a table of values. (You don t always need to give a formula for f(n) in terms of n.) X is called the domain of f; the members of X are arguments of f. The members of Y are the values of f. The set of all values that f actually assigns to one or more arguments is the range of f. (In example 1, the range of f is E; in example 2, the range of f is {1, 2}.) A function f:x Y is 1-1 (one-to-one) if whenever x 1 x 2, f(x 1 ) f(x 2 ). A function f:x Y is onto Y if for each y Y, there is at least one x X such that y = f(x). b) Partial functions A partial function f:x Y is a rule that assigns one member of Y to some (but not all) members of X (the members to which f assigns a value constitute its domain). The function is left undefined for some members of X. Example: f(n) = {2n, n even {undefined, n odd is a partial function P P (or P E). Application to sizes of sets: Two sets X and Y have the same size if there is a function f:x Y that is total, 1-1 and onto. Example: E and P have the same size. For f(n) = 2n is 1-1 and onto. 2

III. Enumerable sets Sets like P and E are the smallest kind of infinite sets. They are called enumerably infinite sets. (Synonymous terms: countably infinite, denumerable.) Examples: P, E, O Informal definition: a set S is enumerable if its members can be put in a list, so that each member of the set appears some finite number of steps from the start of the list. Formal definition: S is enumerable if there is a function f: P S whose range is all of S. Notes: 1) Enumerable includes both finite and enumerably infinite sets. 2) Any two enumerably infinite sets have the same size. 3) The function f need not be 1-1, but it must be onto S. 4) The function f may be partial. This gives us two techniques for showing enumerability: Informal: show you can put them in a list. Need only make it clear that every member of the set will eventually appear as the n th member of the list, for some finite n. [Note: 1, 3, 5, 7,, 2, 4, 6, 8,. does not count as a list.] Formal: state a function f:p S whose range is all of S. Examples: a) O (odd numbers) is enumerable. Use f(n) = 2n-1. b) {1, 2, 3} is enumerable. (But not enumerably infinite.) c) Any subset S of P is enumerable. Use f(n) = n, n S; undefined otherwise. d) φ is enumerable. We can use the partial function e, whose domain is empty: undefined everywhere! Then the range of e is φ. e) The set of all people on earth is enumerable. Why? It s finite. And any finite non-empty set, by definition, can be written as S = {s 1,, s n } for some positive number n. But this is just to say that there is a function from P to S, namely, f(k) = s k if k n, and undefined otherwise. f) Z (the integers) is enumerable. Here is one way to list its members: 0, 1, -1, 2, -2,. [What function f enumerates this list? Use a table of values to see the pattern.] g) Ordered pairs of positive integers: P 2 = {(1, 1), (1, 2),, (2,1), (2,2), }. This is enumerable. 3

Proof: First, list them in a two-dimensional array. 1 2 3 4 5 6 1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) 2 (2,1) (2,2) (2,3) 3 4 5 6 (6,6) Now we can arrange them in a list in several ways. Method 1: Slant down each constant-sum diagonal (moving NE to SW). Method 2: Expanding square-fronts: traverse each backwards L (with corner (n, n)). Method 3: Place each series in alternating slots that remain vacant (see text). Write down the function G(m, n) that encodes (m, n) on methods 1 and 3. [An encoding function G:S P is a 1-1 function that assigns a positive integer to each member of S. A decoding function g:p S is any function that enumerates S. If there is an encoding function G, then there will also be a decoding function, namely the inverse of G. Sometimes the best way to show a set is enumerable is to give an encoding function, rather than a decoding function.] h) The set Q + of all positive rational numbers is enumerable. Proof: List them in an array. 1 2 3 4 1 1/1 ½ 1/3 ¼ 2 2/1 2/2 2/3 3 Again, arrange them in a list in any of the three ways used in example g). i) The set of ordered k-tuples of positive integers, for any k, is enumerable. j) The set of all finite strings of letters of the alphabet is enumerable. List: a, b, c,, z; aa, ab,, zz; aaa, aab,, zzz; k) The set of all finite subsets of P is enumerable. [Be clear on the difference: ordered k-tuples; subsets with k members; sequence of length k.] l) The set of all finite sequences <a 1,,a n > in P. 4

Method 1. Step 1: For each n, the set of all sequences of length n is enumerable. Step 2: Form an infinite array, where row n contains all sequences of length n. Step 3: convert the array to a list. Method 2. Use prime decomposition. Basic facts: Prime numbers: 2, 3, 5, 7, 11, [evenly divisible only by itself and 1] There are infinitely many prime numbers. Prime factorization: 84 = 2 2 3 7; 220 = 2 2 5 11 [every number can be written as the product of prime numbers] Uniqueness: this prime factorization is unique. The encoding function G transforms each finite sequence into a single positive integer as follows: G <1, 22, 3, 5> 2 1 3 22 5 3 7 5 <7, 63> 2 7 3 63 <4, 5, 9, 110, 37> 2 4 3 5 5 9 7 110 11 37 In general: G(<a 1,,a n >) = p 1 a1 p n an, where p n is the nth prime number. (p 1 = 2, p 2 = 3, etc.) Note: The decoding function is easy to apply. Just factor the number and use the exponents. Example: 24 = 2 3 3 1 stands for the sequence <3, 1>. Notice, though, that not every number encodes a sequence. For example, 20 = 2 2 5 does not encode any sequence. Theorem 1.1 (subsets of an enumerable set are enumerable): If B is enumerable and A B, then A is enumerable. Proof: Informal we can put the members of B in a list. Now just delete all members of the list that aren t in A, and we have a listing of A. Formal: We are given the existence of f : P B with the range of f being all of B. Define g(n) = f(n) if f(n) A, and undefined otherwise. Theorem 1.2 (an enumerable union of enumerable sets yields an enumerable set): If A 1, A 2, A 3, are all enumerable, then so is the set A consisting of the union of all of them. We write this as: A = U A i i= 1 Proof: Same two-by-two array technique as for Q can be used to list all the members of A. 5

Summary: Three ways to show that a set S is enumerable a) Formal Method: show directly that there is a function f : P S whose range is all of S. Example: the even numbers E. f(n) = 2n is a function from P to E whose range is all of E. OR g(n) = n if n is even and undefined if n is odd Variation: Show that there is an encoding function G:S P that is 1-1. b) Informal Method: show that it is possible to place all the members of S in a list in such a way that each member of S will eventually appear, a finite number of positions from the beginning of the list. Example: the positive rational numbers. This uses the important technique of placing the entire set in a two-dimensional array, and then putting the members into list form by either moving along successive diagonals or expanding squares. c) By appealing to Theorem 1.2: If A 1, A 2, is an enumerable list of enumerable sets, then the set A consisting of the union of all the A i (written as A = U A i i= 1 ) is enumerable. Example: the set S of all finite strings of symbols from an enumerable alphabet is enumerable. For if S i is the set of finite strings of length i, then S i is enumerable, and so by the Theorem, since S = U S i i= 1, S is enumerable. 6