0% found this document useful (0 votes)
55 views56 pages

Chapter 1 (Part 2) - Stud

This document provides an introduction to logic including predicates, quantifiers, propositional equivalences, and truth tables. It defines predicates as statements involving variables that are either true or false based on the values assigned to the variables. Predicates are used to define sets and quantify statements. There are two types of quantifiers - universal and existential. The universal quantifier asserts a statement is true for all variables, while the existential quantifier asserts a statement is true for at least one variable. Propositional equivalences such as tautologies, contradictions, and contingencies are defined based on whether a compound proposition is always true, always false, or can be both true and false depending on the variable values

Uploaded by

Heng YiJun
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)
55 views56 pages

Chapter 1 (Part 2) - Stud

This document provides an introduction to logic including predicates, quantifiers, propositional equivalences, and truth tables. It defines predicates as statements involving variables that are either true or false based on the values assigned to the variables. Predicates are used to define sets and quantify statements. There are two types of quantifiers - universal and existential. The universal quantifier asserts a statement is true for all variables, while the existential quantifier asserts a statement is true for at least one variable. Propositional equivalences such as tautologies, contradictions, and contingencies are defined based on whether a compound proposition is always true, always false, or can be both true and false depending on the variable values

Uploaded by

Heng YiJun
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/ 56

Introduction to Logic

1
 Differentiate and write the Predicates and
Quantifiers .
 Write Proposition Equivalences; Truth tables;
Implication and equivalence; Tautology;
Contradiction and Contigency;
 Write the Negation Quantifiers Expressions and
determine its truth values

DSP5221
2
 A compound proposition may have many
component parts, each of which is itself a
proposition, represented by some propositional
variable.
 The proposition s: p⋁ (q ⋀ r) involves three
propositions, p,q and r.
 If a compound statement s contains n proposition
variables, there will need to be 2n rows in the truth
table for s.
DSP5221
3
 s: p⋁ (q ⋀ r)
 3 variables, therefore need 23 = 8 rows

p q r q ⋀r p⋁ (q ⋀ r)
T T T T T
T T F F T
T F T F T
T F F F T
F T T T T
F T F F F
F F T F F
F F F F F
DSP5221
4
Make a truth table for the proposition
(p⋀ q)⋁ (~p)
Answer:

DSP5221
5
Propositional Equivalences
 Propositional Equivalence consist of three
types;
Tautology

Contradiction

Contingency

DSP5221
6
 A tautology occurs when a compound proposition that
is true for all possible values of its proposition
variables.

Example:
(p  q )  p

DSP5221
7
 (p  q )  p

p q pq (p  q )  p
T T T T
T F F T
F T F T
F F F T

DSP5221
8
 A contradiction occurs when a compound
proposition is always false.

Example:
((p  q)q)p

DSP5221
9
 ((p  q)q)p

p q pq (p  q)q ((p  q)q)p


T T F F F
T F T F F
F T T T F
F F F F F

DSP5221
10
 A contingency occurs when a compound
proposition is neither a Tautology nor a
Contradiction (consists both true and false value
for different combination of propositions that
involve)
 Example

(( p  q )  q )  p
DSP5221
11
(( p  q )  q )  p
p q pq (pq)q ((pq)q)p

T T T T T
T F F F T
F T T T F
F F T F T
DSP5221
12
 State whether the proposition below is
tautology, contradiction or contingency.

( p  q )  ( p  q )

DSP5221
13
( p  q )  ( p  q )
p q

DSP5221
14
Logical Equivalence
 Two different compound propositions are
logically equivalent if they have the same truth-
values no matter what truth-values their
constituent propositions have.
 The notation p  q denotes that p and q are
logically equivalent if p ↔ q is tautology.

DSP5221
15
 Example
Prove or disprove that (q  ( p  qand
))
(p  ( p  q))
is a logical equivalence.

It is not a logical equivalence


DSP5221
16
 The operations for propositions have the
following properties.
Commutative Properties
1. p ⋁ q ≡ q ⋁ p
2. p ⋀ q ≡ q ⋀ p
Associative Properties
3. p ⋁ ( q ⋁ r)≡ (p ⋁ q) ⋁ r
4. p ⋀ ( q ⋀ r)≡ (p ⋀ q) ⋀ r
Distributive Properties
5. p ⋁ ( q ⋀ r)≡ (p ⋁ q)⋀ (p ⋁ r)
6. p ⋀ ( q ⋁ r)≡ (p ⋀ q) ⋁(p⋀ r)
DSP5221
17
Idempotent Properties
7. p ⋁ p ≡ p
8. p ⋀ p ≡ p

Properties of Negation (important)


9. ~(~p) ≡ p
10. ~(p ⋁ q) ≡ (~ p) ⋀ (~q) De Morgan’s Laws
11. ~(p ⋀ q) ≡ (~ p) ⋁ (~q)

DSP5221
18
 The implication operation also has a number of
important properties.
Properties for implication operation
1. p → q ≡ ( (~ p) ⋁ q )
2. p → q ≡ (~ q → ~p )
3. (p ↔q) ≡ ((p → q) ⋀ (q →p))
4. ~ (p → q) ≡ (p ⋀~q )
4. ~ (p ↔q) ≡ ((p ⋀~q ) ⋁ (q ⋀~p))

DSP5221
19
 Exercise:
1. Show the following De morgan’s Law for Logic
are logically equivalence.
( p  q)  p  q ( p  q)  p  q

2. Prove the conditional (or implication) proposition


p→ q and its contrapositive are


logically equivalence. q  p

DSP5221
20
Predicates and Quantifiers
 Predicate and quantifiers are usually used when
involved in mathematical equation in computer
programs such as “x> 3,” “x=y+3” and “x +
y=z”.
 This is usually involved one variable (or more
variables).
 These statements are either true or false as it
depends on the values of variables.

DSP5221
21
 An element of {x | P(x)} is an object t for which
the statement P(t) is true.
 Such a sentence P(x) is called a predicate.
 P(x) is also called a propositional function
because each choice of x produces a proposition
P(x) that is either true or false.

DSP5221
22
 Let A = {x | x is an integer less than 8}.
 P(x) is the sentence “ x is an integer less than 8”
 The common property is “is an integer less than 8”
 x =1, P(1) is the statement “1 is an integer less than
8”which is true.

DSP5221
23
A. Single Variable
Let P(m) denote the statement “(m + 80 * m) / m =
81”. What are the truth values of P(8) and P(6)?

Solution:
 P(8), replace m with 8 in the “(8 + 80 * 8) / 8 = 81”
statement.  TRUE
 P(6), replace m with 6 in the “(6 + 80 * 6) / 6 = 81”
statement.  TRUE

DSP5221
24
B. Multiple Variables
Let Q(x,y) denote the statement “ x = y + 8”
What are the truth values of the propositions
Q(15,7) and Q(20,8)?

DSP5221
25
DSP5221
26
C. ‘n’ variables
Let R(x,y,z) denote the statement “(y + 2) - (x *
6) = z” what are the truth values of the
propositions R(1,2,3) and R(5,32,4).

DSP5221
27
DSP5221
28
 When all variables assigned with values, the
resulting statement becomes a proposition with
certain truth-value.

 But there is another way to make the statement


becomes proposition with certain truth-value,
called Quantification.

DSP5221
29
There are two types of quantifiers;
A. Universal Quantifier
B. Existential Quantifier

DSP5221
30
 A logical quantifier(operator containing a variable)
of a proposition that asserts that the proposition is true
for every element in a domain of discourse or of a
type.

 The universal quantification of P (x) is the proposition

“P (x) is true for all values of x in the universe of discourse”

DSP5221
31
 The notation xP(x) denotes the universal
quantification of P (x).
-Called universal quantifier

 The proposition xP(x) is read as


 “for all x, P(x)”
 “for every x, P(x)”

 “for any x, P(x)”

DSP5221
32
Example 1:
Let P(x) be the statement “x likes Discrete
Structure” where the universe of discourse
consists of a set of students. Write x P(x) in
words: 

Answer:
All students like Discrete Structure

DSP5221
33
Example 2:
Let P(x) be the statement “x2+1>x.” What is the
truth value of the quantification x P(x), where
the universe of discourse consists of all positive
integers

Answer
Since P(x) is true for all positive integers x, the
quantification x P(x) is TRUE.

DSP5221
34
 A logical quantifier of a proposition that asserts the
existence of at least one thing for which the proposition
is true

 The existential quantification of P (x) is the proposition


where there exist an element x in the universe of
discourse such that P (x) is true”

DSP5221
35
 We use the notation xP(x) for the existential
qualification of P(x).
 is called existential quantifier.

 The existence quantification xP(x) is read as


 “There is an x such that P (x)”
 “There is at least one x such that P (x)

 “For some x, P(x)”

DSP5221
36
Example 1:
Let P(y) be the statement “y likes Discrete
Structure” where the universe of discourse
consists of a set of students. Write y P(y) in
words: 

Answer
Some students like Discrete Structure
Or
Not all Students like Discrete Structure

DSP5221
37
Example 2:
Let P(x) be the statement “x > 5 .” What is the
truth value of the quantification x P(x),
where the universe of discourse consists of a
set of positive integers

Answer
Since P(6) is true, the quantification x P(x) is
TRUE.

DSP5221
38
Quantifiers
Statement When True? When False?

x P(x) P(x) true for every x There is an x for


(Conjunction) (All x must be true) which P(x) is false
(At least one x is
false)
xP(x) There is an x for P(x) false for every x
(Disjunction) which P(x) is true (All x must be false)
(At least one x is
true)

DSP5221
39
 Let P(x) be “x has taken a course in Program
Design” and the domain of discourse consist of
the students in the class. Write the universal
quantifiers and existential quantifiers for the P(x).
What is the truth value of the statement for
Universal Quantifier and Existential Quantifier in
your class?

DSP5221
40
 x P(x) = All student in the class has taken a
course in Program Design, FALSE/ TRUE
 xP(x) = Some students in the class has taken a
course in Program Design, TRUE

DSP5221
41
Negation Quantifiers Expressions
 Sometimes we need to negate a quantified
expression. Let us look at the effect of negation
to the Universal and Existential Quantifiers.

42
Example:
“Every student in the class wear black colour T-Shirt ”
 This statement is a universal quantification,
named with x P(x), where P(x)- “ x wear
black colour T-Shirt ”
Question:
 What is the negation quantifier expression?

43
Solution:
Negation to the Universal Quantification:

(x P(x)) =  x  P (x)

“It is not the case that every student in the class


wears black colour T-Shirt ”
OR
“There is a student in the class who is not
wearing a black colour T-Shirt ”
44
Example:
“At least one student in Discrete Structures class has
taken Mathematical Techniques 1”

 This statement is an existential quantification,


named with  x P (x) where P(x)- “x has taken
Mathematical Techniques 1”

Question:
 What is the negation quantifier expression?

45
Solution:
Negation to the Existential Quantification:

 ( x P(x)) = x  P(x)
“Every student in Discrete Structures class has
not taken Mathematical Techniques 1”
OR
“All student in Discrete Structures class has not
taken Mathematical Techniques 1”.

46
• The rules for negations for quantifiers are called De
Morgan’s Law for Quantifiers.

Negation Equivalent When is When False?


Statement Negation
True?
¬(x P(x)) x ¬P(x) For every x, There is an x
P(x) is false. for which
P(x) is true
¬(x P(x)) x ¬P(x) There is an x P(x) is true
for which for every x
P(x) is false

47
Counterexample
 To conclude that a statement of the form x P(x) is
false, where P(x) is a propositional function, we
need only to find a value of x in the universe of
discourse for which P(x) is false.
 Such a value of x is called the counterexample to
the statement x P(x).
 For example, the prime number 2 is a
counterexample to the statement "All prime
numbers are odd."
48
 Let q(x) denotes “x2 ≤ 10”. What are the truth
values of the quantifications x q(x) and x q(x),
where the domain of discourse consists of 0, 1, 2,
3 and 4?

49
 When the domain of discourse is {0, 1, 2, 3, 4}, a
counterexample to the statement x (x2 ≤ 10) is
4, since 42 = 16 is not ≤ 10.
 Hence the statement x (x2 ≤ 10) is false.
 But the statement x q(x), is true.

50
 Propositional Equivalence consist of three types;
 Tautology

 Contradiction

 Contingency

 Predicates - involved one variable (or more variables)


 Quantifiers (Universal Quantifier , Existential
Quantifier)
 Negations Quantifiers Expressions

DSP5221
51
Review Questions
1. Build a truth table to verify that the proposition
( p  q )  (  p  q ) is a contradiction.
2. Show that ( p  q )  ( q  p ) is logically
equivalent to p q
3. Let P(x) denote the statement “x + 1 > 7”. What are
the truth values for these propositions?
 P(1)
 P(8)
 P(6)

DSP5221
52
Review Questions
4. Let P(n) be the propositional function “n < 66”. Write each
proposition below in words and tell whether it’s true or false. The
domain of discourse is a set of positive integers. 
 n P(n) 

 n P(n)

5. Let P(x) denote the statement “x spends more than 3 hours


every weekend in the library”, where the universe of discourse
for x consists of all students. Write each propositions below in
words: 
 x P(x) 
 x P(x) 
DSP5221
53
Review Questions
6. Let P(m) denote the statement “m is taking an IT course”,
where the universe of discourse for m is a set of students.
Translate each of these statements into logical expression using
predicates and quantifiers.

 Some students are taking an IT course.


 All students are taking an IT course. 

DSP5221
54
Review Questions

7. Let P(x) denote the statement “x spends more than 3 hours


every weekend in the library”, where the universe of
discourse for x consists of all students. Write each
propositions below in words: 
◦ x  P(x)
◦ x  P(x)

8. Let P(m) denote the statement “m is taking an IT course”,


where the universe of discourse for m is a set of students.
Translate each of these statements into logical expression
using predicates and quantifiers.
◦ All students are not taking an IT course.
◦ There is a student who is not taking an IT course.

55
Review Questions
9. Let P(y) be the propositional function y+1 > y. The domain of discourse is
the set = {y | 0 < y < 5}
Write each proposition below in words and tell whether each proposition
below is true or false.

(a) y P(y)
(b) y P(y)
(c)  (yP(y))
(d)  (y P(y))

56

You might also like