Discrete Mathematics

Similar documents
INTRODUCTORY SET THEORY

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Elements of probability theory

Basic Concepts of Set Theory, Functions and Relations

Lecture Note 1 Set and Probability Theory. MIT Spring 2006 Herman Bennett

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

A Little Set Theory (Never Hurt Anybody)

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability

Automata and Formal Languages

Lecture 16 : Relations and Functions DRAFT

How To Solve A Minimum Set Covering Problem (Mcp)

Advanced Microeconomics

Mathematics Review for MS Finance Students

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

c 2008 Je rey A. Miron We have described the constraints that a consumer faces, i.e., discussed the budget constraint.

36 CHAPTER 1. LIMITS AND CONTINUITY. Figure 1.17: At which points is f not continuous?

Basic Probability Concepts

Cartesian Products and Relations

Discrete Maths. Philippa Gardner. These lecture notes are based on previous notes by Iain Phillips.

Basic Concepts of Point Set Topology Notes for OU course Math 4853 Spring 2011

Basic Set Theory. 1. Motivation. Fido Sue. Fred Aristotle Bob. LX Semantics I September 11, 2008

Logic in Computer Science: Logic Gates

Set operations and Venn Diagrams. COPYRIGHT 2006 by LAVON B. PAGE

LECTURE NOTES IN MEASURE THEORY. Christer Borell Matematik Chalmers och Göteborgs universitet Göteborg (Version: January 12)

THE LANGUAGE OF SETS AND SET NOTATION

CS 3719 (Theory of Computation and Algorithms) Lecture 4

160 CHAPTER 4. VECTOR SPACES

How To Understand The Difference Between Economic Theory And Set Theory

1 if 1 x 0 1 if 0 x 1

Math 223 Abstract Algebra Lecture Notes

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

1. Prove that the empty set is a subset of every set.

Regular Languages and Finite Automata

Lecture 17 : Equivalence and Order Relations DRAFT

Biinterpretability up to double jump in the degrees

Collinear Points in Permutations

Regular Languages and Finite State Machines

Georg Cantor ( ):

6.3 Conditional Probability and Independence

Lecture notes on the Turing degrees, AII Graduate Summer School in Logic Singapore, 28 June - 23 July 2010

Lecture 1: Systems of Linear Equations

All of mathematics can be described with sets. This becomes more and

Chapter 4 Lecture Notes

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Probability: Terminology and Examples Class 2, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Problem Set 2 Due Date: March 7, 2013

Database Fundamentals: 1

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Elements of Abstract Group Theory

The Set Data Model CHAPTER What This Chapter Is About

MA651 Topology. Lecture 6. Separation Axioms.

Lecture 1 Introduction Properties of Probability Methods of Enumeration Asrat Temesgen Stockholm University

Solutions to In-Class Problems Week 4, Mon.

How To Understand And Solve A Linear Programming Problem

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

3. Mathematical Induction

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Summary of Formulas and Concepts. Descriptive Statistics (Ch. 1-4)

Relational Databases

BOOLEAN ALGEBRA & LOGIC GATES

Introduction to Probability

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

Invertible elements in associates and semigroups. 1

E3: PROBABILITY AND STATISTICS lecture notes

Computability Theory

Math 4310 Handout - Quotient Vector Spaces

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

THE BANACH CONTRACTION PRINCIPLE. Contents

So let us begin our quest to find the holy grail of real analysis.

Lecture 13 - Basic Number Theory.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

TOPIC 4: DERIVATIVES

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

Factorizations: Searching for Factor Strings

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Vocabulary Words and Definitions for Algebra

Geometric Transformations

Relational Algebra and SQL

Basic Proof Techniques

Mathematical Induction

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

INTRODUCTION TO TOPOLOGY

CONTENTS 1. Peter Kahn. Spring 2007

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

1 VECTOR SPACES AND SUBSPACES

Linear Algebra. A vector space (over R) is an ordered quadruple. such that V is a set; 0 V ; and the following eight axioms hold:

1 Sets and Set Notation.

Semantics of UML class diagrams

A Beginner s Guide to Modern Set Theory

Reading 13 : Finite State Automata and Regular Expressions

Lecture 1: Course overview, circuits, and formulas

1 Local Brouwer degree

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Math 3000 Section 003 Intro to Abstract Math Homework 2

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Metric Spaces. Chapter 1

1 = (a 0 + b 0 α) (a m 1 + b m 1 α) 2. for certain elements a 0,..., a m 1, b 0,..., b m 1 of F. Multiplying out, we obtain

You know from calculus that functions play a fundamental role in mathematics.

GROUPS ACTING ON A SET

Transcription:

Discrete Mathematics Chih-Wei Yi Dept. of Computer Science National Chiao Tung University March 16, 2009

2.1 Sets 2.1 Sets

2.1 Sets Basic Notations for Sets For sets, we ll use variables S, T, U,. We can denote a set S in writing by listing all of its elements in curly braces: fa, b, cg is the set of whatever 3 objects are denoted by a, b, c. Set builder notation: For any proposition P(x) over any universe of discourse, fx j P(x)g is the set of all x such that P(x). Q = fp/q j p, q 2 Z, andq 6= 0g.

2.1 Sets Basic Properties of Sets Sets are inherently unordered: No matter what objects a, b, and c denote, fa, b, cg = fa, c, bg = fb, a, cg = fb, c, ag = fc, a, bg = fc, b, ag. All elements are distinct (unequal); multiple listings make no di erence! fa, a, bg = fa, b, bg = fa, bg = fa, a, a, a, b, b, bg. This set contains at most 2 elements!

2.1 Sets De nition of Set Equality Two sets are declared to be equal if and only if they contain exactly the same elements. In particular, it does not matter how the set is de ned or denoted. Example f1, 2, 3, 4g = fx j x is an integer where x > 0 and x < 5g = fx j x is a positive integer whose square is > 0 and < 25g.

2.1 Sets In nite Sets Conceptually, sets may be in nite (i.e., not nite, without end, unending). Symbols for some special in nite sets: N = f0, 1, 2,...g The Natural numbers. In nite sets come in di erent sizes!

2.1 Sets In nite Sets Conceptually, sets may be in nite (i.e., not nite, without end, unending). Symbols for some special in nite sets: N = f0, 1, 2,...g The Natural numbers. Z = f..., 2, 1, 0, 1, 2,...g The Zntegers. In nite sets come in di erent sizes!

2.1 Sets In nite Sets Conceptually, sets may be in nite (i.e., not nite, without end, unending). Symbols for some special in nite sets: N = f0, 1, 2,...g The Natural numbers. Z = f..., 2, 1, 0, 1, 2,...g The Zntegers. R =The Real numbers, such as 374.1828471929498181917281943125.... In nite sets come in di erent sizes!

2.1 Sets Venn Diagrams

2.1 Sets Basic Set Relations: Member of De nition x 2 S ( x is in S ) is the proposition that object x is an 2lement or member of set S. E.g., 3 2 N. a 2 fx j x is a letter of the alphabetg. Can de ne set equality in terms of 2 relation: 8S, T : S = T $ (8x : x 2 S $ x 2 T ). Two sets are equal i they have all the same members. x /2 S : :(x 2 S) x is not in S!!!

2.1 Sets The Empty Set De nition? ( null, the empty set ) is the unique set that contains no elements whatsoever.? = fg = fx j Falseg No matter the domain of discourse, we have the axiom :9x : x 2?.

2.1 Sets Subset and Superset Relations De nition S T ( S is a subset of T ) means that every element of S is also an element of T. S T () 8x (x 2 S! x 2 T ).? S, S S. S T ( S is a superset of T ) means T S. Proof skills S = T, S T ^ S T. S " T means :(S T ), i.e 9x (x 2 S ^ x /2 T ).

2.1 Sets Proper (Strict) Subsets & Supersets De nition S T ( S is a proper subset of T ) means that S T but T * S. Similar for S T.

2.1 Sets Sets Are Objects, Too! The objects that are elements of a set may themselves be sets. E.g, let S = fx j x f1, 2, 3gg then S = fφ, f1g, f2g, f3g, f1, 2g, f1, 3g, f2, 3g, f1, 2, 3gg. We denote S by 2 f1,2,3g. Note that 1 6= f1g 6= ff1gg

2.1 Sets Cardinality and Finiteness De nition jsj (read the cardinality of S ) is a measure of how many di erent elements S has. E.g., j?j = 0 jf1, 2, 3gj = 3 jfa, bgj = 2 jff1, 2, 3g, f4, 5ggj = 2 If jsj 2 N, then we say S is nite. Otherwise, we say S is in nite. What are some in nite sets we ve seen? N, Z, R,...

2.1 Sets The Power Set Operation De nition The power set P(S) of a set S is the set of all subsets of S. P(S) = fx j x Sg. E.g., P(fa, bg) = fφ, fag, fbg, fa, bgg. Sometimes P(S) is written 2 S. Note that for nite S, jp(s)j = 2 js j. It turns out that jp(n)j > jnj. There are di erent sizes of in nite sets!

2.1 Sets Review: Set Notations So Far Variable objects x, y, z; sets S, T, U. Literal setfa, b, cg and set-builderfx j P(x)g. relational operator, and the empty set?. Set relations =,,,,, etc. Venn diagrams. Cardinality jsj and in nite sets N, Z, R. Power sets P(S).

2.1 Sets Naive Set Theory is Inconsistent There are some naive set descriptions that lead pathologically to structures that are not well-de ned. (That do not have consistent properties.) These sets mathematically cannot exist. Let S = fx j x /2 xg. Is S 2 S? Therefore, consistent set theories must restrict the language that can be used to describe sets. For purposes of this class, don t worry about it!

2.1 Sets Ordered n-tuples These are like sets, except that duplicates matter, and the order makes a di erence. For n 2 N, an ordered n-tuple or a sequence of length n is written (a 1, a 2,, a n ). The rst element is a 1, etc. Note (1, 2) 6= (2, 1) 6= (2, 1, 1). Empty sequence, singlets, pairs, triples, quadruples, quintuples,..., n-tuples.

2.1 Sets Cartesian Products of Sets De nition For sets A, B, their Cartesian product A B = f(a, b) j a 2 A ^ b 2 Bg. E.g., fa, bg f1, 2g = f(a, 1), (a, 2), (b, 1), (b, 2)g. For nite sets A, B, ja Bj = jaj jbj. The Cartesian product is not commutative, i.e. :8AB : A B = B A. Extends to A 1 A 2 A n.

2.1 Sets Review of 2.1 Sets S, T, U,. Special sets N, Z, R. Set notations fa, b,...g, fx j P(x)g,. Set relation operators x 2 S, S T, S T, S = T, S T, S T. (These form propositions.) Finite vs. in nite sets. Set operations jsj, P(S), S T. Next up: 2.2: More set ops: [, \,,.

The Union Operator De nition For sets A, B, their [nion A [ B is the set containing all elements that are either in A, or ( _ ) in B (or, of course, in both). Formally,8A, B : A [ B = fx j x 2 A _ x 2 Bg. Note that A [ B contains all the elements of A and it contains all the elements of B: 8A, B : (A [ B A) ^ (A [ B B).

Example fa, b, cg [ f2, 3g = fa, b, c, 2, 3g. Example f2, 3, 5g [ f3, 5, 7g = f2, 3, 5, 3, 5, 7g = f2, 3, 5, 7g

The Intersection Operator De nition For sets A, B, their intersection A \ B is the set containing all elements that are simultaneously in A and ( ^ ) in B. Formally,8A, B : A \ B = fx j x 2 A ^ x 2 Bg. Note that A \ B is a subset of A and it is a subset of B: 8A, B : (A \ B A) ^ (A \ B B).

Intersection Examples Examples fa, b, cg \ f2, 3g =?. Examples f2, 4, 6g \ f3, 4, 5g = f4g.

Disjointedness De nition Two sets A, B are called disjoint (i.e., unjoined) i their intersection is empty. (i.e., A \ B =?.) Example the set of even integers is disjoint with the set of odd integers

Inclusion-Exclusion Principle How many elements are in A [ B? ja [ Bj = jaj + jbj ja \ Bj. Example How many students are on our class email list? Consider set E = I [ M, where I = fs j s turned in an information sheetg and M = fs j s sent the TAs their email addressg. Some students did both! So, je j = ji [ Mj = ji j + jmj ji \ Mj.

Set Di erence De nition For sets A, B, the di erence of A and B, written A of all elements that are in A but not B. B, is the set A B : fx j x 2 A ^ x /2 Bg = fx j :(x 2 A! x 2 B)g. Also called: The complement of B with respect to A. E.g., f1, 2, 3, 4, 5, 6g f2, 3, 5, 7, 9, 11g = f1, 4, 6g, and Z N = f..., 1, 0, 1, 2,...g f0, 1,...g = fx j x is an integer but not a nat. #g = fx j x is a negative integerg = f..., 3, 2, 1g.

Set Di erence - Venn Diagram A B is what s left after B takes a bite out of A.

Set Complements De nition The universe of discourse can itself be considered a set, call it U. When the context clearly de nes U, we say that for any set A U, the complement of A, written A, is the complement of A w.r.t. U, i.e., it is U A. Example If U = N,f3, 5g = f0, 1, 2, 4, 6, 7...g.

More on Set Complements An equivalent de nition, when U is clear:

Set Identities Theorem Identity A [? = A; A \ U = A. Domination A [ U = U; A \? =?. Idempotent A [ A = A; A \ A = A. Double complement A = A. Commutative A \ B = B \ A; A [ B = B [ A. Associative A [ (B [ C ) = (A [ B) [ C; A \ (B \ C ) = (A \ B) \ C.

DeMorgan s Law for Sets Theorem Exactly analogous to (and derivable from) DeMorgan s Law for propositions. A [ B = A \ B, A \ B = A [ B.

Proving Set Identities To prove statements about sets, of the form E 1 = E 2 (where E s are set expressions), here are three useful techniques: Prove E 1 E 2 and E 2 E 1 separately. Use set builder notation & logical equivalences. Use a membership table.

Method 1: Mutual Subsets Example Show A \ (B [ C ) = (A \ B) [ (A \ C ). Solution First, show A \ (B [ C ) (A \ B) [ (A \ C ). Assume x 2 A \ (B [ C ), & show x 2 (A \ B) [ (A \ C ). We know that x 2 A, and either x 2 B or x 2 C. Case 1: x 2 B. Then x 2 A \ B, so x 2 (A \ B) [ (A \ C ). Case 2: x 2 C. Then x 2 A \ C, so x 2 (A \ B) [ (A \ C ). Therefore, x 2 (A \ B) [ (A \ C ). Therefore, A \ (B [ C ) (A \ B) [ (A \ C ). Nest, show (A \ B) [ (A \ C ) A \ (B [ C )....

Method 3: Membership Tables Just like truth tables for propositional logic. Columns for di erent set expressions. Rows for all combinations of memberships in constituent sets. Use 1 to indicate membership in the derived set, 0 for non-membership. Prove equivalence with identical columns.

Membership Table Example Prove (A [ B) B = A B. Solution A B A [ B (A [ B) B A B 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 1 1 1 0 0

Membership Table Exercise Example Prove (A [ B) C = (A C ) [ (B C ). A B C A [ B (A [ B) C A C B C (A C ) [(B C ) 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1

Review of 2.1-2.1 Sets S, T, U,... Special sets N, Z, R. Set notations fa, b,...g, fx j P(x)g... Relations x 2 S, S T, S T, S = T, S T, S T. Operations jsj, P(S),, [, \,,... Set equality proof techniques: Mutual subsets. Derivation using logical equivalences.

Generalized Unions & Intersections Since union & intersection are commutative and associative, we can extend them from operating on ordered pairs of sets (A, B) to operating on sequences of sets (A 1,..., A n ), or even unordered sets of sets, X = fa j P(A)g.

Generalized Union Binary union operator: A [ B n-ary union: A 1 [ A 2 [ [ A n : (( ((A 1 [ A 2 ) [ ) [ A n ) (grouping & order is irrelevant) Big U notation: S n i=1 A i. Or for in nite sets of sets: S A2X A.

Generalized Intersection Binary intersection operator: A \ B. n-ary intersection: A 1 \ A 2 \ \ A n : ((... (A 1 \ A 2 ) \...) \ A n ) (grouping & order is irrelevant). Big Arch notation: T n i=1 A i. Or for in nite sets of sets: T A2X A.

Representing Sets with Bit Strings For an enumerable u.d. U with ordering fx 1, x 2,...g, represent a nite set S U as the nite bit string B = b 1 b 2... b n where 8i : x i 2 S! (i < n ^ b i = 1). E.g., U = N, S = f2, 3, 5, 7, 11g, B = 001101010001. In this representation, the set operators [, \, implemented directly by bitwise OR, AND, NOT! are