0% found this document useful (0 votes)
48 views17 pages

Chapter 5

Uploaded by

Andrian Magno
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)
48 views17 pages

Chapter 5

Uploaded by

Andrian Magno
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

Chapter 5:

Logic
Introduction
In everyday life, reasoning proves different points. For instance, to prove your
parents that you performed well in school, you can show your grades. To prove your
friends that you are a true friend to them, you just need to be a loyal and honest friend.
Similarly, mathematics and computer science use mathematical logic or simply logic
to prove results. In particular, mathematical logic is used in mathematics to prove a
theorem. In computer science, logic is used to prove results of computer algorithm or
the correctness of a computer program.

Logic is commonly referred as the science of correct reasoning, especially


regarding making inferences. Mathematical reasoning and arguments are based on
the rules of logic.

Learning Outcomes:
At the end of this chapter, you are expected to:

 Determine a given sentence as statement or not.


 Write compound statements using the language of logic.
 Create truth tables of given statements.
 Determine the truth value of a given statement.
 Write the converse, inverse, and contrapositive statements of conditional
statements.
 Determine whether statements are equivalent, tautologies or contradiction
using truth tables.
 Appreciate the nature and concept of logic as a tool to prove results.

LESSON 1:
LOGIC STATEMENTS AND QUANTIFIERS

Logic Statements

A statement is a declarative sentence that can be classified true or false, but


not both true and false. It may not be necessary to determine whether a sentence is
true to determine whether it is a statement or not.

Remember!
If we can determine the truth or falsity of a statement, then it has a
truth value. If the statement is true, then the truth value of the statement is
1 value is false also.
true. But when its false, then the truth
Example 1: Identify Statements

Determine whether each sentence is a statement.

1. Annabelle is beautiful.
2. Where do you live?
3. 1+1=2
4. x + 5 = 7.

Solution:

1. For most people that knows Annabelle they might agree on the statement
but not all will have the same thought specially people who don’t like
Annabelle. Therefore, statement one is not a logical statement.
2. The sentence “Where do you live?” is a question; it is not a declarative
sentence. Hence, it is not a statement.
3. Everyone knows that if 1 is added to 1 the answer will always be 2. Then,
statement 2 is a logical statement.
4. x + 5 = 7 is a statement. It is known as an open statement, a sentence that
has a variable. The truth value of this statement will depends on the value
of x. It is true if x = 2, and it is false for any values of x. For any given x, it
is true or false but not both.

Simple and Compound Statements

A simple statement is a statement that conveys a single idea. A compound


statement is a statement that conveys two or more ideas. Connecting simple
statements with words and, or, if ...then, and if and only if creates a compound
statement.

Logic Connectives and Symbols


Symbolic Type of
Statement Connective
Form Statement
not p not ~p negation
p and q and p˄q conjunction
p or q or p˅q disjunction
If p, then q If ... then p→q conditional
p if and only if q If and only if p↔q biconditional

Remember!

The truth value of a simple statement is either true (T) or (F).

The truth value of a compound statement depends on the truth value of


its simple statements and connectives used.

A truth table is a table that shows the truth value of a compound


statement for all possible truth values2of its simple statements.
Negation

The negation of a statement is the opposite of a statement. It is denoted with


either “not” or the symbol ~. For instance, if we like to negate a statement p its either
we use the symbol ~p or use not to indicate the negation. The negation gives the
opposite of the truth value.

Truth Table for Negation (p)


p ~p
T F
F T

Example 2: Negation of a Statement

Give the negation of each statement.

1. p: A square is a rectangle.
2. q: Today is Monday.
3. r: Every student has a ballpen.

Solution:

1. ~p: A square is not a rectangle.


2. ~q: Today is not Monday
3. ~r: Not every student has a ballpen

Example 3: Consider the following simple statements.

p: Today is Monday.
q: It is not raining.
r: I am going to a shopping.
s: I am not going to play volleyball game.

Write the following compound statements in symbolic form.

1. Today is Monday and it is raining.


2. It is not raining and I am going to a shopping.
3. I am going to play volleyball game or I am going to a shopping.
4. If it is raining, then I am not going to play volleyball game.
Solution:
1. p ˄ ~q
2. q˄r
3. ~s ˅ r
4. ~q → s

3
Example 4: Consider the following simple statements.

a: I am going to study
b: I am going to watch a movie.
c: I will not pass the exam.

Write the following compound statements in words.

1. ~a → c
2. b ˄ ~a
3. ~c ↔ a

Solution:
1. If I am not going to study, then I will not pass the exam.
2. I am going to watch a movie and I am not going to study.
3. I will pass the exam if and only if I am going to study.

Compound Statements and Grouping Symbols

If the compound statement is writtem symbolic form, then parentheses are


used to indicate which simple statements are grouped together.

Symbolic Form Meaning


p ˄ ( q ˅ ~ r) q and ~r are grouped together.
(p ˄ q) ˅ r p and q are grouped together.
(p ˄ q) → ( q ˅ ~ r) p and q are grouped together and q
and ~r are also grouped together.

If a compound statement is written in words, then a comma is used to indicate


which simple statements are grouped together. Statements on the same side of a
comma are grouped together.

English Sentence Meaning


p, and q or not r q and ~r are grouped together because
they are both on the same side of the
comma.
p and q, or r p and q are grouped together because
they are both on the same side of the
comma.
If p and r, then q or not r) p and q are grouped together because
they are both on the left side of the
comma.
q and ~r are also grouped together
because they are both on the right side
of the comma.

4
Example 5: Let p, q, and r represent the following statements:

p: Cathy’s dancing style is similar to Maja.


q: Cathy has a messy hair.
r: Cathy is a rock dancer.

1. Write (p ˄ q) → r as an english sentence.


2. Write “If Cathy is not a rock dancer, then Cathy does not have
messy hair and Cathy’s dancing style is not similar to Maja.” In
symbolic form.

Solution:
1. If Cathy’s dancing style is similat to Maja and Cathy has a messy
hair, then Cathy is a rock dancer.
2. ~ r → (~ q ˄ ~ p )

Conjunction

A conjunction is a compound statement that is made by combining two or


more statements with the word “and” or with symbol ˄.

Truth Table for Conjunction (p ˄ q)


p q p˄q
T T T
T F F
F T F
F F F

Remember!
The conjunction p ˄ q is true if and only if both p and q are true.

Disjunction

A disjunction is a compound statement that is made by combining two or


more statements with the word “or” or with symbol ˄.

Truth Table for Disjunction (p v q)


P q p˅q
T T T
T F T
F T T
F F F

5
Remember!
The disjunction p ˅ q is true if and only if p is true, q is true, or
both p and q are true.

Example 6: Determine whether each statement is true or false.

1. 12 ≥ 10.
2. 6 is an even number and 6 is a composite number.
3. 5 is a prime number and 5 is an odd number.
4. 2 is an integer or 2 is an odd number.
5. – 5 ≤ - 10

Solution:

1. 12 ≥ 10 means 12 > 10 or 12 = 10. Since 12 > 10 is true, then the statement


is true.
2. The statement is true because 6 is an even number at the same time
composite number.
3. The statement is true because 5 is a prime and odd number.
4. The statement “2 is an integer” is true and the statement “2 is an odd
number” is false. Applying disjunction rule, the statement is true.
5. – 5 ≤ - 10 means - 5 < - 10 or -5 = -10. Since both simple statements are
false, the truth value of the statement is false.

LESSON 2:
TRUTH TABLES, EQUIVALENT STATEMENTS, AND
TAUTOLOGIES

Truth Table

A truth table is a table used to check the “truth value” of any compound
statement for all possible truth values of its simple statements. It is a way to check all
possible outcomes.
Presented below are the truth tables for negattion, conjunction, and disjunction
for review purposes.

Truth Table for Negation (p)


p ~p
T F
F T

Truth Table for Conjunction (p ˄ q)

6
p q p˄q
T T T
T F F
F T F
F F F

Truth Table for Disjunction (p v q)


p q p˅q
T T T
T F T
F T T
F F F

In this section we will construct truth tables for a statement that involves a
combination of negation, conjunctions and disjunctions. If the given statement involves
only two simple statements, then we have to start by constructing a table with four
rows, called the standard table form.

Example 7. Construct a table for ~ (p ˅ q) ˄ q

Solution: Start with the standard table form.

p q
T T
T F
F T
F F

Now, use the truth values of p and q to produce the truth value of p ˅ q

p q (p ˅ q)
T T T
T F T
F T T
F F F

Negate the truth values in the p ˅ q column to produce the truth value of
~ (p ˅ q)
P q p˅q ~ (p ˅ q)
T T T F
T F T F
F T T F
F F F T

7
Lastly, use the values of ~ (p ˅ q) and q to produce the truth values of
~ (p ˅ q) ˄ q applying the truth value of conjunction. The shaded column
is the truth table for ~ (p ˅ q) ˄ q.

P q p˅q ~ (p ˅ q) ~ (p ˅ q) ˄ q
T T T F F
T F T F F
F T T F F
F F F T F

Truth Table with Three or More Simple Statements

Compound statements that involve three or more simple statements require a


standard truth table form with 2n number of rows. For instance, if the statement
involves 3 simple statements, then the number of rows of truth table is 2 3 = 8. If 4
simple statements are involved, then 2 4 = 16 number of rows must be produced, and
so on.

Example 8. Construct a table for (p ˅ q) ˄ r.

Solution: Start with the standard truth table form with 3 simple statements involved.

P q r
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

Now, use the truth values of p and q to produce the truth value of p ˅ q

p q r (p ˅ q)
T T T T
T T F T
T F T T
T F F T
F T T T
F T F T

8
F F T F
F F F F

Lastly, use the values of (p ˅ q) and r to produce the truth values of


(p ˅ q) ˄ r applying the truth value of conjunction. The shaded column is
the truth table for (p ˅ q) ˄ r.

p q r (p ˅ q) (p ˅ q) ˄ r
T T T T T
T T F T F
T F T T T
T F F T F
F T T T T
F T F T F
F F T F F
F F F F F

Example 9. Construct a truth table for (p ˄ q) ˄ (~r ˅ q).

Solution: Using the procedure developed above, we can produce the following table.
Te shaded column is the truth table for p ˅ [~ (p ˄ ~q)]. The number below
signigfies the sequence in which columns were constructed.

P q r (p ˄ q) ~r (~r ˅ q) (p ˄ q) ˄ (~r ˅ q)
T T T T F T T
T T F T T T T
T F T F F F F
T F F F T T F
F T T F F T F
F T F F T T F
F F T F F F F
F F F F T T F
1 2 3 4

Equivalent Statements

Two statemens are said to be equivalent if they both have the same truth value
for all possible truth values of their simple statements. The symbol ≡ is used to
indicates equivalents statements.
Example 9. Show that ~ ( p ˅ ~ q) and ~p ˄ q are equivalent statements.

Solution: Construct the truth table of the given statements and compare the results.

For ~ ( p ˅ ~ q) :

P q ~q (p ˅ ~q) ~ (p ˅ ~q)

9
T T F T F
T F T T F
F T F F T
F F T T F

For ~p ˄ q:

P q ~p ~p˄q
T T F F
T F F F
F T T T
F F T F

Since the truth values of the given statements are the same, then
~(p ˅ ~ q) ≡ ~p ˄ q.

Tautologies and Contradiction

A tautology is a statement which is “always true” — that is, it is true for every
possible truth value. The opposite of a tautology is a contradiction, a statement which
is “always false”. In other words, a contradiction is false for every possible truth value.

Example 10 . Show that (p → q) ∨ (q → p) is a tautology.

Solution: Construct the truth table for (p → q) ∨ (q → p) and show that the statement
is always true.

p q p→q q→p (p → q) ˅ (q → p)
T T T T T
T F F T T
F T T F T
F F T T T

The last column contains only T’s. Therefore, the statement is a tautology.

Example 11. Show that p ˄ (~p ˄ q) is a self – contradiction.

Solution: Construct the truth table for p ˄ (~p ˄ q) and show that the statement is
always false.

p q ~p ~p ˄ q p ˄ (~p ˄ q)
T T F F F
T F F F F
F T T T F
F F T F F

10
The last column contains only F’s. Therefore, the statement is a self -
contradiction.

LESSON 3:
THE CONDITIONAL AND THE BICONDITIONAL

Conditional Statements

A conditional statement is a statement written in a form “If...then”. The phrase


after the word “if” is called antecedent. The phrase after the word “then “is called the
consequent.

Example 12 . Determine the antecedent and consequent in the following statements.

1. If x + 5 = 8, then x = 3.
2. If a polygon hasfour sides, then it is a quadrilateral.
3. If you don’t study your lesson, then you will not pass the exam.
4. If 2 is an integer, then 2 is a rational number.

Solution:

1. Antecedent: x + 5 = 8
Consequent: x = 3

2. Antecedent: A polygon has four sides


Consequent: It is a quadrilateral

3. Antecedent: You don’t study your lesson


Consequent: You will not the pass the exam

4. Antecedent: 2 is an integer
Consequent: 2 is a rational number

The Truth Table for Conditional Statement ( p → q)


P q p→q
T T T
T F F
F T T
F F T

Remember!
11
The conditional p → q is false if p is true and q is false. It is true in all
other cases.

Example 13 . Determine the truth value of each statement.

1. If 2 is an integer, then 2 is a rational number.


2. If a=1, b=2, c=3, then a + b + c > 5
3. If 3 + 5 = 8, then 8 – 3 = 5.

Solution:

1. The consequent is true, then the statement is true.


2. The consequent is false, then the statement is false.
3. Because both the antecedent and consequent are true, then the
statement is true.

Binconditional Statements

The statement (p → q) ˄ (q → p) is called a biconditional and itt is denoted by


p ↔ q, which is read as “p if and only if q”.

The Truth Table for Biconditional Statement ( p ↔ q)


p q p↔q
T T T
T F F
F T F
F F T

Example 14 . Determine the truth value of each statement.

1. y + 7 = 12 if and only if y = 5
2. x2 = 25 if and only if x = 5
3. x > 4 if and only if x > 3.

Solution:
1. The statement is true since the statement “y + 7 = 12” will be only true if “y
= 5”. Otherwise, the statement will be false.
2. If x = -5, the first equation is true and the second equation is false. Thus,
the statement is false.
3. The statement is false. If x = 4, the first statement will become false.

12
LESSON 4:
THE CONDITIONAL AND RELATED STATEMENTS

Every conditional statement has three related statements. They are called the
converse, inverse, and contrapositive.

The Converse

Converse statement is a conditional statement that is formed by switching


the antecedent and the consequent of the conditional.

Remember!
The Converse of Conditional Statement

From p → q, converse statement will have q → p

The Inverse

An inverse statement is formed by negating both the antecedent and the


consequent of the conditional.

Remember!
The Inverse of Conditional Statement

From p → q, inverse statement will have ~p → ~q

The Contrapositive

Contrapositive is a conditional statement formed by negating both antecedent


and the consequent, and switching them. Contrapositive statements are inverse and
converse at the same time on a single conditional statement.

Remember!
The Inverse of Conditional Statement

From p → q, inverse statement will have ~q → ~p

13
Example 14: Write the converse, inverse, and contrapositive of the following
conditional statements.

1. If I sleep early, then I will wake up on time.


2. If today is Monday, then Kevin will play soccer.

Solution:
1. Converse: If I will wake up on time, then I sleep early.
Inverse: If I will not sleep early, then I will not wake up on time.
Contrapositive: If I will not wake up on time, then I will not sleep early.

2. Converse: If Kevin will play soccer, then today is Monday.


Inverse: If today is not Monday, then Kevin will not play soccer.
Contrapositive: If Kevin will not play soccer, then today is not Monday.

Truth Tables for Conditional and Related Statements

Conditional Converse Inverse Contrapositive


p q
p→q q→p ~p → ~ q ~q → ~p
T T T T T T
T F F T T F
F T T F F T
F F T T T T

Observations:

1. Converse and inverse statements are equivalents because they have the
same truth values.
2. Conditional and contrapositive statements are equivalents because they
have the same truth values.

Example 15: Determine whether related statements are equivalent.

1. If a number ends with 5, then the number is divisible 5.


If a number is divisible 5, then the number ends with a 5.

2. If two lines in a plane do not intersect, then the lines are parallel.
If two lines in a plane are not parallel, then the lines intersct.

Solution:

1. The second statement is the converse of the first. Thus, the statements are
not equivalent.
2. The second statement is the contrapositive of the first. Thus, the statements
are equivalent.

14
Chapter Exercise

Directions: Answer the following as instructed.

1. Determine whether each sentence is a statement or not.

a. December is the first month of the year.


b. The diameter of a circle is twice the length of the radius.
c. He is very short.
d. The sums of the squares of the legs of a right triangle are equal to the
square of the hypotenuse.
e. 10 × 2 + 7 = 90.
f. A hexagon is a six-sided polygon.
g. Have a fun trip.
h. Do you like to swim?
i. Run!
j. 10 ≥ 10.

2. Write the negation of each statement and determine the truth value.

a. The sun rises from the east.


b. 1+1=0
c. January is the first month of the year.
d. The Eiffel Tower is in Japan.
e. A square has 7 sides.
f. A snake is a reptile.
g. The measure of an acute angle is greater than 90°.
h. 5 + 5 + 5 = 555
i. A quarter of an hour is 15 minutes
j. b) There is caffeine in coffee.

3. Write each symbolic statement in words. Use p, q, r, s, t, and u as defined


below.

p: The tour goes to Italy.


q: The tour goes to Spain.
r: We go to Venice.
s: We go to Florence.
t: The hotel fees are included.
u: The meals are not included

a. p ˄ ~q

15
b. r → ~s
c. s ↔ ~r
d. r˅s
e. p→r
f. ~t ˄ u

4. Write each sentence in symbolic form. Use p, q, r, and s as defined below.

p: Dwyane Wade is a football player.


q: Dwyane Wade is a basketball player.
r: Dwyane Wade is a rock star.
s: Dwyane Wade plays for the Miami Heat.

a. Dwyane Wade is a football player or a basketball player.


b. Dwyane Wade is a rock sta, and he is not a basketball player or a
football player.
c. If Dwyane Wade is a basketball player and a rock star, then he is not a
football player.
d. Dwyane Wade is a basketball player, if and only if he is not a football
player and he is not a rock star.
e. If Dwyane Wade plays for the Miami Heat, then he is a basketball player
and he is not a football player.
It is not true that, Dwyane Wade plays is a football player or a rock star.

5. Construct a truth table for each compound statement.

a. p ˅ ~q
b. ~p ˄ q
c. (q ˄ ~p) ˅ ~q
d. ~(p ˅ q) ˄ (~r ˅ q)
e. [(p ˄ q) ˅ (r ˄ ~q)] ˄ (r ˅ ~q)

6. Identify the Hypothesis and Conclusion:

a. If Patsy has a messy hair today, then she will not show up to work.
b. If two lines are parallel, then they will not intersect.
c. If a polygon has 3 sides, then it is a triangle.
d. If the dog is barking, then someone is nearby.

7. Write each statement in "if, then" form:

a. The sum of the angles of a 3-sided polygon is 180 degree.


b. In a clear night, we can see the moon.
c. Getting a bachelor's degree will get you a job.

16
8. Determine the truth value of the following conditional and biconditional
statements.

a. If a ≤ 3, then a > 3.
b. If two lines intersect, then it must create a right angle
c. If a=1, b=2, c=3, then a + b + c > 5
d. If a polygon has 3 sides, then it is a triangle.
e. x = 5 if and only if x + 7 = 12.
f. If x > 5 if and only if x > 2.
g. The triangle is an isosceles, if and only if two sides are equal.
h. The angle is acute, if and only if the angle is less than 90° degrees.

9. Given the statements, write the inverse, converse, and contrapositive:

a. Two intersecting lines create an angle.


b. If today is Monday, then Kevin will play soccer.
c. If 1 + 2 = 3, then 12 + 22 = 32
d. If the polygon is a triangle, then it has 3 sides.
e. If x + 7 = 13, then x = 6.
f. If 3 is odd, then 3 + 1 is even.
g. If 2 is an integer, then 2 is a whole number.

17

You might also like