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

Lecture 01

Uploaded by

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

Lecture 01

Uploaded by

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

Discrete Mathematics

(CSC 0611101)

Chapter 1
1.1 Propositional Logic

Md. Morshed Ali


Lecturer
Uttara University
1
Key Terms
 Proposition: A proposition is a declarative statement
that’s either TRUE or FALSE, but not both.

• Statements that are not propositions include


– questions
– commands

2
Reasoning is the

Key Terms process of using


existing knowledge
to draw conclusions

 Logic: Logic is the discipline that deals with the


methods of reasoning.
– Logic is the basis of all mathematical reasoning
– The rules of logic specify the meaning of
mathematical statements

 Propositional Logic: The area of logic that deals with


propositions is called the propositional logic.

3
Key Terms
 Propositional variable: A variable that represents a
proposition. The conventional letters used for propositional
variables are p, q, r, s, t,..
 Compound proposition: A proposition constructed by
combining two or more propositions using logical
operators(AKA : logical connectives)
 Logical Operators: Operators used to combine propositions
 Truth Value: The truth value of a proposition is true, denoted
by T, if it is a true statement and false, denoted by F, if it is a
false statement. Truth Value ==> True/False
 Truth Table: A table displaying the truth values of
propositions.
4
Proposition: Examples

Proposition Not Proposition

3 + 2 = 32 Bring me coffee!

3+2=5 3+2

Every cow has four legs Do you like Cake?

5
Proposition: More Examples
 Which of the following are propositions? What are the truth values of
those that are propositions?
a. Read this carefully.
b. 2 + 2 = 4.
c. Comilla is the capital of Bangladesh.
d. What time is it?

6
Solution
Solution.
a. Not a proposition.
b. A proposition with truth value (T).
c. A proposition with truth value (F).
d. Not a proposition.

7
Proposition: More Examples
• Which of the following are propositions? What are
the truth values of those that are propositions?
a) 5 + 7 = 17
b) Answer the question
c) x + 2 = 13
d) x + y = z
e) UU is the best Private university in Bangladesh

8
Logical operators
• Logical operators ==> unary, binary
• Unary:
– Negation
• Binary
– Conjunction
– Disjunction
– Exclusive OR
– Implication
– Biconditional

9
Logical Operators
Operator Symbol Usage
Negation  NOT
Conjunction  AND
Disjunction  OR
Exclusive or  XOR
Conditional  if, then
Biconditional  iff

10
Propositional Logic -
Negation
• Let p be a proposition. The negation of p, denoted by
p (orp), is the statement “It is not the case that p.”
• The proposition p is read “not p”
• The truth value of the negation of p, p, is the
opposite of the truth value of p.

11
Propositional Logic -
Negation
• Negation just turns a false proposition to true and the
opposite for a true proposition.

• Example1: P: I am going to town


 P: I am not going to town; or,
It is not the case that I am going to town
• Example2: p : “ 23 = 15 +7”
p happens to be false, so  p is true.

12
Truth table for Negation

13
Negation: More Example
• Example: Find the negation of the proposition
“Today is Friday.”

• Solution: The negation is


“It is not the case that today is Friday”, or
“Today is not Friday” , or
“It is not Friday today.”

14
Conjunction
• 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 both p and q are
true and is false otherwise.
• Conjunction corresponds to English “and.”

• Example: Liana is curious AND clever.

15
Truth Table for Conjunction

16
Conjunction: Example
• Example: P:‘I am going to town’
Q: ‘It is going to rain’

P  Q: ‘I am going to town and it is going to rain.’

Note: Both P and Q must be true!!!!!

17
Conjunction: Example
p = “Clinton was the president.”
q = “Monica was the president.”
r = “The meaning of is important.”
• Assuming p and r are true, while q false.
Out of pq, pr, qr , only p  r is true.
Q: what is the value of pqr?

18
Conjunction
• Conjunction is a binary operator in that it
operates on two propositions when creating
compound proposition. On the other hand,
negation is a unary operator.

19
Disjunction
• 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.
• Disjunction is true when at least one of the
components is true.
• Disjunction corresponds to English “or.”
– Ex. Michael is brave OR intelligent

20
Truth Table for Disjunction

21
Examples of Conjunction & Disjunction
Let,
p:5<9
q : 9 < 7.
Construct the propositions pq and p ν q.

Solution:
 The conjunction of the propositions p and q is the proposition
pq : 5 < 9 and 9 < 7
 The disjunction of the propositions p and q is the proposition
p v q : 5 < 9 or 9 < 7

 Q: What are the truth values of p  q and p v q?

22
Example 5 & 6(Page 4 & 5): Examples of
Conjunction & Disjunction
Consider the following propositions:
p : It is Friday
q : It is raining.
Construct the propositions p ^ q and p ν q.

Solution:
The conjunction of the propositions p and q is the proposition
p  q : It is Friday and it is raining.
The disjunction of the propositions p and q is the proposition
p v q : It is Friday or It is raining.

23
Exclusive Or
• Let p and q be propositions.
• The exclusive or of p and q, denoted by p  q,
is the proposition that is true when exactly
one of p and q is true and is false otherwise.

24
Truth Table of Exclusive Or

25
Example of Exclusive Or
• Construct a truth table for (p  q)  r.
Solution:

26
Conditional Statements
• 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 true otherwise.
• In the conditional statement p  q, p is called hypothesis and
q is called conclusion.
• This one is the English usage of “if, then” or “implies”.
• The connective  is called the ‘conditional connective’.
• A conditional statement is also called an implication.

27
Truth Table for Conditional Statement

28
Conditional Statements
• In terms of words, the proposition p  q
also reads:
(a) if p, then q
(b) p implies q
(c) p is a sufficient condition for q
(d) q is a necessary condition for p
(e) p only if q

29
Example1 of Conditional Statement
p = “Cruise ships only go on big rivers.”
q = “Cruise ships go on the Hudson.”
r = “The Hudson is a big river.”
 r = “The Hudson is not a big river.”

• p  q = “Cruise ships only go on big rivers and go on the


Hudson.”

• ( p  q) r = “If cruise ships only go on big rivers and go on


the Hudson, then the Hudson is a big river.”

30
Example2 of Conditional Statement
• Let p : "Maria learns discrete mathematics" and
q : "Maria will find a good job."
Express the statement p  q as a statement in English.
Solution:
"If Maria learns discrete mathematics, then she will find a good job.“
• There are many other ways to express this conditional statement in
English.
– "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.“
– "Maria will find a good job unless she does not learn discrete
mathematics.”

31
Converse, Contrapositive, and Inverse
 We can form some new conditional statements starting with
a conditional statement p  q

• The proposition q  p is called the Converse of p  q


• The Contrapositive of p  q is the proposition  q   p
• The proposition  p   q is called the Inverse of p  q
• Two compound propositions are equivalent if they always
have the same truth value

32
Examples of Converse, Contrapositive and Inverse

 Converses: p  q ==> q  p
• Ex: “If it is noon, then I am hungry.”
“If I am hungry, then it is noon.”
 Contrapositives: p  q ==> q  p
• Ex: “If it is noon, then I am hungry.”
“If I am not hungry, then it is not noon.”
 Inverses: p  q ==> p  q
• Ex: “If it is noon, then I am hungry.”
“If it is not noon, then I am not hungry.”

33
Bi-Conditional
• Let p and q be propositions.
• The biconditional statement p  q is the proposition “p if and
only if q.”
• The biconditional statement p  q is true when p and q
have the same truth values, and is false otherwise.
• Biconditional statements are also called “bi-implications”
• Question : Which operator is the opposite of ?
• Answer:  has exactly the opposite truth table as .

34
Truth Table for Biconditional p  q

Note that p ↔ q has exactly the same truth value as (p → q) ∧ (q → p).

35
Example
• Show that the bi-conditional proposition of p and q is
logically equivalent to the conjunction of the conditional
propositions p  q and q  p:
• Solution

36
Example of Biconditional statement
• Example 10 ( Page 9): Let p be the statement “ You
can take the flight” and q be the statement “ You buy
a ticket”.
What is the statement for p  q ?

 Solution:
“You can take the flight if and only if you buy a ticket”

37
Truth Tables of Compound Propositions

• We can use logical connectives/operators to build up


complicated compound propositions involving any
number of propositional variables.
• We can use truth tables to determine the truth
values of these compound propositions.

• Example 11 (p. 10): Construct the truth table of the


compound proposition (p v q)  (p  q)

38
Truth Tables of Compound Propositions

39
A Demonstration That p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨
r) Are Logically Equivalent.

40
Precedence of Logical Operators
• Negation operator is applied before all other logical
operators
• Conjunction operator takes precedence over
disjunction operator
• Conditional and biconditional operators have lower
precedence
• Parentheses are used whenever necessary

41
Precedence of Logical Operators

42
Logic and Bit Operations
• bit ==> binary digit
• Boolean variable: either true or false
– Can be represented by a bit
• Bit String: A bit string is a sequence of zero or more
bits. The length of the string is the number of bits in
the string.
• Example 20(p.15): 101010011 is a bit string of length
nine

43
Bit operations
• Computer bit operations correspond to the logical
connectives. By replacing true by a one and false by
a zero in the truth tables for the operators ∧, ∨, and
⊕, the tables shown in Table 9 for the corresponding
bit operations are obtained. We will also use the
notation OR, AND, and XOR for the operators ∨,∧,
and ⊕ respectively, as is done in various
programming languages.

44
Table for Bit Operations

45
Bit string and bit operation

46

You might also like