Lecture 01
Lecture 01
Week # 1
NUML Rawalpindi
Department of Computer Science
Mehak Sheikh
mehak.sheikh@numl.edu.pk
1
Directory
2
Quizzes and Assignments
• Quiz- 3 quizzes
–2x before mid term, 1x after mid term
–+/- 20 minutes each
–Closed books/notes
– Announced (Depends)
• Assignment- 3 assignments
–2x before mid term
–1x after mid term
Projects
1. Each group contains maximum 3 students
for project/mega assignment
2. Each group will get 5-10 minutes for
presentation
3.Each student will get individual
grades.
Attendance
2 Quizzes 10
5 Presentation 5
Total 100
Course Learning Outcomes
7
The Course-Required attitude
Avoid these........
Why Discrete Structure
10
Discrete vs Continues
Discrete means with gaps Continues
means within a flow
11
Recommended Text Book
Discrete Mathematics with Applications (second edition) by
Susanna S. Epp
12
LECTURE # 1
COURSE OBJECTIVES
Express statements with the precision of formal logic
•Analyze arguments to test their validity
•Apply the basic properties and operations related to sets, relations
and functions
•Define terms recursively
•Discuss Loop invariants
•Illustrate the basic definitions of graph theory and properties of
graphs
•Relate each major topic in Discrete Mathematics to an
application area in computing
13
RECOMMENDED BOOKS
14
MAIN TOPICS
1. Logic.
2. Sets and Operations on sets.
3. Relations and Their Properties.
4. Functions.
5. Sequences and Series.
6. Recurrence Relations.
7. Loop Invariants.
8. Graphs and Trees.
15
What is Discrete Mathematics?
16
LOGIC
SIMPLE STATEMENT
18
EXAMPLES OF STATEMENTS
OR PROPOSITIONS:
1.Grass is green.
Grass is green is a statement
(or proposition) because the
sentence is true and its truth value
is T.( Because everyone knows
that grass is green)
2. 4 + 2 = 6
4 + 2 = 6 is also a statement
and its truth value is T.(Because
4+2 is 6)
3. 4+2=7
4 + 2 = 7 is also a statement
and its truth value is F. ( Because
19
we know that 4+2 is 6 not 7).
4. There are four fingers in a hand.
There are four fingers in a hand is
also a statement and its truth value
is True.
5. Washington, D.C, is the capital of
the United States of America.
The above statement is also a
proposition and its truth value is T.
6. Karachi is the capital of Pakistan. It
is also a statement and its truth
value is F.
7. Arif Alwi is the president of
America.
The above sentence is a statement
and its Truth value is false.
REMARK: Every sentence is not a 20
statement.
EXAMPLES OF SENTENCES
WHICH ARE NOT
PROPOSITIONS:
Consider the following sentences
• Close the door.
• x is greater than 2.
• He is very rich
• What time is it ?
• Read this carefully.
• x + z = 10
21
REMARK:
If sentence is a question or
command , or it is vague or
nonsensical, that is, it cannot be
classified as true or false then it is
not a statement
The statements which involve
variable and there are some
information about the variable which
make the role of variable clear then
the sentence becomes statement.
For example in the last
sentence if we say that x=3 and z=7
then this become a statement and its
truth value is T and if we say x=8
and z=4 then the sentence has its 22
truth value as F.
RULE
If the sentence is preceded by other
sentences that makes the variable
reference clear, then the sentence is a
statement.
23
EXAMPLES
x = 1 is a sentence which gives us
the information about the variable
which is in the following sentence.
26
COMPOUND STATEMENT
Simple statements could be used to
build a compound statement.
EXAMPLES
1. “3 + 2 = 5” and “Lahore is a city in
Pakistan”
SYMBOLIC REPRESENTATION
28
LOGICAL CONNECTIVES
CONNECTI ME SYM CALL
VE ANI BOL ED
NGS
Negation not ~ Tilde
Disjunction or Vel
if
EXAMPLES
p = “Islamabad is the capital of
Pakistan”
q = “17 is divisible by 3”
p q = “Islamabad is the capital of
Pakistan and 17 is divisible by 3”
p q = “Islamabad is the capital of
Pakistan or 17 is divisible by 3”
~p = “It is not the case that Islamabad
is the capital of Pakistan” or simply
“Islamabad is not the capital of
Pakistan”
30
TRANSLATING FROM ENGLISH
TO SYMBOLS
Let p = “It is hot”, and q = “ It is
sunny”
SENTENCE SYMBOLIC
FORM
1. It is not hot. ~p
2. It is hot and sunny. p q
3. It is hot or sunny. pq
4. It is not hot but sunny.
~ p q
5. It is neither hot nor sunny.
~p~q 31
EXAMPLE
Let h = “Zia is healthy”
w = “Zia is wealthy”
s = “Zia is wise”
Translate the compound statements to
symbolic form:
32
TRANSLATING FROM SYMBOLS TO
ENGLISH
Let m = “Ali is good in
Mathematics”
c = “Ali is a Computer
Science student”
Translate the following statement
forms into plain English:
1. ~ c
Ali is not a Computer Science
student.
2. c m
Ali is a Computer Science student
or good in Maths.
3. m ~ c
Ali is good in Maths but not a
Computer Science student. 33
TRUTH TABLE
34
NEGATION (~)
If p is a statement variable, then
negation of p, “not p”, is denoted
as “~p”. It has opposite truth value
from p i.e., if p is true, ~p is false;
if p is false, ~p is true.
EXAMPLES
1. “Ali is not a Computer Science
student” then its negation is “Ali is
a computer Science student”
2. “I like my course of Discrete
mathematics ”then its negation is
“I don't like my DM course”
3. “2 + 3 is equal to 5” then its
negation is “2 + 3 is not equal to
35
5”
TRUTH TABLE FOR
~p
p ~p
T F
F T
36
CONJUNCTION ()
If p and q are statements, then the
conjunction of p and q is “p and q”,
denoted as “p q”.
It is true when, and only when, both p
and q are true. If either p or q is false,
or if both are false, pq is false.
p q pq
T T T
T F F
F T F
F F F
37
DISJUNCTION () or INCLUSIVE OR
38
Disjunction or Inclusive Or
p q pq
T T T
T F T
F T T
F F F
39
SUMMARY
1. What is a statement?
2. How a compound statement is
formed.
3. Logical connectives (negation,
conjunction, disjunction).
4. How to construct a truth table
for a statement form.
40