Lecture # 01
Lecture # 01
Junaid Asghar
BSCS (UET Lahore)
MSCS (UMT Lahore)
Lecturer
Computer Sciences and IT Department
The University of Lahore
Discrete Structure/Mathematics
BSCS (3 Credit Hour)
Lecture # 01
Introduction
Discrete structures/mathematics has special
relevance to computer science.
Example:
Management Science
Network Analysis
Social decision making
Finance
Reasons to study discrete
Mathematics.
Mathematical Maturity essential to study any
scientific discipline.
Data Structures
Algorithm Analysis
Theory of Automata
Computer Theory
The kind of problem solved using
Discrete Structure Course:
How many ways are there to choose a valid password?
Definition:
Discrete
Continuous
Example:
Set of Integers:
• • • • • •
3 -2 -1 0 1 2
• • • • • • •
-3 -2 -1 0 1 2 3
Odometer
Logic
Logic rules and principles is to distinguish an
argument is valid or invalid.
Def:
“Logic is the study of the principles and
methods that distinguishes between a valid
and an invalid argument.”
PROPOSITION
A statement/proposition is a declarative sentence which
is either TRUE or FALSE but not both.
Grass is green. T
4+2=6 T
4+2=7 F
There are four fingers in a hand. F
NOT Propositions
Close the door.
x is greater than 2.
Example
Bill Gates is an American
He is very rich
He is very rich is a statement with truth-value
TRUE.
Example:
x=1
x>2
x > 2 is a statement with truth-value FALSE.
UNDERSTANDING STATEMENTS
x + 2 is positive.
May I come in?
Logic is interesting.
It is hot today.
-1 > 0
x + y = 12
UNDERSTANDING STATEMENTS
x + 2 is positive. Not a
statement
May I come in? Not a statement
Logic is interesting. A statement
It is hot today. A statement
-1 > 0 A statement
x + y = 12 Not a statement
COMPOUND STATEMENT
Def:
“Simple statements could be used to build a
compound statement.”
Examples:
“3 + 2 = 5” and “Lahore is a city in Pakistan”
“The grass is green” or “ It is hot today”
“Discrete Structure is not difficult to me”
EXAMPLES:
pq=?
pq=?
~p = ?
EXAMPLES:
p = “Islamabad is the capital of Pakistan”
q = “17 is divisible by 3”
p ~p
T F
F T
CONJUCTION ()
If p and q are statements, then the
conjunction of p and q is “p and q”, denoted
as “p q”.
p q pq
T T T
T F F
F T F
F F F
DISJUNCTION ()
If p & q are statements, then the disjunction
of p and q is “p or q”, denoted as “p q”.