Week 1a
Week 1a
Discrete Structures
CS2053
Course Instructor
Prof. Dr. Samina Rashid
Department of Mathematics,
2nd Floor E-Block, Phone: 111 87 87 87 ext. 291
E-mail: samina.batul@cust.edu.pk
Class Schedule
Monday : 04:20 – 05:10
Friday: 09:00 – 10:50
1
9/24/2024
2
9/24/2024
Course Objectives
This course will lay the foundations for theoretical computer science.
Basic mathematical concepts generally required for most computer
science courses will be covered in the course.
The course aims at developing precise and formal reasoning skills in
students.
Different ways of mathematical thinking will be explored i.e., Logical
thinking, Relational thinking, Recursive thinking, Quantitative thinking,
and Analytical thinking.
3
9/24/2024
Evaluation Method
Assignments (Quiz)
1. 20%
2. Quiz 20%
3. Midterm Exam 20%
4. Final Exams 40%
5. There will be NO makeup Quiz or Assignment Quiz
4
9/24/2024
5
9/24/2024
Propositions (Statements)
A proposition is a declarative sentence (that is, a sentence that declares a
fact) that is either true or false, but not both.
Example: All the following declarative sentences are propositions
Islamabad, is the capital of the United States of America.
1+1 = 2
2 + 3 = 15.
𝑥 = 4; we have 𝑥 + 8 = 12
6
9/24/2024
Which of these are propositions? What are the truth values of those that
are propositions?
a) Do not pass go.
b) What time is it?
c) There are no black flies in Maine.
d) 4 + 𝑥 = 5.
e) The moon is made of green cheese.
f) 2𝑛 ≥ 100.
Compound Propositions
Many mathematical statements are constructed by combining one or
more propositions. New propositions, called compound propositions, are
formed from existing propositions using logical operators.
Logical operators also known as Logical Connectives.
Connectives Meaning Symbol
Negation Not ¬ or ~
Conjunction AND ∧
Disjunction OR ∨
Conditional if … then … → or ⇒
Biconditional if and only if ↔ or ⇔
| DS - Logic and Proofs 14
7
9/24/2024
Negation or
Example (C.W)
Display the truth table for the negation of a proposition 𝑝.
Conjunction (AND )
8
9/24/2024
Disjunction (OR )
Example 1
(Q10) Let p = “The election is decide” and q = “The votes have been counted”.
Express each of the following compound propositions as an English sentence.
a) ~𝑝 b) 𝑝 ∨ 𝑞 c) 𝑝 ∧ 𝑞 d) ~𝑝 ∧ ~𝑞 e) ~𝑝 ∧ 𝑞.
Ans. (CW)
(Q11) Let 𝑝 and 𝑞 be the propositions
𝑝 : It is below freezing.
𝑞 : It is snowing.
Write these propositions using 𝑝 and 𝑞 and logical connectives (including negations).
a) It is below freezing and snowing.
𝑝 ∧ 𝑞, 𝑝 ∧ ~𝑞, ~𝑝 ∧ ~𝑞, 𝑝 ∨ 𝑞, ~𝑝 ∨ ~𝑞
b) It is below freezing but not snowing.
c) It is not below freezing and it is not snowing.
d) It is either snowing or below freezing (or both).
e) It is either not below freezing or not snowing.
9
9/24/2024
Exclusive OR ( xor )
Sometimes, we use or in an exclusive sense.
When the exclusive or is used to connect the propositions 𝑝 and 𝑞, the
proposition “𝑝 or 𝑞 (but not both)” is obtained.
This proposition is true when 𝑝 is true and 𝑞 is false, and when 𝑝 is false and 𝑞
is true. It is false when both 𝑝 and 𝑞 are false and when both are true.
For example, the coin toss result is either head or tail, the grade is either pass of fail.
Construct the truth table of 𝑝 ⊕ 𝑞. (CW)
Note that the statement 𝑝 → 𝑞 is true when both 𝑝 and 𝑞 are true and when 𝑝 is false
(no matter what truth value 𝑞 has).
For example, if your cumulative score is at least 86% then you will get an 𝐴 in this
course.
Here 𝑝 = Cumulative score ≥ 86% and 𝑞 = Grade is 𝐴.
Construct the truth table of 𝑝 → 𝑞.
10
9/24/2024
“if p, then q”
“p implies q”
“if p, q”
“p only if q”
“p is sufficient for q”
“a sufficient condition for q is p”
“q if p”
“q whenever p”
“q when p”
“q is necessary for p”
“a necessary condition for p is q”
“q follows from p”
“q unless ~𝑝”
Example 2
Let 𝑝 be the statement “Maria learns discrete mathematics” and 𝒒 the
statement “Maria will find a good job.” Express the statement 𝑝 → 𝑞 as
a statement in English.
Solution:
“If Maria learns discrete mathematics, then she will find a good job.”
Some other ways to express this conditional statement in English are:
“Maria will find a good job when she learns discrete mathematics.”
“For Maria to get a good job, it is sufficient for her to learn discrete
mathematics.” and
“Maria will find a good job unless she does not learn discrete
mathematics.”
| DS - Logic and Proofs 22
11
9/24/2024
12