Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 33

1

CC1311w
Discrete Structures
INTRODUCTION
2

► Why to study discrete mathematics?


3

►The word “discrete” is used in the sense of


“separated from each other” the opposite of
“continuous”. It is also often used in the more
restrictive sense of “finite” usually define as “the
mathematics of discrete sets
4
The Scope

►Discrete Structures deals with


►The studies of mathematical structures
that are fundamentally discrete (Not require
the notion of continuity)

►The countable things


5
Why Discrete Math?

► Discrete math forms the basis for computer science


► Sequences

► Digital logic (how computers compute)


► Algorithms

► Program correctness
► Probability and gambling (or taking risks)

“Continuous” math forms the basis for most physical


and biological sciences
6
Propositions

► A proposition is a statement that is either true or false


► “The sky is blue”
► “Today the temperature is below freezing”
► “9 + 3 = 12”

Not propositions:
“Who is Bob?”
“How many persons are there in this group?”
“X + 1 = 7.”
7
Propositional (or Boolean) variables

► Variables that refer to propositions


► Usually denoted by lower case letters p, q, r, etc.
► Can have one of two values true (T) or false (F)

► A proposition can be
► A single variable p
► A formula of multiple variables
► E.g. p ∧ q, s ∨¬r
8
Propositional (or Boolean) operators
9
Logical operator: NOT
10
Logical operator: AND
11
Logical operator: OR
12
Logical operator: EXCLUSIVE OR
13
(Inclusive) OR or EXCLUSIVE OR?
14
Logical Operator NAND and NOR
15
Conditional Operator
16
Conditional operators
17
Conditional operators
18
Set representations

A proposition p can also be represented by a set (a


collection of elements) for which the proposition is true.

p
p

pp p∧q
q
q
¬ p∨q
p
Venn diagram
19
Bi-conditional Statements
20
Translating into English
21
Translating into English

Example
“You cannot ride the roller coaster if you are under 4 feet tall
unless you are older than 16 years old.”

Q = “You can ride the roller coaster”


R = “You are under 4 feet tall”
S = “You are older than 16 years old”

(R ∧ ¬S) → ¬Q
22
Precedence of Operators
23
Boolean operators in search

► Boolean search

► System Specifications (formal methods in SE)


► Logical Puzzles (like in GRE exam)
► Logical Circuits (Electronics/DLD)
24
Tautology and Contradiction

► Compound proposition refers to an expression


formed from propositional variables using logical
operators, e.g. p ∧ q
► A compound proposition that is always true is
called a tautology
► A compound proposition that is always false is
called a contradiction
► A compound proposition that is neither a tautology
nor a contradiction is called a contingency
25
Logical Equivalence

► Compound propositions p and q are called logically equivalent


if p ↔ q is a tautology

► Notation p ≡ q denotes that p and q are logically equivalent

► Note that
► The symbol ≡ is not a logical connective
► p ≡ q is not a compound proposition but rather is the statement that p ↔ q
is a tautology
► The symbol ⇔ is sometimes used instead of ≡ to denote logical
equivalence
26
Example

Show that p → q and ¬p ∨ q are logically equivalent.


27
Logical Equivalences
28
Logical Equivalences
29
How to prove Equivalences

►Two methods
►Using truth tables
►Not good for long formulae (e.g. involving more than 5
variables)

►Using logical equivalences


30
Example

Show that (p ∧ q) → (p ∨ q) is a tautology.

Solution.

Draw truth table to verify it.


31
32
33

You might also like