0% found this document useful (0 votes)
30 views

DS-Lecture 01

The document provides an introduction and overview of a discrete structures course. It discusses the instructor, expected learning outcomes, topics to be covered including logic, number theory, sets, relations, graphs and trees. It also outlines reference books and introduces key concepts like propositions, logical connectives, truth tables, and translating statements between natural language and logical notation. Discrete mathematics deals with discrete rather than continuous objects and is the study of mathematical structures that are fundamentally discrete.

Uploaded by

Kumail Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

DS-Lecture 01

The document provides an introduction and overview of a discrete structures course. It discusses the instructor, expected learning outcomes, topics to be covered including logic, number theory, sets, relations, graphs and trees. It also outlines reference books and introduces key concepts like propositions, logical connectives, truth tables, and translating statements between natural language and logical notation. Discrete mathematics deals with discrete rather than continuous objects and is the study of mathematical structures that are fundamentally discrete.

Uploaded by

Kumail Abbas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

Discrete Structures

(CS-104)
Lecture 01
WELCOME TO CS-104

• About me: Dr. Gul Safi?

• Dr. Gul, doing research in Information Security, Deep Learning and VANETs……… Mostly all
kinds of algorithms.
• What you can expect from me:

• Helpful, encouraging; inspiring and enjoying class.

• Good grades, if u really work hard.


• What I expect from you:
• Turn in all homework and participate in classes.
• You will learn some critical techniques from this course.
On This Course
• Instructor: Dr. Qamas Gul Khan Safi

Email: [email protected]

• Office Hours: Monday and Thursday (09:00 to 10:00 am)

• Course Webpage: Microsoft teams


• check this regularly for important announcement related to this course

• Lecture notes and additional readings


Discrete vs Continuous
• Examples of discrete Data

– Number of boys in the class.


– Number of candies in a packet.
– Number of suitcases lost by an airline.

• Examples of continuous Data


– Height of a person.
– Time in a race.
– Distance traveled by a car.
What is discrete Structures?
• How do we use discrete?
• The term discrete means distinct or separate. The discrete data
contain the values that fall under integers or whole numbers. The total
number of students in a class is an example of discrete data. These
data can't be broken into decimal or fraction values.

• Discrete mathematics is the part of mathematics devoted


to the study of discrete objects (Kenneth H. Rosen, 6th
edition).
• Discrete mathematics is the study of mathematical
structures that are fundamentally discrete rather
than continuous (Wikipedia).
Applications of discrete mathematics
• How can a circuit that adds two integers be designed?
• How many ways are there to choose a valid password on a
computer?
• What is the shortest path between two cities using
transportation system?
• How can I encrypt a message so that no unintended recipient
can read it?
• How many valid internet addresses are there?
• How can a list of integers be sorted so that the integers are in
increasing order?
Syllabus (Topics to be covered in this course)

• Logic
• Elementary Number Theory and Methods of Proof
• Set Theory
• Relations
• Sequences and Recursion
• Mathematical Induction
• Counting
• Relations and Equivalence Relations
• Graphs
• Trees
Reference Books

• Discrete Mathematics and its Applications (with Combinatorics


and Graph Theory) ,6th Edition, The McGraw-Hill Companies, 2007,

Kenneth H. Rosen.

• Discrete Mathematics with Applications, 2nd Edition,


Thomson Learning, 1995, Susanna S. Epp.

• Discrete Mathematics for Computer Scientists, 2nd Edition,


Addison-Wesley, 1999, John Truss.
Logic
• Propositional Logic
• Logic of Compound Statements
• Propositional Equivalences
• Conditional Statements
• Logical Equivalences
• Valid and Invalid Arguments
• Applications: Digital Logic Circuits
• Predicates and Quantifiers
• Logic of Quantified Statements
Propositional Logic
Proposition: A proposition (or Statement) is a declarative
sentence (that is, a sentence that declares a
fact) that is either true or false, but not both.

Examples
1. Is the following sentence a proposition? If it is a proposition,
determine whether it is true or false.
Paris is the capital of France.
This makes a declarative statement, and hence is a
proposition. The proposition is TRUE (T).
Examples (Propositions Cont.)

5. Is the following sentence a proposition? If it is a


proposition, determine whether it is true or false.

He is a college student.

Because truth or falsity of this proposition depend


on the reference for the pronoun he. it is not a
proposition.
Notations

• The small letters are commonly used to denote the


propositional variables, that is, variables that
represent propositions, such as, p, q, r, s, ….

• The truth value of a proposition is true, denoted by T


or 1, if it is a true proposition and false, denoted by F
or 0, if it is a false proposition.
Compound Propositions
Producing new propositions from existing propositions.

Logical Operators or Connectives

1. Not 
2. And ˄
3. Or ˅
4. Exclusive or 
5. Implication 
6. Biconditional 
Examples
1. Find the negation of the following proposition

p : Today is Friday.
The negation is
 p : It is not the case that today is Friday.

This negation can be more simply expressed by

 p : Today is not Friday.


Notations

• The small letters are commonly used to denote the


propositional variables, that is, variables that
represent propositions, such as, p, q, r, s, ….

• The truth value of a proposition is true, denoted by T


or 1, if it is a true proposition and false, denoted by F
or 0, if it is a false proposition.
Compound Propositions
Producing new propositions from existing propositions.

Logical Operators or Connectives

1. Not 
2. And ˄
3. Or ˅
4. Exclusive or 
5. Implication 
6. Biconditional 
Examples

1. Find the conjunction of the propositions p and q, where

p : Today is Friday.
q : It is raining today.
The conjunction is

p˄q : Today is Friday and it is raining today.


Examples

2. Write the negation of

“6 is negative”.
The negation is

“It is not the case that 6 is negative”.


or “6 is nonnegative”.
Truth Table (NOT)

• Unary Operator, Symbol: 

p p

true false

false true
Conjunction (AND)

Definition
Let p and q be propositions. The conjunction
of p and q, denoted by p˄q, is the proposition
“p and q”.
The conjunction p˄q is true when p and q are
both true and is false otherwise.
Examples

1. Find the conjunction of the propositions p and q, where

p : Today is Friday.
q : It is raining today.
The conjunction is

p˄q : Today is Friday and it is raining today.


Truth Table (AND)

• Binary Operator, Symbol: 

p q pq
true true true
true false false
false true false
false false false
Disjunction (OR)

Definition
Let p and q be propositions. The disjunction
of p and q, denoted by p˅q, is the proposition
“p or q”.
The disjunction p˅q is false when both p and
q are false and is true otherwise.
Examples

1. Find the disjunction of the propositions p and q,


where

p : Today is Friday.
q : It is raining today.
The disjunction is

p˅q : Today is Friday or it is raining today.


Truth Table (OR)

• Binary Operator, Symbol: 

p q pq
true true true
true false true
false true true
false false false
Exclusive OR (XOR)

Definition
Let p and q be propositions. The exclusive or
of p and q, denoted by pq, is the proposition
“pq”.
The exclusive or, p  q, is true when exactly
one of p and q is true and is false otherwise.
Examples

1. Find the exclusive or of the propositions p and q,


where

p : Atif will pass the course CSC102.


q : Atif will fail the course CSC102.
The exclusive or is

pq : Atif will pass or fail the course CSC102.


Truth Table (XOR)

• Binary Operator, Symbol: 


p q pq
true true false
true false true
false true true
false false false
Examples (OR vs XOR)

The following proposition uses the (English) connective


“or”. Determine from the context whether “or” is intended
to be used in the inclusive or exclusive sense.

1. “Nabeel has one or two brothers”.


A person cannot have both one and two brothers.
Therefore, “or” is used in the exclusive sense.
Examples (OR vs XOR)

2. To register for BSC you must have passed


the qualifying exam or be listed as a Math
major.

Presumably, if you have passed the qualifying exam and


are also listed as a Math major, you can still register for
BCS. Therefore, “or” is inclusive.
Composite Statements
Statements and operators can be combined in any
way to form new statements.

p q p q (p)(q)
true true false false false
true false false true true
false true true false true
false false true true true
Translating English to Logic

I did not buy a lottery ticket this week or I bought a


lottery ticket and won the million dollar on Friday.
Let p and q be two propositions
p: I bought a lottery ticket this week.
q: I won the million dollar on Friday.

In logic form
p(pq)
Lecture Summery

• Introduction to the Course


• Propositions
• Logical Connectives
• Truth Tables
• Compound propositions
• Translating English to logic and logic to English.
Conditional Statements
Implication
Definition: Let p and q be propositions. The conditional
statement p  q, is the proposition “If p, then
q”.
The conditional statement p  q is false when
p is true and q is false and is true otherwise.

where p is called hypothesis, antecedent or premise.


q is called conclusion or consequence
Implication (if - then)

• Binary Operator, Symbol: 


P Q PQ
true true true
true false false
false true true
false false true
Conditional Statements
Biconditional Statements
Definition: Let p and q be propositions. The
biconditional statement pq, is the
proposition “p if and only if q”.
The biconditional (bi-implication) statement p
 q is true when p and q have same truth
values and is false otherwise.
Exercises
Question 1
Given a set A = {x, y, z} and a set B = {1, 2, 3, 4}, what is the
value of | 2A  2B | ?

Answer
| 2A  2B | = | 2A |  | 2B | = 2|A|  2|B| = 816 = 128

52
Graph Theory
Euler Paths and Circuits

In order to minimize
cost to the city, how
should weekly garbage
collection routes be
designed for Detroit’s
350,000 households?
Tautologies and Contradictions
• Tautology is a statement that is always true regardless of the truth
values of the individual logical variables

• Examples:
• R(R)
• (PQ)  (P)(Q)

• If S  T is a tautology, we write S  T.
• If S  T is a tautology, we write S  T.
Tautologies and Contradictions
• A Contradiction is a statement that is always false regardless of
the truth values of the individual logical variables

Examples
• R(R)
• ((PQ)(P)(Q))
• The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.
Exercises
•We already know the following tautology:
•(PQ)  (P)(Q)
•Nice home exercise:
•Show that (PQ)  (P)(Q).
•These two tautologies are known as De Morgan’s laws.

51
Exercises
Question 1
Given a set A = {x, y, z} and a set B = {1, 2, 3, 4}, what is the
value of | 2A  2B | ?

Answer
| 2A  2B | = | 2A |  | 2B | = 2|A|  2|B| = 816 = 128

52
Graph Theory
Euler Paths and Circuits

In order to minimize
cost to the city, how
should weekly garbage
collection routes be
designed for Detroit’s
350,000 households?

You might also like