You are on page 1of 103

MATH6184 – Discrete Mathematics and

Linear Algebra

Topic – 1
Logic and Quantifier
Learning Objectives

On successful completion of this Course, students will be able to:

LO1:
Explain basic concepts logic of
compound, quantified statements,
set theory and function, and
properties of relation related to
discrete problems.

2
Outline

• Logical Form and Logical Equivalence


1
• Conditional Statements
2
• Valid and Invalid Arguments
3
• Digital Logic Circuits
4
• Predicates and Quantified Statements I
1
• Predicates and Quantified Statements II
2
• Statements with Multiple Quantifiers
3
3
Logical Form And Logical
Equivalence

Logic Is A Science Of The Necessary Laws Of Thought, Without Which No


EmploymentOf The Understanding And The Reason Takes Place. —
Immanuel Kant, 1785
Statements

Definition
A statement (or proposition) is a sentence that is true or
false but not both.

Propositions Not Propositions


3 + 2 = 32 Bring me coffee!
5–2=3 x+y>0
Every cow has 4 legs. 3+2
There is other life in the Do you like Cake?
universe. 5
Negation

Definition
If p is a statement variable, the negation of p is "not
p" or "It is not the case that p" and is denoted ~p.

Truth Table for ~p

6
Conjunction

Definition
If p and q are statement variables, the conjunction of p
and q is "p and q" denoted p q.

It is true when, and only when,


both p and q are true. If either p or
q is false, or if both are false, p q
is false.

7
Disjunction

Definition
If p and q are statement variables, the disjunction of p and
q is "p or q," denoted p v q.

It is true when either p is true, or q


is true, or both p and q are true; it is
false only when both p and q are
false.

8
A Statement Form (Proposition)

Definition
A statement form (or propositional form) is an
expression made up of statement variables (such as p, q,
and r) and logical connectives (such as ~, , and v) that
becomes a statement when actual statements are
substituted for the component statement variables.

The truth table for a given statement form displays the


truth values that correspond to all possible combinations
of truth values for its component statement variables.

9
Truth Table for Exclusive Or

10
Logical Equivalence

Definition
Two statement forms are called
logically equivalent If and only if,
they have identical truth values for
each possible substitution of
statements for their statement
variables. The logical equivalence of
statement forms P and Q is denoted
by writing P  Q.

11
Example: De Morgan’s Laws

Statements of the form are logically equivalent.

Symbolically,

and
12
Showing Nonequivalence

The statement forms ∼(p ∧ q) and ∼p ∧ ∼q are not logically equivalent

13
Tautology and Contradiction

Definition
A tautology is a statement
form that is always true.
A statement whose form is
a tautology is a tautological
statement.

A contradiction is a statement form that is always false. A


statement whose form is a contradiction is a contradictory
statement.
14
Summary of Logical Equivalences

15
Simplifying Statement Forms
Example : Use Theorem 2.1.1 to verify the logical equivalence
∼(∼p ∧ q) ∧ (p ∨ q) ≡ p.
Solution:

16
Conditional Statements
…Hypothetical Reasoning Implies The Subordination Of The Real To The Realm Of The
Possible … —Jean Piaget, 1972
Conditional Statements (Implication)

Definition

If p and q are statement variables,


the conditional of q by p is
"If p then q" or "p implies q"
and is denoted
p→q
It is false when p is true and q is
false; otherwise it is true.
We call p the hypothesis (or antecedent) of the conditional
and q the conclusion (or consequent).

18
Example : Conditional Statements

A conditional statement that is true by virtue of the fact that its


hypothesis is false is often called vacuously true or true by default.

Example :
the statement
“If you show up for work Monday morning, then you will get the
job”

is vacuously true if you do not show up for work Monday morning.


In general, when the “if” part of an if-then statement is false, the
statement as a whole is said to be true, regardless of whether the
conclusion is true or false.
The Negation of a Conditional Statement

Example : Write negations for each of the following statements:


a. If my car is in the repair shop, then I cannot get to class.
b. If Sara lives in Athens, then she lives in Greece.

Solution :
a. My car is in the repair shop and I can get to class.
b. Sara lives in Athens and she does not live in Greece.
(Sara might live in Athens,Georgia; Athens, Ohio; or Athens, Wisconsin.)

20
The Contrapositive, Converse and
Inverse of a Conditional Statement

Definition
Suppose a conditional statement of the form
“If p then q” is given.
The contrapositive is “If ~q then ~p” or (~q → ~p)
The converse is “If q then p“ or (q → p)
The inverse is "If ~p then ~q" or (~p → ~q)

21
The Contrapositive, Converse and
Inverse of a Conditional Statement
Example :

Write each of the following statements in its equivalent


contrapositive , Convers and Inverse form:

a. If Howard can swim across


the lake, then Howard can
swim to the island.
b. If today is Easter, then
tomorrow is Monday.

This Photo by Unknown Author is licensed under CC BY


22
The Contrapositive, Converse and
Inverse of a Conditional Statement
Solution
a. Contrapositive : If Howard cannot swim to the island, then Howard
cannot swim across the lake.
Converse: If Howard can swim to the island, then Howard can swim
across the lake.
Inverse: If Howard cannot swim across the lake, then Howard cannot
swim to the island.
b. Contrapositive : If tomorrow is not Monday, then today is not Easter.
Converse: If tomorrow is Monday, then today is Easter.
Inverse: If today is not Easter, then tomorrow is not Monday

23
Biconditional (Biimplication)

Definition

Given statement variables p and q,


the biconditional of p and q is
"p if and only if q" and is denoted
p ↔ q.
It is true if both p and q have the
same truth values and is false if p
and q have opposite truth values.
The words if and only if are sometimes
abbreviated iff.

24
Order of Operations for Logical Operators

1. Evaluate negations first.

2. When both are present,


parentheses may be needed.

3. When both are present,


parentheses may be needed
Logically Equivalent : Biconditional

Definitions of if and only if, saying “p if, and only if, q” should
mean the same as saying both “p if q” and “p only if q.”
Example : Biconditional

Rewrite the following statement as a conjunction of two if-then


statements:
This computer program is correct if, and only if, it produces correct
answers for all possible sets of input data.

Solution
1. If this program is correct, then it produces the correct answers for all
possible sets of input data;
2. If this program produces the correct answers for all possible sets of
input data, then it is correct.
Necessary and Sufficient Conditions

Definition
If r and s are statements:
r is a sufficient condition for s means “if r then s.”
r is a necessary condition for s means “if not r then not s.”

r is a necessary condition for s also means


“if s then r.”
r is a necessary and sufficient condition for s means
“r if, and only if, s.”
Converting a Sufficient
Condition to If-Then Form
Rewrite the following statement in the form “ If A then B ”:
Pia’s birth on U.S. soil is a sufficient condition
for her to be a U.S. citizen.

Solution
If Pia was born on U.S. soil,
then she is a U.S. citizen.
Converting a Necessary
Condition to If-Then Form
Use the contrapositive to rewrite the following statement in two ways:

George’s attaining age 35 is a necessary condition


for his being president of the United States.

Solution :
Version 1: If George has not attained the age of 35, then he cannot be
president of the United States.

Version 2: If George can be president of the United States, then he


hasattained the age of 35.
Valid And Invalid Arguments
Valid and Invalid Arguments

Definition
•An argument is a sequence of statements (or proposition).
All statements (or proposition) in an argument except for the
final one, are called premises (or assumptions or
hypotheses). The final statement or statement form is called
the conclusion.
The symbol  , which is read "therefore," is normally placed
just before the conclusion.
To say that an argument is valid means that if the resulting
premises are all true, then the conclusion is also true.

32
Valid and Invalid Arguments

Testing an Argument Form for Validity

1. Identify the premises and conclusion of the argument form.


2. Construct a truth table showing the truth values of all the
premises and the conclusion.
3. A row of the truth table in which all the premises are true is
called a critical row. If there is a critical row in which the
conclusion is false, then it is possible for an argument of the
given form to have true premises and a false conclusion, and
so the argument form is invalid. If the conclusion in every
critical row is true, then the argument form is valid.
An Invalid Argument Form
Show that the following argument form is invalid.

34
A Valid Argument Form
Show that the following argument form is valid

35
Rules of Inference

36
Application: A More Complex
Deduction

You are about to leave for school in the morning and discover that you
don’t have your glasses. This statements are true:
a. If I was reading the newspaper in the kitchen, then my glasses are on the
kitchen table.
b. If my glasses are on the kitchen table, then I saw them at breakfast.
c. I did not see my glasses at breakfast.
d. I was reading the newspaper in the living room or I was reading the
newspaper in the kitchen.
e. If I was reading the newspaper in the living room then my glasses are on
the coffee table.
Where are the glasses?
37
Application: A More Complex
Deduction
Solution :
Let
RK = I was reading the newspaper in the kitchen.
GK = My glasses are on the kitchen table.
SB = I saw my glasses at breakfast.
RL = I was reading the newspaper in the living room.
GC = My glasses are on the coffee table.

38
The conclusion
1. RK → GK by (a)
GK → SB by (d)
∴ RK → SB by transitivity
2. RK → SB by the conclusion of (1)
∼SB by (c)
∴ ∼RK by modus tollens
3. RL ∨ RK by (d)
∼RK by the conclusion of (2)
∴ RL by elimination
 Thus the glasses
4. RL → GC by (e)
are on the coffee
RL by the conclusion of (3) table.
∴ GC by modus ponens 39
Fallacies

 A fallacy is an error in reasoning that results in an invalid argument.


 Three common fallacies are using ambiguous premises, and treating
them as if they were unambiguous, circular reasoning (assuming
what is to be proved without having derived it from the premises),
and jumping to a conclusion (without adequate grounds).
 Two other fallacies, called converse error and inverse error, which give
rise to arguments that superficially resemble those that are valid by
modus ponens and modus tollens but are not, in fact, valid.
Converse Error

Show that the following argument is invalid:


If Zeke is a cheater, then Zeke sits in the back row.
Zeke sitsin the back row.
Zeke is a cheater.

Solution
This invalid argument form is called the converse error because the
conclusion of the argument would → follow from the premises if the
premise p q were replaced by its converse.
A conditional statement is not logically equivalent to its converse.
Converse error is also known as the fallacy of affirming the consequent.
Inverse Error

Consider the following argument:


If these two vertices are adjacent, then they do not have
the same color.
Thesetwo vertices are not adjacent.
These two vertices have the same color.

This invalid argument form is called the inverse error because the
conclusion of the argument would → follow from the premises if the
premise p q were replaced by its inverse.
A conditional statement is not logically equivalent to its inverse.
Inverse error is also known as the fallacy of denying the antecedent.
A Valid Argument with a False
Premise and a False Conclusion

The argument below is valid by modus ponens. But its major premise
is false, and so is its conclusion.

If Canada is north of the United States, then temperatures in Canada


never rise above freezing.
Canada is north of the United States.
Temperatures
 in Canada never rise above freezing.
An Invalid Argument with True
Premises and a True Conclusion

The argument below is invalid by the converse error,


but it has a true conclusion

If New York is a big city, then New York has tall buildings.
New York has tall buildings.

New York is a big city.
Digital Logic Circuits

“Contrariwise,” continued Tweedledee, “if it was so, it might be; and if


it were so, it would be; but as it isn’t, it ain’t. That’s logic.” —Lewis
Carroll, Through the Looking Glass
Application: Digital Logic Circuits

The drawing in Figure :


(a) shows the appearance of the two positions of a simple switch. When the
switch is closed, current can flow from one terminal to the other; when
it is open, current cannot flow.
(b) The light bulb turns on if, and only if, current flows through it. And this
happens if, and only if, the switch is closed.
46
Application: Digital Logic Circuits
Now consider the more complicated circuits :

47
Black Boxes and Gates

The operation of a black box is completely


specified by constructing an input/output
table that lists all its possible input signals
together with their corresponding output
signals.

48
“NOT”, “AND”, and “OR” Gates

49
NAND and NOR Gates

50
Constructing the Input/Output
Table for a Circuit
Construct the input/output table for the following circuit.

Solution :
The Boolean Expression
Corresponding to a Circuit

 One of the founders of symbolic logic was the English mathematician George
Boole. In his honor, any variable, such as a statement variable or an input
signal, that can take one of only two values is called a Boolean variable.

 An expression composed of Boolean variables and the connectives , and ~ is


called a Boolean expression.

 In circuitry theory, NOT, AND, and OR gates are the basic gates. Any circuit can
be designed using these gates. The circuits designed depend only on the
inputs, not on the output. In other words, these circuits have no memory. Also
these circuits are called combinatorial circuits.
Finding a Boolean Expression for a Circuit
Find the Boolean expressions that correspond to the circuits shown below :

Solution :
The final expression obtained, (P ∨ Q)∧ ∼(P ∧ Q), is the expression for exclusive
or: P or Q but not both.

53
Recognizer

Definition
A recognizer is a circuit that outputs a 1 for exactly one particular
combination of input signals and outputs 0’s for all other combinations.

54
Constructing Circuits for Boolean
Expressions
Construct circuits for the following Boolean expressions

Solution :

a multiple-input AND-gate

55
Designing a Circuit for
a Given Input/Output Table
Design a circuit for the following input/output table:

Solution :
Identify each row for which the output is 1—in this case, the rows 1, 3, and 4.
(P ∧ Q ∧ R) ∨ (P∧ ∼Q ∧ R) ∨ (P∧ ∼Q∧ ∼R).
56
Designing a Circuit for
a Given Input/Output Table
Solution
The circuit corresponding to this expression. Such expressions are said to be in
disjunctive normal form or sum-of-products form.
Disjunctive Normal Form (DNF)

Definition
Disjunctive Normal Form (DNF) is a boolean expression E, which has no duplication
on the multiplication of each variable

Example:

E1 = X Z’ + X’ Y Z’ + X Y’ Z is DNF

E2 = X Z’ + Y’ Z + X Y Z’ is not DNF, since the multiplication of XYZ’ including XZ’ (XZ’


is the first fundamental product of E2)

58
Full DNF

Definition
A boolean expression E (X1, X2, ...) is full DNF if each fundamental product of
expression consisting of all the variables.

Example:
E = X Y 'Z + X' Y Z + X Y Z ‘

A DNF can be converted into full DNF as follows :

E1 = X Z’ + X’ Y Z’ + X Y’ Z then full DNF of E1 is


E1 = X Z’(Y+Y’) + X’ Y Z’ + X Y’ Z
= X Z’Y + XZ’Y’ + X’ Y Z’ + X Y’ Z

59
Consensus

Definition
Let P1 and P2 are fundamental product. If exactly one variable which has
complement on P1 and P2, then consensus (Q) from P1 and P2 is multiplication
of each variables in P1 and P2 without complement variable and written : P1 +
P2 = P1+ P2 + Q

Example :
1. Let P1 = xy’zp and P2 = xyt, then consensus of P1 and P2 is Q = xzpt , and
written :
xy’zp + xyt = xy’zp + xyt + xzpt

2. Let P1 = xy’z and P2 = x’yzp, then P1 and P2 don’t have consensus because
P1 and P2 have two complement variable, they are x and y.

60
Theorem of Fundamental Product

Theorem (Include)

If fundamental product P2 including fundamental product P1, then


P1+P2=P1

Example :

61
Karnaugh Map
Karnaugh Map

 A Karnaugh map or K-map, for finding terms to combine for Boolean functions
involving a relatively small number of variables
 The method we will describe was introduced by Maurice Karnaugh in 1953. His
method is based on earlier work by E.W. Veitch.
 K-maps give us a visual method for simplifying sum-of-products expansions; they
are not suited for mechanizing this process
 A Karnaugh map has zero and one entries at different positions.  Each position in a
grid corresponds to a truth table entry.
 Given a Boolean function described by a truth table or logic function, then:
• Draw the Karnaugh Map for the function.
• Use the information from a Karnaugh Map to determine the smallest sum-of-
products function. 

63
Karnaugh Map in Two Variables

 There are four possible minterms in the sum-of-products expansion of a Boolean


function in the two variables x and y.
 A K-map for a Boolean function in these two variables consists of four cells, where
a 1 is placed in the cell representing a minterm if this minterm is present in the
expansion. Cells are said to be adjacent if the minterms that they represent differ
in exactly one literal.
 For instance, the cell representing is adjacent to the cells representing
and

64
Karnaugh Map in Two Variables

Example :
Find the K-maps for Boolean expression E that equal to :

Solution :

E=y E= E=
65
Karnaugh Map in Three Variables

Let (x,y,z) be a sum of product Boolean expression such that minterm consists
of three variables x,y,z. To define the K-map for (x,y,z) , we consider the
following table

66
Blocks in K-maps in Three Variables.
Karnaugh Map in Three Variables

Example :
Use K-maps to minimize these sum-of-products expansions
Karnaugh Map in Three Variables

Solution :
A K-map in Four Variables

Let (x,y,z,w) be a sum


of product Boolean
expression such that
minterm consists of
three variables x,y,z,w.
To define the K-map
for (x,y,z,w), we
consider the following
table

70
A K-map in Four Variables
A K-map in Four Variables

Example :
Use K-maps to simplify these sum-of-products expansions.
A K-map in Four Variables

Solution :
Predicates And Quantified Statements I

…It Was Not Till Within The Last Few Years That It Has Been Realized How
Fundamental Any And Some Are To The Very Nature Of Mathematics. —A.
N. Whitehead (1861–1947)
Predicates

Definition
A predicate is a sentence that contains a finite number of variables
and becomes a statement when specific values are substituted for
the variables. The domain of a predicate variable is the set of all
values that may be substituted in place of the variable.

Definition
If P(x) is a predicate and x has domain D, the truth set of P(x) is the
set of all elements of D that make P(x) true when they are
substituted for x. The truth set of P(x) is denoted

{x D|P(x)}.
75
Finding Truth Values of a Predicate

Let P(x) be the predicate "x2 > x" with domain the set R of all real numbers.
Write P(2), P(1/2), P(-2), and indicate which of these propositions are true
and which are false!

Solution :

P(2) : 22 > 2 or 4 > 2. True


P(1/2) : (1/2) 2 > (1/2) or (1/4) > (1/2). False
P(-2) : (-2)2 > 2 or 4 > 2. True

76
The Truth Set of The Predicate

Let Q(n) be the predicate “n is a factor of 8.” Find the truth set of Q(n) if
a. the domain of n is the set Z+ of all positive integers
b. the domain of n is the set Z of all integers.

Solution :
a. The truth set is {1, 2, 4, 8} because these are exactly the positive integers
that divide 8 evenly.
b. The truth set is {1, 2, 4, 8,−1,−2,−4,−8} because the negative
integers−1,−2,−4, and −8 also divide into 8 without leaving a remainder. ■
Change Predicates Into Propositions

One sure way to change predicates into propositions is to assign specific values to
all their variables.

Example :
If x represents the number 35, the sentence
"x is (evenly) divisible by 5“
is a true propositions since 35 = 5٠7.

Another way to obtain propositions from predicates is to add quantifiers.


Quantifiers are words that refer to quantities such as "some" or "all" and tell for
how many elements a given predicate is true.

78
The Universal Quantifier, 

The symbol  is called the universal quantifier. it is read as “for every,”


“for each,” “for any,” “given any,” or “for all.”

Example :
The sentence "All human beings are mortal" is to write
 human beings x, x is mortal
or, more formally
x  S, x is mortal,
and read “ For all x in S, x is mortal “
where S denotes the set of all human beings.

79
Truth and Falsity of Universal Proposition

Definition

Let Q(x) be a predicate and D the domain of x. A universal proposition


is a proposition of the form
"x  D, Q(x)“.
It is defined to be true if, and only if, Q(x) is true for every x in D.

It is defined to be false if, and only if, Q(x) is false for at least one x in D.
A value for x for which Q (x) is false is called a counter example to the
universal proposition.

80
Truth and Falsity of Universal Proposition

Example :
a. Let D = {1, 2, 3,4, 5}, and consider the proposition “x  D, x2  x”
Show that this proposition is true.
b. Consider the proposition x  R, x2  x. Find a counter example to
show that this proposition is false.

Solution:
a. Check that "x2  x" is true for each individual x in D.
12 > 1, 22 > 2, 32 > 3, 42 > 4, 52 > 5.
Hence " x  D,x2  x " is true.
b. Counter example: Take x = 1/2. Then x is in R (since 1/2 is a real number) and

hence "x  R, x2  x " is false. 81


The Existential Quantifier, 

 The symbol  denotes "there exists" and is called the existential


quantifier.

 Example:
The sentence "There is a student in Math 140" can be written as
 a person s such that s is a student in Math 140,
or more formally,
 sS such that s is a student in Math 140,
where S is the set of all people.

 Some other expressions that can be used in place of there exists are there
is a, we can find a, there is at least one, for some, and for at least one.

82
Truth and Falsity of Existential Proposition

Definition

Let Q(x) be a predicate and D the domain of x. An existential


proposition is a proposition of the form
" x  D such that Q(x)“.

It is defined to be true if, and only if, Q(x) is true for at least one x in D.

It is defined to be false if, and only if, Q(x) is false for all x in D.

83
Truth and Falsity of Existential Proposition

Example :
a. Consider the proposition “ m  Z such that m2 = m”.
Show that this proposition is true.

b. Let E = {5, 6, 7, 8, 9} and consider the statement “ m  Z such that m2 = m”.


Show that this proposition is false.

Solution :
a. Observe that 12 = 1. Thus"m2 = m" is true for at least one integer m. Hence “ m
 Z such that m2 = m” is true.

b. Note that m2 = m is not true for any integers m from 5 to 9 :


52 = 25  5, 62 = 36  6, 72 = 49  7, 82 = 64  8, 92 = 81  9. Thus “ m  Z such
that m2 = m” is false.
84
Translating from Formal
to Informal Language (1)
Example :
Rewrite the following formal statements in a variety of equivalent but more
informal ways.
Do not use the symbol  or .

Solution :
a. Every real number has a nonnegative square.
Or : All real numbers have nonnegative squares.
Or : Any real number has a nonnegative square.
Or : The square of each real number is nonnegative.
Translating from Formal
to Informal Language (2)

Solution :
b. All real numbers have squares that do not equal -1.
Or : No real numbers have squares equal to -1.
(The words none are or no … are are equivalent to the words all are not.)
c. There is a positive integer whose square is equal to itself.
Or : We can find at least one positive integer equal to its own square.
Or : Some positive integer equals its own square.
Or : Some positive integers equal their own squares. ■
Translating from Formal
to Informal Language (3)

Example :
Rewrite each of the following statements formally. Use quantifiers and variables.
a. All triangles have three sides.
b. No dogs have wings.
c. Some programs are structured.

Solution :
a. tT, t has three sides
(where T is the set of all triangles).
b. dD, d does not have wings
(where D is the set of all dogs).
c. pP such that p is structured
(where P is the set of all programs).
Universal Conditional Propositions

A reasonable argument can be made that the most important form of proposition
in mathematics is the universal conditional proposition:
x, if P(x) then Q(x)

Example :
Rewrite the following statement informally, without quantifiers or variables.
∀x ∈ R, if x > 2 then > 4.

Solution :
If a real number is greater than 2 then its square is greater than 4. or
The square of any real number greater than 2 is greater than 4.

88
Predicates And Quantified Statements II
Negation of a Universal Statement

Theorem

The negation of a statement of the form


 x in D, Q(x)
is logically equivalent to a statement of the form
 x in D such that ~Q(x).
Symbolically,
~( x  D, Q(x))   x  D such that ~Q(x).

Example:
A formal negations for the proposition
“ primes p, p is odd”
is
“ a prime p such that p is not odd”. 90
Negation of an Existential Proposition

Theorem
The negation of a statement of the form
x in D such that Q(x)
is logically equivalent to a statement of the form
x in D,~Q(x).
Symbolically,
~(x in D such that Q(x))  x in D,~Q(x).

Example :
A formal negations for the statement
“ a triangle T such that the sum of the angles of T equals 200°”.
is
“ triangles T, the sum of the angles of T does not equal 200° ”.
91
More Negations

Example :
Rewrite the following statements formally. Then write formal and informal
negations.
a. No politicians are honest.
b. The number 1,357 is not divisible by any integer between 1 and 37.

Solution :
a. Formal version (1):  politicians x, x is not honest.
Formal negation (2):  a politician x such that x is honest.
Informal negation (3) : Some politicians are honest.
b. (1)  integer n between 1 and 37, 1,357 is not divisible by n.
(2)  an integer n between 1 and 37 such that 1,357 is divisible by n.
(3) The number 1,357 is divisible by some integer between 1 and 37.
Negations of Universal
Conditional Statements
Negation of a Universal Conditional Statement
∼(∀x, if P(x) then Q(x)) ≡ ∃x such that P(x) and ∼Q(x).

Example :
a. ∀ people p, if p is blond then p has blue eyes.
b. If a computer program has more than 100,000 lines, then it contains a
bug.

Solution
a. ∃ a person p such that p is blond and p does not have blue eyes.
b. There is at least one computer program that has more than 100,000 lines
and does not contain a bug. ■
Variants of Universal
Conditional Statements
Definition

Consider a statement of the form ∀xD, if P(x) then Q(x).


1. Its contrapositive is the statement ∀xD, if Q(x) then P(x).
2. Its converse is the statement ∀xD, if Q(x) then P(x).
3. Its inverse is the statement ∀xD, if P(x) then Q(x).

Example :
Write a formal and an informal contrapositive, converse, and inverse for the
following statement :
If a real number is greater than 2, then its square is greater than 4.
Example

Solution:
The formal version : ∀xR, if x 2 then 4.
Contrapositive : ∀xR, if 4 then x2.
(If the square of a real number is less than or equal to 4, then
the number is less than or equal to 2).

Converse: ∀xR, if 4 then x 2.


(If the square of a real number is greater than 4, then the number is
greater than 2).

Inverse: ∀xR, if x 2 then 4 .


(If a real number is less than or equal to 2, then the square of the
number is less than or equal to 4).
Statements With Multiple Quantifiers

It Is Not Enough To Have A Good Mind. The Main Thing Is To Use It Well.
—René Descartes
Multiple Quantifier

  x  y P(x,y)
P(x,y) true for all x, y pairs

  x  y P(x,y)
P(x,y) true for at least one x, y pair

  x  y P(x,y)
For every value of x we can find a (possibly different) y so that
P(x,y) is true.

  x  y P(x,y)
There is at least one x for which P(x,y) is always true.
Interpreting Statements with
More Than One Quantifier (1)
Example :
A college cafeteria line has four stations: salads, main courses, desserts, and
beverages. The salad station offers a choice of green salad or fruit salad; the
main course station offers spaghetti or fish; the dessert station offers pie or cake;
and the beverage station offers milk, soda, or coffee. Three students, Uta, Tim,
and Yuen, go through the line and make the following choices:
Uta : green salad, spaghetti, pie, milk
Tim : fruit salad, fish, pie, cake, milk, coffee
Yuen : spaghetti, fish, pie, soda
Interpreting Statements with
More Than One Quantifier (2)
These choices are illustrated in this figure :
Example

Write each of following statements informally and find its truth value :
a. ∃ an item I such that ∀ students S, S chose I .
b. ∃ a student S such that ∀ items I, S chose I .
c. ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I .
d. ∀ students S and ∀ stations Z,
∃ an item I in Z such that S chose I .
Solution

a. There is an item that was chosen by every student. This is true; every student
chose pie.
b. There is a student who chose every available item. This is false; no student chose
all nine items.
c. There is a student who chose at least one item from every station. This is true;
both Uta and Tim chose at least one item from every station.
d. Every student chose at least
one item from every station.
This is false; Yuen did not
choose a salad. ■

This Photo by Unknown Author is


licensed under CC BY
References

Susanna S.Epp, “ Discrete Mathematics with Applications”,


5th edition,2020, Cengage, Boston, USA, ISBN
9781337694193

Kenneth H. Rosen, “ Discrete Mathematics and its


Applications”, 8th edition,2019, McGraw-Hill Education, New
York, ISBN 978-1-259-67651-2

102

You might also like