SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Discrete Mathematics
CSE 2353
Fall 2007
Margaret H. Dunham
Department of Computer Science and
Engineering
Southern Methodist University
•Some slides provided by Dr. Eric Gossett; Bethel University; St. Paul,
Minnesota
•Some slides are companion slides for Discrete Mathematical
Structures: Theory and Applications by D.S. Malik and M.K. Sen
2
Outline
 Introduction
 Sets
 Logic & Boolean Algebra
 Proof Techniques
 Counting Principles
 Combinatorics
 Relations,Functions
 Graphs/Trees
 Boolean Functions, Circuits
Introduction
© Dr. Eric Gossett 3
Introduction to Discrete Mathematics
 What Is Discrete Mathematics?
 An example: The Stable Marriage
Problem
© Dr. Eric Gossett 4
The Stable Marriage Problem
 In the future we will:
 Prove that the assignment is stable (reading
tonight).
 Prove that the assignment is optimal for suitors.
 Count the number of possible assignments.
 Calculate the complexity of the algorithm.
 The Problem
 A Solution:
 The Deferred Acceptance
Algorithm
© Discrete Mathematical
Structures: Theory and
Applications 5
Stable
 Marriage partners should be assigned in such a
manner that no one will be able to find someone
(whom they prefer to their assigned mate) that is
willing to elope with them.
© Dr. Eric Gossett 6
What Is Discrete Mathematics?
 What it isn’t: continuous
 Discrete: consisting of distinct or
unconnected elements
 Countably Infinite
 Definition Discrete Mathematics
 Discrete Mathematics is a collection of
mathematical topics that examine and
use finite or countably infinite
mathematical objects.
7
 Introduction
 Sets
 Logic & Boolean Algebra
 Proof Techniques
 Counting Principles
 Combinatorics
 Relations,Functions
 Graphs/Trees
 Boolean Functions, Circuits
Outline
Sets
8
 It is assumed that you have studied
set theory before.
 The remaining slides in this section
are for your review. They will not
all be covered in class.
 If you need extra help in this area,
a special help session will be
scheduled.
9
Sets: Learning Objectives
 Learn about sets
 Explore various operations on sets
 Become familiar with Venn diagrams
 CS:
 Learn how to represent sets in computer
memory
 Learn how to implement set operations in
programs
© Discrete Mathematical
Structures: Theory and
Applications 10
Sets
 Definition: Well-defined collection of distinct objects
 Members or Elements: part of the collection
 Roster Method: Description of a set by listing the
elements, enclosed with braces
 Examples:
 Vowels = {a,e,i,o,u}
 Primary colors = {red, blue, yellow}
 Membership examples
 “a belongs to the set of Vowels” is written as:
a  Vowels
 “j does not belong to the set of Vowels:
j  Vowels
© Discrete Mathematical
Structures: Theory and
Applications 11
Sets
 Set-builder method
 A = { x | x  S, P(x) } or A = { x  S | P(x) }
 A is the set of all elements x of S, such that x
satisfies the property P
 Example:
 If X = {2,4,6,8,10}, then in set-builder
notation, X can be described as
X = {n  Z | n is even and 2  n  10}
© Discrete Mathematical
Structures: Theory and
Applications 12
Sets
 Standard Symbols which denote sets of numbers
 N : The set of all natural numbers (i.e.,all positive integers)
 Z : The set of all integers
 Z+ : The set of all positive integers
 Z* : The set of all nonzero integers
 E : The set of all even integers
 Q : The set of all rational numbers
 Q* : The set of all nonzero rational numbers
 Q+ : The set of all positive rational numbers
 R : The set of all real numbers
 R* : The set of all nonzero real numbers
 R+ : The set of all positive real numbers
 C : The set of all complex numbers
 C* : The set of all nonzero complex numbers
© Discrete Mathematical
Structures: Theory and
Applications 13
Sets
 Subsets
 “X is a subset of Y” is written as X  Y
 “X is not a subset of Y” is written as X Y
 Example:
 X = {a,e,i,o,u}, Y = {a, i, u} and
Z= {b,c,d,f,g}
 Y  X, since every element of Y is an element of X
 Y Z, since a  Y, but a  Z
© Discrete Mathematical
Structures: Theory and
Applications 14
Sets
 Superset
 X and Y are sets. If X  Y, then “X is contained in
Y” or “Y contains X” or Y is a superset of X,
written Y  X
 Proper Subset
 X and Y are sets. X is a proper subset of Y if X 
Y and there exists at least one element in Y that
is not in X. This is written X  Y.
 Example:
 X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}
 X  Y , since y  Y, but y  X
© Discrete Mathematical
Structures: Theory and
Applications 15
Sets
 Set Equality
 X and Y are sets. They are said to be equal if every
element of X is an element of Y and every element of Y is
an element of X, i.e. X  Y and Y  X
 Examples:
 {1,2,3} = {2,3,1}
 X = {red, blue, yellow} and Y = {c | c is a primary
color} Therefore, X=Y
 Empty (Null) Set
 A Set is Empty (Null) if it contains no elements.
 The Empty Set is written as 
 The Empty Set is a subset of every set
© Discrete Mathematical
Structures: Theory and
Applications 16
Sets
 Finite and Infinite Sets
 X is a set. If there exists a nonnegative integer n such
that X has n elements, then X is called a finite set with n
elements.
 If a set is not finite, then it is an infinite set.
 Examples:
 Y = {1,2,3} is a finite set
 P = {red, blue, yellow} is a finite set
 E , the set of all even integers, is an infinite set
  , the Empty Set, is a finite set with 0 elements
© Discrete Mathematical
Structures: Theory and
Applications 17
Sets
 Cardinality of Sets
 Let S be a finite set with n distinct elements,
where n ≥ 0. Then |S| = n , where the
cardinality (number of elements) of S is n
 Example:
 If P = {red, blue, yellow}, then |P| = 3
 Singleton
 A set with only one element is a singleton
 Example:
 H = { 4 }, |H| = 1, H is a singleton
© Discrete Mathematical
Structures: Theory and
Applications 18
Sets
 Power Set
 For any set X ,the power set of X ,written P(X),is
the set of all subsets of X
 Example:
 If X = {red, blue, yellow}, then P(X) = {  ,
{red}, {blue}, {yellow}, {red,blue}, {red,
yellow}, {blue, yellow}, {red, blue, yellow} }
 Universal Set
 An arbitrarily chosen, but fixed set
© Discrete Mathematical
Structures: Theory and
Applications 19
Sets
 Venn Diagrams
 Abstract visualization
of a Universal set, U
as a rectangle, with all
subsets of U shown as
circles.
 Shaded portion
represents the
corresponding set
 Example:
 In Figure 1, Set X,
shaded, is a subset
of the Universal set,
U
© Discrete Mathematical
Structures: Theory and
Applications 20
Set Operations and Venn
Diagrams
 Union of Sets
Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then
XUY = {1,2,3,4,5,6,7,8,9}
© Discrete Mathematical
Structures: Theory and
Applications 21
Sets
 Intersection of Sets
Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then X ∩ Y = {5}
© Discrete Mathematical
Structures: Theory and
Applications 22
Sets
 Disjoint Sets
Example: If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y = 
© Discrete Mathematical
Structures: Theory and
Applications 23
Sets
 Difference
• Example: If X = {a,b,c,d} and Y =
{c,d,e,f}, then X – Y = {a,b} and Y – X =
{e,f}
© Discrete Mathematical
Structures: Theory and
Applications 24
 Complement
The complement of a set X with respect to a universal set U,
denoted by , is defined to be = {x |x  U, but x  X}
Sets
X
Example: If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then = {a,b}
X
X
© Discrete Mathematical
Structures: Theory and
Applications 25
Sets
© Discrete Mathematical
Structures: Theory and
Applications 26
Sets
 Ordered Pair
 X and Y are sets. If x  X and y  Y, then an
ordered pair is written (x,y)
 Order of elements is important. (x,y) is not
necessarily equal to (y,x)
 Cartesian Product
 The Cartesian product of two sets X and Y ,written X
× Y ,is the set
 X × Y ={(x,y)|x ∈ X , y ∈ Y}
 For any set X, X ×  =  =  × X
 Example:
 X = {a,b}, Y = {c,d}
 X × Y = {(a,c), (a,d), (b,c), (b,d)}
 Y × X = {(c,a), (d,a), (c,b), (d,b)}
© Dr. Eric Gossett 27
28
Computer Representation of Sets
 A Set may be stored in a computer in an array as an
unordered list
 Problem: Difficult to perform operations on the set.
 Linked List
 Solution: use Bit Strings (Bit Map)
 A Bit String is a sequence of 0s and 1s
 Length of a Bit String is the number of digits in the
string
 Elements appear in order in the bit string
 A 0 indicates an element is absent, a 1 indicates
that the element is present
 A set may be implemented as a file
29
Computer Implementation of Set
Operations
 Bit Map
 File
 Operations
 Intersection
 Union
 Element of
 Difference
 Complement
 Power Set
30
Special “Sets” in CS
 Multiset
 Ordered Set
31
 Introduction
 Sets
 Logic & Boolean Algebra
 Proof Techniques
 Counting Principles
 Combinatorics
 Relations,Functions
 Graphs/Trees
 Boolean Functions, Circuits
Outline
Logic & Boolean Algebra
32
Logic: Learning Objectives
 Learn about statements (propositions)
 Learn how to use logical connectives to combine statements
 Explore how to draw conclusions using various argument
forms
 Become familiar with quantifiers and predicates
 CS
 Boolean data type
 If statement
 Impact of negations
 Implementation of quantifiers
© Discrete Mathematical
Structures: Theory and
Applications 33
Mathematical Logic
 Definition: Methods of reasoning, provides rules
and techniques to determine whether an
argument is valid
 Theorem: a statement that can be shown to be
true (under certain conditions)
 Example: If x is an even integer, then x + 1 is
an odd integer
 This statement is true under the condition that x is an
integer is true
© Discrete Mathematical
Structures: Theory and
Applications 34
Mathematical Logic
 A statement, or a proposition, is a declarative sentence
that is either true or false, but not both
 Uppercase letters denote propositions
 Examples:
 P: 2 is an even number (true)
 Q: 7 is an even number (false)
 R: A is a vowel (true)
 The following are not propositions:
 P: My cat is beautiful
 Q: My house is big
© Discrete Mathematical
Structures: Theory and
Applications 35
Mathematical Logic
 Truth value
 One of the values “truth” (T) or “falsity” (F)
assigned to a statement
 Negation
 The negation of P, written , is the statement
obtained by negating statement P
 Example:
 P: A is a consonant
 : it is the case that A is not a consonant
 Truth Table
P

P
T F
F T
P

P

© Discrete Mathematical
Structures: Theory and
Applications 36
Mathematical Logic
 Conjunction
 Let P and Q be statements.The conjunction of P and
Q, written P ^ Q , is the statement formed by joining
statements P and Q using the word “and”
 The statement P ^ Q is true if both p and q are true;
otherwise P ^ Q is false
 Truth Table for Conjunction:
© Discrete Mathematical
Structures: Theory and
Applications 37
Mathematical Logic
 Disjunction
 Let P and Q be statements. The disjunction of P and
Q, written P v Q , is the statement formed by joining
statements P and Q using the word “or”
 The statement P v Q is true if at least one of the
statements P and Q is true; otherwise P v Q is false
 The symbol v is read “or”
 Truth Table for Disjunction:
© Discrete Mathematical
Structures: Theory and
Applications 38
Mathematical Logic
 Implication
 Let P and Q be statements.The statement “if P then Q” is
called an implication or condition.
 The implication “if P then Q” is written P  Q
 P is called the hypothesis, Q is called the conclusion
 Truth Table for Implication:
39
Mathematical Logic
 Implication
 Let P: Today is Sunday and Q: I will wash the car.
 P  Q :
If today is Sunday, then I will wash the car
 The converse of this implication is written Q  P
If I wash the car, then today is Sunday
 The inverse of this implication is
If today is not Sunday, then I will not wash the car
 The contrapositive of this implication is
If I do not wash the car, then today is not Sunday
Q
P 


P
Q 


© Discrete Mathematical
Structures: Theory and
Applications 40
Mathematical Logic
 Biimplication
 Let P and Q be statements. The statement “P if and only if
Q” is called the biimplication or biconditional of P and Q
 The biconditional “P if and only if Q” is written P  Q
 “P if and only if Q”
 Truth Table for the Biconditional:
41
Mathematical Logic
 Precedence of logical
connectives is:
 highest

^ second highest
 v third highest
 → fourth highest
 ↔ fifth highest

© Discrete Mathematical
Structures: Theory and
Applications 42
Mathematical Logic
 Tautology
 A statement formula A is said to be a tautology
if the truth value of A is T for any assignment of
the truth values T and F to the statement
variables occurring in A
 Contradiction
 A statement formula A is said to be a
contradiction if the truth value of A is F for any
assignment of the truth values T and F to the
statement variables occurring in A
© Discrete Mathematical
Structures: Theory and
Applications 43
Mathematical Logic
 Logically Implies
 A statement formula A is said to logically imply a
statement formula B if the statement formula A → B is a
tautology. If A logically implies B, then symbolically we
write A → B
 Logically Equivalent
 A statement formula A is said to be logically equivalent
to a statement formula B if the statement formula
A ↔ B is a tautology. If A is logically equivalent to B ,
then symbolically we write A B

© Dr. Eric Gossett 44
© Dr. Eric Gossett 45
Inference and Substitution
© Dr. Eric Gossett 46
© Discrete Mathematical
Structures: Theory and
Applications 47
Quantifiers and First Order Logic
 Predicate or Propositional Function
 Let x be a variable and D be a set; P(x)
is a sentence
 Then P(x) is called a predicate or
propositional function with respect to
the set D if for each value of x in D, P(x)
is a statement; i.e., P(x) is true or false
 Moreover, D is called the domain
(universe) of discourse and x is called
the free variable
© Discrete Mathematical
Structures: Theory and
Applications 48
Quantifiers and First Order Logic
 Universal Quantifier
 Let P(x) be a predicate and let D be the domain of
the discourse. The universal quantification of P(x) is
the statement:
 For all x, P(x) or
 For every x, P(x)
 The symbol is read as “for all and every”
 or
 Two-place predicate:

)
(
, x
P
x

)
,
(
,
, y
x
P
y
x 

)
(
, x
P
D
x

© Discrete Mathematical
Structures: Theory and
Applications 49
Quantifiers and First Order Logic
 Existential Quantifier
 Let P(x) be a predicate and let D be the universe of
discourse. The existential quantification of P(x) is the
statement:
 There exists x, P(x)
 The symbol is read as “there exists”
 or
 Bound Variable
 The variable appearing in: or

)
(
D, x
P
x

)
(
, x
P
x
 )
(
, x
P
x

)
(
, x
P
x

© Discrete Mathematical
Structures: Theory and
Applications 50
Quantifiers and First Order Logic
 Negation of Predicates (DeMorgan’s Laws)

 Example:
 If P(x) is the statement “x has won a race” where the
domain of discourse is all runners, then the universal
quantification of P(x) is , i.e., every runner
has won a race. The negation of this statement is “it is
not the case that every runner has won a race.
Therefore there exists at least one runner who has not
won a race. Therefore:

)
(
,
)
(
, x
P
x
x
P
x 



)
(
, x
P
x

)
(
, x
P
x 

)
(
,
)
(
, x
P
x
x
P
x 



© Dr. Eric Gossett 51
52
Two-Element Boolean Algebra
The Boolean Algebra on B= {0, 1} is defined as follows:
+ 0 1 · 0 1 ¯
0 0 1 0 0 0 0 1
1 1 1 1 0 1 1 0
© Dr. Eric Gossett 53
Duality and the Fundamental
Boolean Algebra Properties
 Duality
 The dual of any Boolean theorem is also a theorem.
 Parentheses must be used to preserve operator
precedence.
54
Logic and CS
 Logic is basis of ALU (Boolean Algebra)
 Logic is crucial to IF statements
 AND
 OR
 NOT
 Implementation of quantifiers
 Looping
 Database Query Languages
 Relational Algebra
 Relational Calculus
 SQL

Weitere ähnliche Inhalte

Ähnlich wie part1.ppt

Mkk1013 chapter 2.1
Mkk1013 chapter 2.1Mkk1013 chapter 2.1
Mkk1013 chapter 2.1ramlahmailok
 
Sets functions-sequences-exercises
Sets functions-sequences-exercisesSets functions-sequences-exercises
Sets functions-sequences-exercisesRoshayu Mohamad
 
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptxSet Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptxKalirajMariappan
 
Presentation on set in discrete mathe
Presentation on set in discrete mathePresentation on set in discrete mathe
Presentation on set in discrete mathetopu93
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Ra'Fat Al-Msie'deen
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theoryNittaya Noinan
 
Set Theory, Relations,Functions (Discrete Structures)
Set Theory, Relations,Functions (Discrete Structures)Set Theory, Relations,Functions (Discrete Structures)
Set Theory, Relations,Functions (Discrete Structures)kimdokja738
 
Set, Relations and Functions
Set, Relations and FunctionsSet, Relations and Functions
Set, Relations and Functionssuthi
 
A Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational CalculusA Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational CalculusYoshihiro Mizoguchi
 
Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1Loc Nguyen
 
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...Cristiano Longo
 

Ähnlich wie part1.ppt (20)

Mkk1013 chapter 2.1
Mkk1013 chapter 2.1Mkk1013 chapter 2.1
Mkk1013 chapter 2.1
 
Discrete mathematics notes
Discrete mathematics notesDiscrete mathematics notes
Discrete mathematics notes
 
SETS
SETSSETS
SETS
 
maths
mathsmaths
maths
 
Chpt 2-sets v.3
Chpt 2-sets v.3Chpt 2-sets v.3
Chpt 2-sets v.3
 
Sets functions-sequences-exercises
Sets functions-sequences-exercisesSets functions-sequences-exercises
Sets functions-sequences-exercises
 
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptxSet Theory - Unit -II (Mathematical Foundation  Of  Computer Science).pptx
Set Theory - Unit -II (Mathematical Foundation Of Computer Science).pptx
 
Per6 basis2_NUMBER SYSTEMS
Per6 basis2_NUMBER SYSTEMSPer6 basis2_NUMBER SYSTEMS
Per6 basis2_NUMBER SYSTEMS
 
Presentation on set in discrete mathe
Presentation on set in discrete mathePresentation on set in discrete mathe
Presentation on set in discrete mathe
 
Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"Theory of Computation "Chapter 1, introduction"
Theory of Computation "Chapter 1, introduction"
 
Introduction to set theory
Introduction to set theoryIntroduction to set theory
Introduction to set theory
 
Set Theory, Relations,Functions (Discrete Structures)
Set Theory, Relations,Functions (Discrete Structures)Set Theory, Relations,Functions (Discrete Structures)
Set Theory, Relations,Functions (Discrete Structures)
 
Theory of computation
Theory of computationTheory of computation
Theory of computation
 
Class XI CH 1 (sets)
Class XI CH 1 (sets)Class XI CH 1 (sets)
Class XI CH 1 (sets)
 
Maths sets ppt
Maths sets pptMaths sets ppt
Maths sets ppt
 
Set, Relations and Functions
Set, Relations and FunctionsSet, Relations and Functions
Set, Relations and Functions
 
6.1_set.pptx
6.1_set.pptx6.1_set.pptx
6.1_set.pptx
 
A Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational CalculusA Coq Library for the Theory of Relational Calculus
A Coq Library for the Theory of Relational Calculus
 
Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1Tutorial on EM algorithm – Part 1
Tutorial on EM algorithm – Part 1
 
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...
Herbrand-satisfiability of a Quantified Set-theoretical Fragment (Cantone, Lo...
 

Kürzlich hochgeladen

Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 

Kürzlich hochgeladen (20)

Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 

part1.ppt

  • 1. Discrete Mathematics CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University •Some slides provided by Dr. Eric Gossett; Bethel University; St. Paul, Minnesota •Some slides are companion slides for Discrete Mathematical Structures: Theory and Applications by D.S. Malik and M.K. Sen
  • 2. 2 Outline  Introduction  Sets  Logic & Boolean Algebra  Proof Techniques  Counting Principles  Combinatorics  Relations,Functions  Graphs/Trees  Boolean Functions, Circuits Introduction
  • 3. © Dr. Eric Gossett 3 Introduction to Discrete Mathematics  What Is Discrete Mathematics?  An example: The Stable Marriage Problem
  • 4. © Dr. Eric Gossett 4 The Stable Marriage Problem  In the future we will:  Prove that the assignment is stable (reading tonight).  Prove that the assignment is optimal for suitors.  Count the number of possible assignments.  Calculate the complexity of the algorithm.  The Problem  A Solution:  The Deferred Acceptance Algorithm
  • 5. © Discrete Mathematical Structures: Theory and Applications 5 Stable  Marriage partners should be assigned in such a manner that no one will be able to find someone (whom they prefer to their assigned mate) that is willing to elope with them.
  • 6. © Dr. Eric Gossett 6 What Is Discrete Mathematics?  What it isn’t: continuous  Discrete: consisting of distinct or unconnected elements  Countably Infinite  Definition Discrete Mathematics  Discrete Mathematics is a collection of mathematical topics that examine and use finite or countably infinite mathematical objects.
  • 7. 7  Introduction  Sets  Logic & Boolean Algebra  Proof Techniques  Counting Principles  Combinatorics  Relations,Functions  Graphs/Trees  Boolean Functions, Circuits Outline Sets
  • 8. 8  It is assumed that you have studied set theory before.  The remaining slides in this section are for your review. They will not all be covered in class.  If you need extra help in this area, a special help session will be scheduled.
  • 9. 9 Sets: Learning Objectives  Learn about sets  Explore various operations on sets  Become familiar with Venn diagrams  CS:  Learn how to represent sets in computer memory  Learn how to implement set operations in programs
  • 10. © Discrete Mathematical Structures: Theory and Applications 10 Sets  Definition: Well-defined collection of distinct objects  Members or Elements: part of the collection  Roster Method: Description of a set by listing the elements, enclosed with braces  Examples:  Vowels = {a,e,i,o,u}  Primary colors = {red, blue, yellow}  Membership examples  “a belongs to the set of Vowels” is written as: a  Vowels  “j does not belong to the set of Vowels: j  Vowels
  • 11. © Discrete Mathematical Structures: Theory and Applications 11 Sets  Set-builder method  A = { x | x  S, P(x) } or A = { x  S | P(x) }  A is the set of all elements x of S, such that x satisfies the property P  Example:  If X = {2,4,6,8,10}, then in set-builder notation, X can be described as X = {n  Z | n is even and 2  n  10}
  • 12. © Discrete Mathematical Structures: Theory and Applications 12 Sets  Standard Symbols which denote sets of numbers  N : The set of all natural numbers (i.e.,all positive integers)  Z : The set of all integers  Z+ : The set of all positive integers  Z* : The set of all nonzero integers  E : The set of all even integers  Q : The set of all rational numbers  Q* : The set of all nonzero rational numbers  Q+ : The set of all positive rational numbers  R : The set of all real numbers  R* : The set of all nonzero real numbers  R+ : The set of all positive real numbers  C : The set of all complex numbers  C* : The set of all nonzero complex numbers
  • 13. © Discrete Mathematical Structures: Theory and Applications 13 Sets  Subsets  “X is a subset of Y” is written as X  Y  “X is not a subset of Y” is written as X Y  Example:  X = {a,e,i,o,u}, Y = {a, i, u} and Z= {b,c,d,f,g}  Y  X, since every element of Y is an element of X  Y Z, since a  Y, but a  Z
  • 14. © Discrete Mathematical Structures: Theory and Applications 14 Sets  Superset  X and Y are sets. If X  Y, then “X is contained in Y” or “Y contains X” or Y is a superset of X, written Y  X  Proper Subset  X and Y are sets. X is a proper subset of Y if X  Y and there exists at least one element in Y that is not in X. This is written X  Y.  Example:  X = {a,e,i,o,u}, Y = {a,e,i,o,u,y}  X  Y , since y  Y, but y  X
  • 15. © Discrete Mathematical Structures: Theory and Applications 15 Sets  Set Equality  X and Y are sets. They are said to be equal if every element of X is an element of Y and every element of Y is an element of X, i.e. X  Y and Y  X  Examples:  {1,2,3} = {2,3,1}  X = {red, blue, yellow} and Y = {c | c is a primary color} Therefore, X=Y  Empty (Null) Set  A Set is Empty (Null) if it contains no elements.  The Empty Set is written as   The Empty Set is a subset of every set
  • 16. © Discrete Mathematical Structures: Theory and Applications 16 Sets  Finite and Infinite Sets  X is a set. If there exists a nonnegative integer n such that X has n elements, then X is called a finite set with n elements.  If a set is not finite, then it is an infinite set.  Examples:  Y = {1,2,3} is a finite set  P = {red, blue, yellow} is a finite set  E , the set of all even integers, is an infinite set   , the Empty Set, is a finite set with 0 elements
  • 17. © Discrete Mathematical Structures: Theory and Applications 17 Sets  Cardinality of Sets  Let S be a finite set with n distinct elements, where n ≥ 0. Then |S| = n , where the cardinality (number of elements) of S is n  Example:  If P = {red, blue, yellow}, then |P| = 3  Singleton  A set with only one element is a singleton  Example:  H = { 4 }, |H| = 1, H is a singleton
  • 18. © Discrete Mathematical Structures: Theory and Applications 18 Sets  Power Set  For any set X ,the power set of X ,written P(X),is the set of all subsets of X  Example:  If X = {red, blue, yellow}, then P(X) = {  , {red}, {blue}, {yellow}, {red,blue}, {red, yellow}, {blue, yellow}, {red, blue, yellow} }  Universal Set  An arbitrarily chosen, but fixed set
  • 19. © Discrete Mathematical Structures: Theory and Applications 19 Sets  Venn Diagrams  Abstract visualization of a Universal set, U as a rectangle, with all subsets of U shown as circles.  Shaded portion represents the corresponding set  Example:  In Figure 1, Set X, shaded, is a subset of the Universal set, U
  • 20. © Discrete Mathematical Structures: Theory and Applications 20 Set Operations and Venn Diagrams  Union of Sets Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then XUY = {1,2,3,4,5,6,7,8,9}
  • 21. © Discrete Mathematical Structures: Theory and Applications 21 Sets  Intersection of Sets Example: If X = {1,2,3,4,5} and Y = {5,6,7,8,9}, then X ∩ Y = {5}
  • 22. © Discrete Mathematical Structures: Theory and Applications 22 Sets  Disjoint Sets Example: If X = {1,2,3,4,} and Y = {6,7,8,9}, then X ∩ Y = 
  • 23. © Discrete Mathematical Structures: Theory and Applications 23 Sets  Difference • Example: If X = {a,b,c,d} and Y = {c,d,e,f}, then X – Y = {a,b} and Y – X = {e,f}
  • 24. © Discrete Mathematical Structures: Theory and Applications 24  Complement The complement of a set X with respect to a universal set U, denoted by , is defined to be = {x |x  U, but x  X} Sets X Example: If U = {a,b,c,d,e,f} and X = {c,d,e,f}, then = {a,b} X X
  • 25. © Discrete Mathematical Structures: Theory and Applications 25 Sets
  • 26. © Discrete Mathematical Structures: Theory and Applications 26 Sets  Ordered Pair  X and Y are sets. If x  X and y  Y, then an ordered pair is written (x,y)  Order of elements is important. (x,y) is not necessarily equal to (y,x)  Cartesian Product  The Cartesian product of two sets X and Y ,written X × Y ,is the set  X × Y ={(x,y)|x ∈ X , y ∈ Y}  For any set X, X ×  =  =  × X  Example:  X = {a,b}, Y = {c,d}  X × Y = {(a,c), (a,d), (b,c), (b,d)}  Y × X = {(c,a), (d,a), (c,b), (d,b)}
  • 27. © Dr. Eric Gossett 27
  • 28. 28 Computer Representation of Sets  A Set may be stored in a computer in an array as an unordered list  Problem: Difficult to perform operations on the set.  Linked List  Solution: use Bit Strings (Bit Map)  A Bit String is a sequence of 0s and 1s  Length of a Bit String is the number of digits in the string  Elements appear in order in the bit string  A 0 indicates an element is absent, a 1 indicates that the element is present  A set may be implemented as a file
  • 29. 29 Computer Implementation of Set Operations  Bit Map  File  Operations  Intersection  Union  Element of  Difference  Complement  Power Set
  • 30. 30 Special “Sets” in CS  Multiset  Ordered Set
  • 31. 31  Introduction  Sets  Logic & Boolean Algebra  Proof Techniques  Counting Principles  Combinatorics  Relations,Functions  Graphs/Trees  Boolean Functions, Circuits Outline Logic & Boolean Algebra
  • 32. 32 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical connectives to combine statements  Explore how to draw conclusions using various argument forms  Become familiar with quantifiers and predicates  CS  Boolean data type  If statement  Impact of negations  Implementation of quantifiers
  • 33. © Discrete Mathematical Structures: Theory and Applications 33 Mathematical Logic  Definition: Methods of reasoning, provides rules and techniques to determine whether an argument is valid  Theorem: a statement that can be shown to be true (under certain conditions)  Example: If x is an even integer, then x + 1 is an odd integer  This statement is true under the condition that x is an integer is true
  • 34. © Discrete Mathematical Structures: Theory and Applications 34 Mathematical Logic  A statement, or a proposition, is a declarative sentence that is either true or false, but not both  Uppercase letters denote propositions  Examples:  P: 2 is an even number (true)  Q: 7 is an even number (false)  R: A is a vowel (true)  The following are not propositions:  P: My cat is beautiful  Q: My house is big
  • 35. © Discrete Mathematical Structures: Theory and Applications 35 Mathematical Logic  Truth value  One of the values “truth” (T) or “falsity” (F) assigned to a statement  Negation  The negation of P, written , is the statement obtained by negating statement P  Example:  P: A is a consonant  : it is the case that A is not a consonant  Truth Table P  P T F F T P  P 
  • 36. © Discrete Mathematical Structures: Theory and Applications 36 Mathematical Logic  Conjunction  Let P and Q be statements.The conjunction of P and Q, written P ^ Q , is the statement formed by joining statements P and Q using the word “and”  The statement P ^ Q is true if both p and q are true; otherwise P ^ Q is false  Truth Table for Conjunction:
  • 37. © Discrete Mathematical Structures: Theory and Applications 37 Mathematical Logic  Disjunction  Let P and Q be statements. The disjunction of P and Q, written P v Q , is the statement formed by joining statements P and Q using the word “or”  The statement P v Q is true if at least one of the statements P and Q is true; otherwise P v Q is false  The symbol v is read “or”  Truth Table for Disjunction:
  • 38. © Discrete Mathematical Structures: Theory and Applications 38 Mathematical Logic  Implication  Let P and Q be statements.The statement “if P then Q” is called an implication or condition.  The implication “if P then Q” is written P  Q  P is called the hypothesis, Q is called the conclusion  Truth Table for Implication:
  • 39. 39 Mathematical Logic  Implication  Let P: Today is Sunday and Q: I will wash the car.  P  Q : If today is Sunday, then I will wash the car  The converse of this implication is written Q  P If I wash the car, then today is Sunday  The inverse of this implication is If today is not Sunday, then I will not wash the car  The contrapositive of this implication is If I do not wash the car, then today is not Sunday Q P    P Q   
  • 40. © Discrete Mathematical Structures: Theory and Applications 40 Mathematical Logic  Biimplication  Let P and Q be statements. The statement “P if and only if Q” is called the biimplication or biconditional of P and Q  The biconditional “P if and only if Q” is written P  Q  “P if and only if Q”  Truth Table for the Biconditional:
  • 41. 41 Mathematical Logic  Precedence of logical connectives is:  highest  ^ second highest  v third highest  → fourth highest  ↔ fifth highest 
  • 42. © Discrete Mathematical Structures: Theory and Applications 42 Mathematical Logic  Tautology  A statement formula A is said to be a tautology if the truth value of A is T for any assignment of the truth values T and F to the statement variables occurring in A  Contradiction  A statement formula A is said to be a contradiction if the truth value of A is F for any assignment of the truth values T and F to the statement variables occurring in A
  • 43. © Discrete Mathematical Structures: Theory and Applications 43 Mathematical Logic  Logically Implies  A statement formula A is said to logically imply a statement formula B if the statement formula A → B is a tautology. If A logically implies B, then symbolically we write A → B  Logically Equivalent  A statement formula A is said to be logically equivalent to a statement formula B if the statement formula A ↔ B is a tautology. If A is logically equivalent to B , then symbolically we write A B 
  • 44. © Dr. Eric Gossett 44
  • 45. © Dr. Eric Gossett 45 Inference and Substitution
  • 46. © Dr. Eric Gossett 46
  • 47. © Discrete Mathematical Structures: Theory and Applications 47 Quantifiers and First Order Logic  Predicate or Propositional Function  Let x be a variable and D be a set; P(x) is a sentence  Then P(x) is called a predicate or propositional function with respect to the set D if for each value of x in D, P(x) is a statement; i.e., P(x) is true or false  Moreover, D is called the domain (universe) of discourse and x is called the free variable
  • 48. © Discrete Mathematical Structures: Theory and Applications 48 Quantifiers and First Order Logic  Universal Quantifier  Let P(x) be a predicate and let D be the domain of the discourse. The universal quantification of P(x) is the statement:  For all x, P(x) or  For every x, P(x)  The symbol is read as “for all and every”  or  Two-place predicate:  ) ( , x P x  ) , ( , , y x P y x   ) ( , x P D x 
  • 49. © Discrete Mathematical Structures: Theory and Applications 49 Quantifiers and First Order Logic  Existential Quantifier  Let P(x) be a predicate and let D be the universe of discourse. The existential quantification of P(x) is the statement:  There exists x, P(x)  The symbol is read as “there exists”  or  Bound Variable  The variable appearing in: or  ) ( D, x P x  ) ( , x P x  ) ( , x P x  ) ( , x P x 
  • 50. © Discrete Mathematical Structures: Theory and Applications 50 Quantifiers and First Order Logic  Negation of Predicates (DeMorgan’s Laws)   Example:  If P(x) is the statement “x has won a race” where the domain of discourse is all runners, then the universal quantification of P(x) is , i.e., every runner has won a race. The negation of this statement is “it is not the case that every runner has won a race. Therefore there exists at least one runner who has not won a race. Therefore:  ) ( , ) ( , x P x x P x     ) ( , x P x  ) ( , x P x   ) ( , ) ( , x P x x P x    
  • 51. © Dr. Eric Gossett 51
  • 52. 52 Two-Element Boolean Algebra The Boolean Algebra on B= {0, 1} is defined as follows: + 0 1 · 0 1 ¯ 0 0 1 0 0 0 0 1 1 1 1 1 0 1 1 0
  • 53. © Dr. Eric Gossett 53 Duality and the Fundamental Boolean Algebra Properties  Duality  The dual of any Boolean theorem is also a theorem.  Parentheses must be used to preserve operator precedence.
  • 54. 54 Logic and CS  Logic is basis of ALU (Boolean Algebra)  Logic is crucial to IF statements  AND  OR  NOT  Implementation of quantifiers  Looping  Database Query Languages  Relational Algebra  Relational Calculus  SQL