intro to disceret structure
TRANSCRIPT
Discrete
Structures
Abdur Rehman Usmani
03419019922
Why is ito“Discrete” (≠ “discreet”!) - Composed of distinct, separable parts.
o“Structures” - objects built up from simpler objects according to a definite pattern.
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.
What it doeso Describes processes that consist of a sequence of individual steps.
o Helps students to develop the ability to think abstractly.
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.
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
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
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
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
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.
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
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.
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
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.
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.
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.
Negation (NOT)
Unary Operator, Symbol:
P P
true (T) false (F)
false (F) true (T)
Conjunction (AND)
Binary Operator, Symbol:
P Q P Q
T T T
T F F
F T F
F F F
Disjunction (OR)
Binary Operator, Symbol:
P Q P Q
T T T
T F T
F T T
F F F
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.”
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
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.