DS Lecture 1
DS Lecture 1
DS Lecture 1
Week-1
[email protected]
Discrete vs Continuous
• Examples of discrete Data
[email protected]
What is discrete Structures?
[email protected]
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? [email protected]
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
[email protected]
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.
[email protected]
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
[email protected]
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).
[email protected]
Examples (Propositions Cont.)
2. Is the following sentence a proposition? If it is a
proposition, determine whether it is true or false.
[email protected]
Examples (Propositions Cont.)
3. Is the following sentence a proposition? If it is a
proposition, determine whether it is true or false.
[email protected]
Examples (Propositions Cont.)
4. Is the following sentence a proposition? If it is a
proposition, determine whether it is true or false.
x+ 4 > 9.
[email protected]
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.
[email protected]
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
[email protected]
Compound Propositions
Negation of a proposition
Let p be a proposition. The negation of p, denoted by
p (also denoted by ~p), is the statement
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
[email protected]
Examples
“6 is negative”.
The negation is
true false
false true
[email protected]
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.
[email protected]
Examples
1. Find the conjunction of the propositions p and q, where
p : Today is Friday.
q : It is raining today.
The conjunction is
[email protected]
Truth Table (AND)
• Binary Operator, Symbol:
p q pq
true true true
true false false
false true false
false false false
[email protected]
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.
[email protected]
Examples
p : Today is Friday.
q : It is raining today.
The disjunction is
Definition
Let p and q be propositions. The exclusive or
of p and q, denoted by pq, is the proposition
“pq”.
The exclusive or, p q, is true when exactly
one of p and q is true and is false otherwise.
[email protected]
Examples
1. Find the exclusive or of the propositions p and q,
where
[email protected]
Examples (OR vs XOR)
[email protected]
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)
[email protected]
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.
[email protected]
Conditional Statements
Biconditional Statements
Definition: Let p and q be propositions. The
biconditional statement pq, 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.
[email protected]
Biconditional (if and only if)
[email protected]
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
[email protected]
Equivalent Statements
P Q (PQ) (P)(Q) (PQ)(P)(Q)
• Examples:
• R(R)
• (PQ) (P)(Q)
• If S T is a tautology, we write S T.
• If S T is a tautology, we write S T.
[email protected]
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)
• ((PQ)(P)(Q))
• The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.
[email protected]
Exercises
•We already know the following tautology:
•(PQ) (P)(Q)
•Nice home exercise:
•Show that (PQ) (P)(Q).
•These two tautologies are known as De Morgan’s laws.
[email protected]
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| = 816 = 128
[email protected]
Lecture Summery
• Introduction to the Course
• Propositions
• Logical Connectives
• Truth Tables
• Compound propositions
• Translating English to logic and logic to English.
[email protected]
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?