Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo

Slides:



Advertisements
Similar presentations
22 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
Advertisements

Discrete Mathematics I Lectures Chapter 6
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.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
The Engineering Design of Systems: Models and Methods
2.1 Sets. DEFINITION 1 A set is an unordered collection of objects. DEFINITION 2 The objects in a set are called the elements, or members, of the set.
Denoting the beginning
Analytical Methods in CS (CIS 505)
Discrete Mathematics Lecture 4 Harper Langston New York University.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
EE1J2 – Discrete Maths Lecture 7
Sets 1.
CSE115/ENGR160 Discrete Mathematics 02/10/11 Ming-Hsuan Yang UC Merced 1.
Sets 1.
CS 454 Theory of Computation Sonoma State University, Fall 2011 Instructor: B. (Ravi) Ravikumar Office: 116 I Darwin Hall Original slides by Vahid and.
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Chapter 7 Logic, Sets, and Counting Section 2 Sets.
Copyright © 2014 Curt Hill Sets Introduction to Set Theory.
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
CS201: Data Structures and Discrete Mathematics I
Chapter 2: Basic Structures: Sets, Functions, Sequences, and Sums (1)
Sets and Sentences Open Sentences Foundations of Real Analysis.
MATH 224 – Discrete Mathematics
CompSci 102 Discrete Math for Computer Science
Software testing techniques Spring 2009 Csci565: Theory and Practice of Software Testing1.
Section 2.1. Section Summary Definition of sets Describing Sets Roster Method Set-Builder Notation Some Important Sets in Mathematics Empty Set and Universal.
1 Introduction to Abstract Mathematics Sets Section 2.1 Basic Notions of Sets Section 2.2 Operations with sets Section 2.3 Indexed Sets Instructor: Hayk.
Chapter SETS DEFINITION OF SET METHODS FOR SPECIFYING SET SUBSETS VENN DIAGRAM SET IDENTITIES SET OPERATIONS.
Chapter 2 With Question/Answer Animations. Section 2.1.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
ITD1111 Discrete Mathematics & Statistics STDTLP
Discrete Mathematics Set.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Discrete Mathematics Lecture # 22 Recursion.  First of all instead of giving the definition of Recursion we give you an example, you already know the.
1 Topic Sets (5.1, 5.2, 5.3). 2 Original author of the slides: Vadim Bulitko University of Alberta Modified by.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
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
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.
CSE15 Discrete Mathematics 02/13/17
Dr. Ameria Eldosoky Discrete mathematics
Set Definition: A set is unordered collection of objects.
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Discrete Mathematical The Set Theory
Set, Combinatorics, Probability & Number Theory
COT 3100, Spring 2001 Applications of Discrete Structures
Sets Section 2.1.
MATH 224 – Discrete Mathematics
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
CS100: Discrete structures
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Discrete Mathematics CS 2610
Terms Set S Set membership x  S Cardinality | S |
Terminology and Symbols
Presentation transcript:

Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo Computing Department

Michaelmas Term 2004 Discrete Mathematics Course details weeks 1-10 –10 x 50 min lectures Material – coursework –written work (relevant to exam) recommended resource – rse.htmlhttp:// rse.html

Michaelmas Term 2004 Discrete Mathematics Syllabus Sets Relations Functions Recursion Logic –Boolean –propositional –predicate logic

Michaelmas Term 2004 Discrete Mathematics Overview Discrete Maths Sets –Defining sets –Set operations –Subsets –Universal and power set

Michaelmas Term 2004 Discrete Mathematics Objectives Understanding the relevance of discrete maths for computer science Understanding the basic ideas about sets Facility with basic ideas about sets

Michaelmas Term 2004 Discrete Mathematics Discrete maths What –discrete objects Why –formal specification –infinity or indefiniteness –reusability

Michaelmas Term 2004 Discrete Mathematics Sets and membership Set = collection of objects –in a set there are no duplicates –a set is Unordered –example set: A = {1, 2, 3, 4, 5, 6, 7} 1 in set A: –1 belongs to the set A –1 is an element/object/member of the set A Write this: –1  A –8  A

Michaelmas Term 2004 Discrete Mathematics Defining sets Listing all its members –writing down all the elements –small, finite sets –A = {a, b, {a, b}, c} Listing a property that its members must satisfy –{x | 0 < x < 8} –every integer that is greater than 0 and less than 8 –expression on the left does not have to be a variable: {x-2 | 2 < x < 10} –infinite sets {x | x > 0}

Michaelmas Term 2004 Discrete Mathematics Defining sets Procedure (program) to generate the members of a set. –a procedure to generate an infinite set is a never ending procedure –EXERCISES. Formally specify the following sets: all (+ve) even numbers all (+ve) odd numbers all (+ve) numbers exactly divisible by 3 all (+ve) numbers that do not divide exactly by 8

Michaelmas Term 2004 Discrete Mathematics Exercise Exercises – answers {2x | x > 0} {2x + 1 | x ≥ 0} {3x | x > 0} {8x + y | x ≥ 0, 1 ≤ y ≤ 7} Procedure: Set =  i = 1 while i >0 do put i*3 into Set i = i+1 endwhile Write similar procedure to generate the other sets

Michaelmas Term 2004 Discrete Mathematics Answers (all +ve even numbers) Set =  i = 1 while i ≥ 1 do put i * 2 into Set i := i + 1 endwhile (all +ve odd numbers) Set =  i = 0 while i ≥ 0 do put 2 * i + 1 into Set i := i + 1 endwhile (all +ve numbers not exactly divisible by 8) Set =  i = 0 while i ≥ 0 do for j = 1 to 7 do put i + j into Set endfor i = i + 8 endwhile

Michaelmas Term 2004 Discrete Mathematics Set Operations UNION (written  ) –takes all of the elements from two sets, and makes a new set containing those elements (with no duplicate elements) – A  B = { x | x  A  x  B } –Example: If A = {1, 2, 3} and B = {4, 5}, then A  B = {1, 2, 3, 4, 5}. –Example: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A  B = {1, 2, 3, 4, 5}. INTERSECTION (written  ) –forms a new set from two sets, consisting of all elements that are in BOTH of the original sets –A  B = { x | x  A   x  B } –Example: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A  B = {1, 2}. –Example: If A = {1, 2, 3} and B = {4, 5}, then A  B = 

Michaelmas Term 2004 Discrete Mathematics Set Operations DIFFERENCE (written – or /) –forms a new set from two sets, consisting of all elements from the first set that are not in the second –A - B = { x | x  A  x  B } –Example: If A = {1, 2, 3} and B = {1, 2, 4, 5}, then A - B = {3}. –Example: If A = {1, 2, 3} and B = {4, 5}, then A - B = {1, 2, 3}. Each of the basic set operations: –is infix operator i.e. it is written in between its arguments, as is, for example “+” in arithmetic –takes two sets as its arguments

Michaelmas Term 2004 Discrete Mathematics Union Examples: –{a, b, c}  {b, c, d} = {a, b, c, d} –{a, b, c}   = {a, b, c} –   {a, b, c} = {a, b, c} –{2x | x > 0}  {2x + 1 | x ≥ 0} = {x | x > 0} NOTE that for all sets A, B, C: –A  B = B  A (commutative law) –A   = A (identity law) –A  A = A (idempotent law) –(A  B)  C = A  (B  C) (associative law) Checkpoint: “prove” the above to yourself

Michaelmas Term 2004 Discrete Mathematics Intersection Examples –{a, b, c}  {b, c, d} = {b, c} –{a, b, c}   =  –   {a, b, c} =  –{2x | x > 0}  {3x | x > 0} = {6x | x > 0} –{2x | x > 0}  {2x + 1 | x ≥ 0 } =  NOTE that for all sets A, B, C: –A  B = B  A (commutative law) –A   =  (domination law) –A  A = A (idempotent law) –(A  B)  C = A  (B  C) (associative law)

Michaelmas Term 2004 Discrete Mathematics Set difference Examples: –{a, b, c} - {b, c, d} = {a} –{b, c, d} – {a, b, c} = {d} –{a, b, c} – {} = {a, b, c} –{a, b, c} – {d, e, f} = {a, b, c} –{x | x > 0} – {2x + 1 | x ≥ 0} = {2x | x > 0} NOTE: for all sets, A –A –  = A –  – A =  –A – A = 

Michaelmas Term 2004 Discrete Mathematics Cartesian product An ordered pair is a pair of objects with an order associated with them. If objects are represented by x and y, then we write the ordered pair as. Two ordered pairs and are equal if and only if a = c and b = d. For example the ordered pair is not equal to the ordered pair. The set of all ordered pairs, where a is an element of A and b is an element of B, is called the Cartesian product of A and B and is denoted by A x B. Example 1: Let A = {1, 2, 3} and B = {a, b}. Then A x B = {,,,,, }. Example 2: For the same A and B as in Example 1, B x A = {,,,,, }. In general, A x B ≠B x A unless A = , B =  or A = B. Note that A x  =  x A =  because there is no element in  to form ordered pairs with elements of A.

Michaelmas Term 2004 Discrete Mathematics Set operations - Exercises if A = {a, b, c, y}, B = {a, b, c, d, e} and C = {x, y} evaluate: 1.A  (B  C) 2.(A  B)  C 3.C – A 4.(A – B) – C 5.A – (B – C) 6.(A  C)  B 7.A  (C  B)

Michaelmas Term 2004 Discrete Mathematics Answers 1.A 2.{y} 3.{x} 4.  5.{y} 6.{a, b, c, d, e, y} 7.A

Michaelmas Term 2004 Discrete Mathematics Subsets A is a subset of another set, B, means that all members of the set A are also members of the set B. Notation: A  B we say “A is a subset of B”, or “B is a superset of A” or “A is contained in B” or “B contains A” Examples: –{a, b, c}  {a, b, c, d, e} –{2x | x > 1}  {x | x > 0} If A  B, and the set B also contains elements that the set A does not, we say A is a proper subset of B, and we write: A  B Checkpoint: can we correctly use  instead of  in the two examples above?

Michaelmas Term 2004 Discrete Mathematics Subset Exercises if A = {a, b, c, d, e, f}, B = {a, b, e}, C = {c, d}, and D = {d, f, g} say which of the following are true statements: 1.B  B 2.B  B 3.B  A 4.C  A 5.(B  C)  A 6.D  A 7.(D  C)  A 8.(D  C)  A

Michaelmas Term 2004 Discrete Mathematics Answers 1.true (of any set) 2.false (of any set) 3.true 4.true 5.true 6.false 7.true 8.false

Michaelmas Term 2004 Discrete Mathematics Universal sets we often consider sets in terms of them all being subsets of a so called universal set or universe –for example, all the sets of numbers we have considered so far have been subsets of the set of all positive integers –the so-called natural numbers, sometimes written N this leads to the notion of the complement of a set –the complement is the difference between the universe and a given set –e.g. with a universe of N, the complement of {2x | x > 1} is {2x + 1 | x > 0} –the complement of a set A is usually written Ā we’ll write comp(A)

Michaelmas Term 2004 Discrete Mathematics Power sets Universal sets - examples suppose the universe, U = {a, b, c, d, e, f, g}, A = {a, b, c} and B = {b, c, d, e} –comp(A) = {d, e, f, g} –comp(B) = {a, f, g} –comp (A)  comp(B) = {a, d, e, f, g} –comp(A  B) = comp({b, c}) = {a, d, e, f, g} –comp(A)  comp(B) = {f, g} –comp (A  B) = comp({a, b, c, d, e}) = {f, g} Power Sets - the set of all subsets of a set A is called the power set of A and denoted by 2 A or  (A). –For example for A = {1, 2}, –  (A) = { , {1}, {2}, {1, 2} }