intro to disceret structure
TRANSCRIPT
![Page 1: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/1.jpg)
Discrete
Structures
Abdur Rehman Usmani
03419019922
![Page 2: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/2.jpg)
Why is ito“Discrete” (≠ “discreet”!) - Composed of distinct, separable parts.
o“Structures” - objects built up from simpler objects according to a definite pattern.
![Page 3: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/3.jpg)
Why it is importanto Provides mathematical foundation for computer science courses such as
o data structures, algorithms, relational database theory, automata theory and
o formal languages, compiler design, and cryptography,
o mathematics courses such as linear and abstract algebra, probability, logic and set theory, and number theory.
![Page 4: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/4.jpg)
What it doeso Describes processes that consist of a sequence of individual steps.
o Helps students to develop the ability to think abstractly.
![Page 5: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/5.jpg)
BooksDiscrete Mathematics and Its Applications
by Kenneth H. Rosen.
6th edition, McGraw Hill Publisher.
Discrete Mathematics with Applications by Susanna S.Epp
4th edition, McGraw Hill Publisher.
![Page 6: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/6.jpg)
ESSENTIAL TOPICS TO BE COVERED:o Functions, relations and sets
o Basic logic
o Proof techniques
o Basics of counting
o Graphs and trees
o Recursion
![Page 7: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/7.jpg)
LogicoCrucial for mathematical reasoning
oImportant for program design
oUsed for designing electronic circuitry
o(Propositional )Logic is a system based on propositions.
oA proposition is a (declarative) statement that is either true or false (not both).
oWe say that the truth value of a proposition is either true (T) or false (F).
oCorresponds to 1 and 0 in digital circuits
![Page 8: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/8.jpg)
The Statement/Proposition Game
“Elephants are bigger than mice.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value of the proposition? true
![Page 9: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/9.jpg)
The Statement/Proposition Game
“520 < 111”
Is this a statement? yes
Is this a proposition? yes
What is the truth value of the proposition? false
![Page 10: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/10.jpg)
The Statement/Proposition Game
“y > 5”
Is this a statement? yes
Is this a proposition? no
Its truth value depends on the value of y, but this value is not specified.We call this type of statement a propositional function or open sentence.
![Page 11: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/11.jpg)
The Statement/Proposition Game
“Today is January 27 and 99 < 5.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value of the proposition? false
![Page 12: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/12.jpg)
The Statement/Proposition Game
“Please do not fall asleep.”
Is this a statement? no
Is this a proposition? no
Only statements can be propositions.
It’s a request.
![Page 13: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/13.jpg)
The Statement/Proposition Game
“If the moon is made of cheese,
then I will be rich.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value of the proposition? probably true
![Page 14: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/14.jpg)
The Statement/Proposition Game
“x < y if and only if y > x.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value of the proposition? true
… because its truth value does not depend on specific values of x and y.
![Page 15: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/15.jpg)
Combining Propositions
As we have seen in the previous examples, one or more propositions can be combined to form a single compound proposition.
We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators or logical connectives.
![Page 16: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/16.jpg)
Logical Operators (Connectives)
We will examine the following logical operators:
• Negation (NOT, )• Conjunction (AND, )• Disjunction (OR, )• Exclusive-or (XOR, )• Implication (if – then, )• Biconditional (if and only if, )
Truth tables can be used to show how these operators can combine propositions to compound propositions.
![Page 17: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/17.jpg)
Negation (NOT)
Unary Operator, Symbol:
P P
true (T) false (F)
false (F) true (T)
![Page 18: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/18.jpg)
Conjunction (AND)
Binary Operator, Symbol:
P Q P Q
T T T
T F F
F T F
F F F
![Page 19: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/19.jpg)
Disjunction (OR)
Binary Operator, Symbol:
P Q P Q
T T T
T F T
F T T
F F F
![Page 20: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/20.jpg)
ConnectivesLet p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
Translate each of the following into English:
¬p = “It didn’t rain last night.”
r ∧ ¬p =“The lawn was wet this morning,
and it didn’t rain last night.”
¬ r ∨ p ∨ q =“Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.”
![Page 21: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/21.jpg)
ConnectivesLet p= “It is hot”
q=““It is sunny”
1. It is not hot but it is sunny.
2. It is neither hot nor sunny.
Solution
1. ⌐p∧q
2. ⌐p∧ ⌐q
![Page 22: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/22.jpg)
Exclusive Or (XOR)
Binary Operator, Symbol:
P Q PQ
T T F
T F T
F T T
F F F
• p = “I will earn an A in this course,”• q = “I will drop this course,”• p ⊕ q = “I will either earn an A in this
course, or I will drop it (but not both!)”• True when exactly one of p and q is
true and is false otherwise.
![Page 23: Intro to disceret structure](https://reader036.vdocuments.mx/reader036/viewer/2022081401/58eeecc71a28abf4358b45a3/html5/thumbnails/23.jpg)