Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.

Slides:



Advertisements
Similar presentations
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Advertisements

Copyright © Cengage Learning. All rights reserved.
Prof. Johnnie Baker Module Basic Structures: Sets
Sets Lecture 11: Oct 24 AB C. This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Denoting the beginning
Discrete Mathematics Lecture 2 Logic of Quantified Statements,
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Discrete Mathematics Lecture 5
Sets 1.
Sets 1.
1 Set Theory. 2 Set Properties Commutative Laws: Associative Laws: Distributive Laws:
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
Mathematics.
Set Theory A B C.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Logics for Data and Knowledge Representation Introduction to Algebra Chiara Ghidini, Luciano Serafini, Fausto Giunchiglia and Vincenzo Maltese.
Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Sets Defined A set is an object defined as a collection of other distinct objects, known as elements of the set The elements of a set can be anything:
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
1 ENM 503 Block 1 Algebraic Systems Lesson 2 – The Algebra of Sets The Essence of Sets What are they?
Week 7 - Monday.  What did we talk about last time?  Sets.
CS201: Data Structures and Discrete Mathematics I
Discrete Mathematics R. Johnsonbaugh
CompSci 102 Discrete Math for Computer Science
Copyright © Cengage Learning. All rights reserved.
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Based on slides by Patrice Belleville and Steve Wolfman CPSC 121: Models of Computation Unit 11: Sets.
Basic Definitions of Set Theory Lecture 23 Section 5.1 Mon, Feb 21, 2005.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Section 2.1. Sets A set is an unordered collection of objects. the students in this class the chairs in this room The objects in a set are called the.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
CPCS 222 Discrete Structures I
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Set. Outline Universal Set Venn Diagram Operations on Sets.
Dr. Ameria Eldosoky Discrete mathematics
Discrete Mathematics Lecture 3 (and 4)
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set Theory.
CSNB 143 Discrete Mathematical Structures
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Week 7 - Monday CS322.
Chapter 5, Set Theory 1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Theory A B C.
Set Operations Section 2.2.
Sets, Sequences, and Summations
Discrete Mathematics CS 2610
Discrete Mathematics R. Johnsonbaugh
Presentation transcript:

Discrete Mathematics Lecture 5 Alexander Bukharovich New York University

Basics of Set Theory Set and element are undefined notions in the set theory and are taken for granted Set notation: {1, 2, 3}, {{1, 2}, {3}, {1, 2, 3}}, {1, 2, 3, …}, , {x  R | -3 < x < 6} Set A is called a subset of set B, written as A  B, when  x, x  A  x  B A is a proper subset of B, when A is a subset of B and  x  B and x  A Visual representation of the sets Distinction between  and 

Set Operations Set a equals set B, iff every element of set A is in set B and vice versa Proof technique for showing sets equality Union of two sets is a set of all elements that belong to at least one of the sets Intersection of two sets is a set of all elements that belong to both sets Difference of two sets is a set of elements in one set, but not the other Complement of a set is a difference between universal set and a given set

Cartesian Products Ordered n-tuple is a set of ordered n elements. Equality of n-tuples Cartesian product of n sets is a set of n- tuples, where each element in the n-tuple belongs to the respective set participating in the product

Formal Languages Alphabet  : set of characters used to construct strings String over alphabet  : either empty string of n- tuple of elements from , for any n Length of a string is value n Language is a subset of all strings over   n is a set of strings with length n over   * is a set of all strings of finite length over  Notation for arithmetic expressions: prefix, infix, postfix

Subset Check Algorithm Let two sets be represented as arrays A and B m = size of A, n = size of B i = 1, answer = “yes”; while (i  m && answer == “yes”) { j = 1, found = “no”; while (j  n && found == “no”) { if (a[i] == b[j]) found = “yes”; j++; } if (found == “no”) answer = “no”; i++; }

Set Properties Inclusion of Intersection: –A  B  A and A  B  B Inclusion in Union: –A  A  B and B  A  B Transitivity of Inclusion: –(A  B  B  C)  A  C Set Definitions: –x  X  Y  x  X  y  Y –x  X  Y  x  X  y  Y –x  X – Y  x  X  y  Y –x  X c  x  X –(x, y)  X  Y  x  X  y  Y

Set Identities Commutative Laws: A  B = A  B and A  B = B  A Associative Laws: (A  B)  C = A  (B  C) and (A  B)  C = A  (B  C) Distributive Laws: A  (B  C) = (A  B)  (A  C) and A  (B  C) = (A  B)  (A  C) Intersection and Union with universal set: A  U = A and A  U = U Double Complement Law: (A c ) c = A Idempotent Laws: A  A = A and A  A = A De Morgan’s Laws: (A  B) c = A c  B c and (A  B) c = A c  B c Absorption Laws: A  (A  B) = A and A  (A  B) = A Alternate Representation for Difference: A – B = A  B c Intersection and Union with a subset: if A  B, then A  B = A and A  B = B

Exercises Is is true that (A – B)  (B – C) = A – C? Show that (A  B) – C = (A – C)  (B – C) Is it true that A – (B – C) = (A – B) – C? Is it true that (A – B)  (A  B) = A?

Empty Set S = {x  R, x 2 = -1} X = {1, 3}, Y = {2, 4}, C = X  Y Empty set has no elements  Empty set is a subset of any set There is exactly one empty set Properties of empty set: –A   = A, A   =  –A  A c = , A  A c = U –U c = ,  c = U

Set Partitioning Two sets are called disjoint if they have no elements in common Theorem: A – B and B are disjoint A collection of sets A 1, A 2, …, A n is called mutually disjoint when any pair of sets from this collection is disjoint A collection of non-empty sets {A 1, A 2, …, A n } is called a partition of a set A when the union of these sets is A and this collection consists of mutually disjoint sets

Power Set Power set of A is the set of all subsets of A Theorem: if A  B, then P(A)  P(B) Theorem: If set X has n elements, then P(X) has 2 n elements

Boolean Algebra Boolean Algebra is a set of elements together with two operations denoted as + and * and satisfying the following properties: a + b = b + a, a * b = b * a (a + b) + c = a + (b + c), (a * b) *c = a * (b * c) a + (b * c) = (a + b) * (a + c), a * (b + c) = (a * b) + (a * c) a + 0 = a, a * 1 = a for some distinct unique 0 and 1 a + ã = 1, a * ã = 0

Exercises Simplify: A  ((B  A c )  B c ) Symmetric Difference: A  B = (A – B)  (B – A) Show that symmetric difference is associative Are A – B and B – C necessarily disjoint? Are A – B and C – B necessarily disjoint? Let S = {2, 3, …, n}. For each S i  S, let P i be the product of elements in S i. Show that:  P i = (n + 1)! / 2 – 1

Russell’s Paradox Set of all integers, set of all abstract ideas Consider S = {A, A is a set and A  A} Is S an element of S? Barber puzzle: a male barber shaves all those men who do not shave themselves. Does the barber shave himself? Consider S = {A  U, A  A}. Is S  S?

Halting Problem There is no computer algorithm that will accept any algorithm X and data set D as input and then will output “halts” or “loops forever” to indicate whether X terminates in a finite number of steps when X is run with data set D.