Chapter 5 Fundamentals of Logic Soln
Chapter 5 Fundamentals of Logic Soln
Eg 1: Which of the following are statements? For a statement, find its truth value.
a) The earth is round. => A TRUE statement.
b) 2 + 3 = 6. => A FALSE statement.
c) Segamat is a big city. => A FALSE statement. (By any known standard.)
d) What a beautiful flower! => NOT a statement. (Expression of personal view.)
e) Is Mr. Lau thin or fat? => NOT a statement. (It is a question.)
f) Take two aspirins. => NOT a statement. (It is an instruction.)
Statements can be combined by logical connectives to obtain compound statements. The truth value
depends on the types of connectives use. Statements without logical connectives are also known as
primary statements.
Eg 2: “The sun is shining or I am taking my shower” is a compound statement. The primary statements
are “The sun is shining” and “I am taking my shower”.
Truth Table
- a table giving the truth values of a compound statement in terms of the truth values of its component
parts.
- each component statement has 2 possible truth values, T and F.
- if there are n component statements in the compound statement, then the number of rows in its truth
table is 2n.
Types of Connectives
1. Conjunction (and, )
Let p and q be two primary statements, the conjunction of p and q is the compound statement “p and q”,
denoted p q. It is true when both p and q are true, and is false otherwise.
p q pq
NOTE: For compound statements,
T T T
always put the truth value right below
T F F
the (correct) connectives that we use to
F T F determine the truth values.
F F F
1
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
Eg 3: Determine the truth value of the conjunction of p and q for each of the followings.
a) p: It’s snowing. q: I am not Malaysian. => F F = F. So, p q is a false statement.
b) p: 2 < 3. q: -5 > -8. => T T = T. So, p q is a true statement.
2. Disjunction (or, )
The disjunction of p and q is the compound statement “p or q”, denoted p q. It is true if at least one
of p or q is true, and is false otherwise.
p q pq
T T T
T F T
F T T
F F F
Eg 4: Determine the truth value of the disjunction of p and q for each of the following.
a) P: I study mathematics. Q: I am a UiTM student.
b) P: 2 + 3 = 5. Q: Segamat is located in Melaka.
3. Negation (not, ~)
The negation of a statement p is not p, denoted ~p. ~p is true (or false) when p is false (or true).
Eg 5: Give the negation of the following statements and determine its truth value.
a) P: 2 + 3 > 1. Here, P is a true statement.
b) P: The sun is a cold planet. Here, P is a false statement.
a) ~P: 2 + 3 1 OR 2 + 3 is NOT greater than 1 OR It’s not true that 2+3 > 1. So, ~P is false.
b) ~P: The sun is a hot planet. OR The sun is not a cold planet. OR It’s not true that the sun is a
cold planet. So, ~P is true.
NOTE: In daily conversation, if we say p implies q, then there is a cause-and-effect relationship between
p and q. In mathematics, p q is true doesn’t mean that there is a cause-and-effect relationship between
p and q. Here, p and q can be 2 unrelated statements.
2
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
p q pq
T T T
T F F
F T T
F F T
Eg 6:
“If I am your lecturer, then you all are my students” is obviously True.
“If I am your lecturer, then you all are older than me” is False since the conclusion is false.
“If I am your father, then 2 + 3 = 5” is True since the conclusion is true.
“If I am your father, then you are all my children” is definitely True though both hypothesis and
conclusion are false.
Eg 7: “If you come on Sunday, then I will employ you.” is false only when you come on Sunday and I
don’t employ you.
p q pq (p q) (q p)
T T T T T T
T F F F F T
F T F T F F
F F T T T T
pq:
Eg 9: Let P: I am rich; Q: I am happy. Write the following compound statements in symbolic forms.
Suppose the truth value of P is F, and Q is T, determine the truth values of the statements.
3
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
Eg 10: For each of the symbolic expression, write the corresponding compound statement base on the
given primary statements:
b) P (Q R)
c) Q ~ R
Men are safe from tragedy if and only if men are not created by God.
d) ~Q R
Men are not safe from tragedy or men are created by God.
Exercise 5.1
1. Determine whether each of the following sentences is a statement. If it is a statement, determine its
truth value.
a) x + 3 is a positive integer.
b) If only every morning could be as sunny as this one!
c) Fifteen is an even number.
d) If Jennifer is late for the party, then her cousin Zachary will be quite angry.
e) What time is it?
2. Let P be “He is intelligent” and Q be “He is kind”. Write each of the following statements in
symbolic form using P and Q and determine its truth value. Assume that both P and Q are true.
4
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
Tautology: A proposition that is always true whatever the truth values of the component statements.
The last column of the truth table consists of T only.
Contradiction: A proposition that is always false whatever the truth values of the component
statements. The last column of the truth table consists of F only.
Example: p ~ p
(2) (1)
p p ~p
T F F
F F T
Contingency: A proposition that can be either true (T) or false (F), depending on the truth values of its
component statements.
Example: p ~q
(2) (1)
p q p ~q
T T F F
T F T T
F T F F
F F F T
5
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
Eg 2: Construct the truth table of (a) ~(P (Q ~P)) and (b) ~((P Q) (~P ~Q)).
4 3 2 1 6 1 5 2 4 3
P Q ~ (P (Q ~P)) ~ ((P Q) (~P ~Q))
T T T T F F F F
T F F T T F T T
F T F T T T T F
F F T F F T T T
Exercise 5.2
1. Construct a truth table for each of the following compound statements, where P, Q, R are primitive
statements. Hence, determine the truth value of each statement.
a) ~(P ~Q) ~P b) Q (~P ~Q) c) (P Q) (Q P)
d) [P (P Q)] Q e) P (Q ~P)
2. By using truth table, determine whether each of the following statements is a tautology, contingency
or contradiction.
a) (P~P)Q b) (P~Q)Q
c) [(PQ)(Q ~P)] P
3. Determine the truth value of each of the following statements by constructing a truth table.
a) (PQ)(PR) b) (PR)(QR)
c) ~R(PQ) d) (PQ)(QR)
6
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
5.3 Equivalence
Logical Equivalence (if and only if or or )
Two statements are considered to be logically equivalent if they have the same truth value for any
combination of truth values of their component statements. The last column of their truth tables is
identical. This means the biconditional statement of two logically equivalent statements is a tautology,
i.e., if A B, then A B is a tautology. There is cause-effect relationship.
Eg 2: Compare the truth values of P Q with the truth values of its converse, inverse, contrapositive
and ~P Q.
P Q PQ QP ~P ~Q ~Q ~ P ~P Q
T T T T T T F T
T F F T T F F F
F T T F F T T T
F F T T T T T T
Eg 3: Give the converse, inverse and the contrapositive of the implication a) “If it is raining, then I get
wet.” and b) “If it is hot and windy, then I go swimming.”
a) Conv: If I get wet, then it is raining.
Inv: If it is not raining, then I don’t get wet.
Contra +tive: If I don’t get wet, then it is not raining.
7
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
If, Only if
A if and only if B is logically equivalent to: A if B and A only if B.
A only if B means If not B, then not A, which is equivalent to its contrapositive: If A, then B,
denoted A B.
a) If John breaks the world’s record for the mile run, then he has run the mile in under 4 minutes.
b) If Mary was born on US soil, then she is a US citizen.
c) If George is US president, then he has attained age 35.
Exercise 5.3
1. For each of the following statements, determine all the primitive statements using p,q,r,… and then
write the inverse, converse and contrapositive in symbolic form and in sentence.
a) If it is raining today, then I will not be playing football.
b) If I am happy, then I will not be alone.
c) If John is tall and thin, then he will be playing basketball.
d) Mary will fail MAT110 if she is lazy or doesn’t attend all the lectures. If P or not Q, then R.
e) I will attend the dinner only if you are not going.
If I attend the dinner, then you are not going. P: I attend the dinner Q: you are going
P ~Q
Conv: ~Q P If you are not going, then I attend the dinner.
Inv: ~P Q If I don’t attend the dinner, then you are going.
Contra: Q ~P If you are going, then I don’t attend the dinner.
8
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
d) P: Mary is lazy Q: Mary attends all the lectures R: Mary fails MAT110
(P ~ Q) R
Conv: R (P ~ Q) : If May fails MAT110, then she is lazy or doesn’t attend all the lectures.
Inv: ~(P ~ Q) ~R equiv to (~P Q) ~R
If Mary is not lazy and attends all the lectures, then Mary will not fail MAT110.
Contra+: ~R (~P Q)
If Mary does not fail MAT110, then she is not lazy and attends all the lectures.
Eg 1: Show that ~(P (~P Q)) and ~P ~Q are logically equivalent using truth table and laws of
logic.
4 3 1 2 1 3 2
9
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
Switching Networks
Logical expressions can be used to represent switching networks from a terminal A to terminal B.
Parallel switches are combined using disjunction, and serial switches are combined using conjunction,
.
P
A B A P Q B
Q
PQ PQ
a) P b) ~P R
~R
R ~Q
P Q
10
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
~P
P
~Q
11
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
12
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
(i) P ii) P ~Q
Q A B
A Q B ~Q R
R
Q
P
R
13
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
5.5 Arguments
Defn: A statement P logically (or tautologically) implies Q iff P Q is a tautology, denoted by P Q.
Arguments: A sequence of statements (premise) of the form (H1 H2 … Hn) K. H1, H2, … , Hn
are called the hypotheses (or premises) and K is the conclusion of the argument. A valid argument is an
argument whereby if the hypotheses are true, then the conclusion is also true, i.e. (H1 H2 … Hn)
K is a tautology.
b) 2 1 4 3 6 5
P Q R ((Q ~R) (P Q)) (P R)
T T T TF T T T T
T T F TT T T F F
T F T FF T F T T
T F F TT F F T F
F T T TF T T T T
F T F TT T T T T
F F T FF T T T T
F F F TT T T T T
(CONTINGENCY) => ARGUMENT INVALID
14
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
15
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
b) H1: p q
H2: q r
H3: p q
K: r
If Sally is not sick then she will exercise. If she is sick then she will stay at home. If she stays at home,
then she will go to sleep. Sally does not go to sleep.
i) Declare the primitive propositions using symbols p, q, r and s.
ii) Write the premises of the argument using those symbols.
iii) Find the conclusion of the argument using the rules of inference
If Ally is well behaved then his mother will give him a reward.
Write the contrapositive of the above statement in both symbols and words.
16
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
H1: (~P V Q) R
H2: R (S V T)
H3: ~S ~W
H4: ~W ~T
K: P
1) ~W - H3, SIMPLIFICATION
2) ~T - 1) & H4, M.P.
3) ~S - H3, SIMPLIFICATION
4) ~S ~T - 3) & 2), CONJUNCTION
5) ~(S V T) - 4), DeMorgan
6) ~R H2 & 5), MT
7) ~(~P V Q) H2 & 6), MT
8) ~~P ~Q 7), DeMorgan
9) P ~Q 8), DOUBLE NEGATION
10) P 9), SIMPLIFICATION
17
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
a) Use variables p, q, r, s to represent the four primitive statements given in the argument above.
b) Rewrite the argument in symbolic form.
c) Use rules of inference to establish the validity of the argument.
18
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
5. “If today is Monday, then I have Mathematics or a Programming lecture. If the mathematics lecturer
is sick, then the lecture is cancelled. Today is Monday and the Mathematics lecturer is sick.”
a) Use p, q, r and s to represent the four primary statements given in the argument above.
b) Write down the three hypotheses.
c) Use the rule of inference to establish a conclusion from (b) above.
“If we go to Langkawi, then we can go shopping. If we go shopping, then we have to spend extra
money. We do not want to spend extra money.”
19
MAT 110/210 CHAPTER 5 FUNDAMENTALS OF LOGIC
20