0% found this document useful (0 votes)
53 views26 pages

Logic and Boolean Algebra (2023 - 2024) Student Handouts Nos. 1 and 2 and 3

The document covers propositional logic, including definitions of propositions, connectives, and Boolean expressions. It explains the use of truth tables to evaluate the truth values of compound statements, detailing concepts such as tautologies, contradictions, and contingencies. Additionally, it provides examples and exercises to illustrate the application of these concepts in logical reasoning.

Uploaded by

Sean
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)
53 views26 pages

Logic and Boolean Algebra (2023 - 2024) Student Handouts Nos. 1 and 2 and 3

The document covers propositional logic, including definitions of propositions, connectives, and Boolean expressions. It explains the use of truth tables to evaluate the truth values of compound statements, detailing concepts such as tautologies, contradictions, and contingencies. Additionally, it provides examples and exercises to illustrate the application of these concepts in logical reasoning.

Uploaded by

Sean
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
You are on page 1/ 26

2023 - 2024 CAPE Mathematics Unit 1 Module 1: Basic Algebra and Functions

REASONING AND LOGIC – Handout # 1


1.1 − Propositional Logic

In propositional logic, statements, some of which can be termed propositions are used which
consists of a collection of symbols which form an assertion. An assertion can be definitely true,
definitely false or neither. The letters p, q and r are commonly used to represent statements or
propositions. The symbols used are known as connectives. A collection of symbols and letters
combined is termed a Boolean expression. Statements that do not include any of the connectives
are known as simple statements. When two or more simple statements are connected by a
connective or when the symbol ~ is used; the resulting statement is called a compound
statement or complex statement or, a compound proposition or complex proposition.

Commonly used connectives:


Connective Symbol Meaning
and  conjunction
inclusive or  injunction
exclusive or  disjunction
not ~ negation
If … then … → Conditional (or unless)
q only if p or p implies q  implication
if p then q and if q then p ↔ bi-conditional
…if and only if…  or ≡ equivalence

Any simple statement or connective of two or more simple statements that make up a part or all
of a compound statement is called a component of the compound statement.

Note:
(1) and, inclusive or, exclusive or, and not are interpreted in a similar manner as in set
theory; respectively as intersection, union, mutually exclusive and complement.

(2) Inclusive or represents a disjunction for which either or both statements may be true.
For example, ‘a right-angle measures 900 or the angle formed between two perpendicular lines
is a right-angle’ is inclusive, as either or both statements is true.

1
(3) Exclusive or represents a disjunction for which either statement may be true but
not both. For example, ‘When a coin is tossed once, a HEADS or a TAILS is obtained’ is
exclusive as either statement will be true but not both.
N.B. In mathematics, when or is used, it is normally meant to be inclusive.

(4) A tautology is a compound statement that is always true regardless of the truth or falsity
of the simple components.
A contradiction is a statement that is never true.
In general, two statements are contradictory if when the first is true, the second is false,
and when the first is false, the second is true.

(5) When a conditional p → q is a tautology; we write p  q (p implies q).


A conditional that is a tautology is called an implication.
When a bi-conditional p ↔ q is a tautology, p and q necessarily have the same truth values,
and are therefore equivalent; and when a bi-conditional is a tautology and therefore an
equivalence, it is often symbolized as  . Equivalence is often denoted by ≡.

Example 1.1 (i)


Write down a Boolean expression to represent each of the following statements:
(a) A car has a trunk and four wheels.
(b) I will ride on the bus or read a book.
(c) I will not fail this test.

Step 1:
Use letters to identify individual elements of the given statement or proposition.
Step 2: Use the appropriate connective.

So let: p represent the statement ’A car has a trunk’; q represents the statement ‘A car has four
wheels’; r represents the statement ‘I will ride on the bus’; s represents the statement ‘I will read
a book’; t represents the statement ‘I will fail this test’.

2
Solution 1.1 (i)
(a) p  q (b) r  s (c) ~ t

Example 1.1 (ii)


Write down a Boolean expression to represent each of the following propositions:
(a) If I study, then I will pass my examinations.
(b) If I score more than 80 marks on the mathematics examination, I will receive an A grade,
and if I receive an A grade, my score will be more than 80 marks.

Solution 1.1 (ii)


Let u represent the statement ‘I will study’; v represents the statement ‘I will pass my
examinations’; w represents the statement ‘I receive an A grade’; and x represent the statement
‘my score is more than 80 marks’.
(a) u → v. Note, this statement can also be worded as “I will not pass my examinations unless
I study; i.e., ~ v → ~ u
(b) x ↔ w OR x w OR x≡w

Exercise 1.1
Let p represent “I am unwell”
Let q represent “I have a high fever”
Let r represent “I am in bed”
1. Express the following in words
(a) ~ p (b) ~ q (c) p  ~ r (d) p  r (e) q → p (f) ~ p → ~ r
(g) r → p (h) (~ p  ~ q) → ~ r (i) (p → q)  (q → r) (j) q ↔ r
2. Express the following using letters and logic symbols:
(a) It is midnight and I am not at school.
(b) If it is midnight then I am not at school.
(c) I am writing an examination or I am at school.
(d) If it is midnight then I am not at school and not writing an examination.
(e) If I am at school then I am writing an examination, ALTERNATIVELY, If I am not
writing an examination then I am not at school.

3
1.2 − Truth Tables
In mathematical logic, as generally in life, statements can be at times true and at times untrue,
that is, false. In addition, some statements are always true or always false and some are neither.
A truth table provides us with a mechanism of determining whether a compound statement or
compound proposition will be true, false or neither by examining the truth value of each of the
possible combination of components.

In the truth table, the traditional approach uses T to represent true and F to represent false, but in
this age of computing, it is customary to replace F and T by 0 and 1 respectively.
From our experiences in Section 1.1 we can conclude that for example, if statement p is true then
the statement not p is false and vice-versa. Thus, the two statements p and ~ p are therefore
contradictory. This can be summarized in a truth table as follows:
p ~p
F or 0 T or 1
T or 1 F or 0

Example 1.2 (i)


(i) Construct a truth table for the conjunction of p and q.
(ii) Determine whether the conjunction of p and q is a tautology, a contradiction or neither.
Note: A CONTINGENCY is a compound proposition that is neither a tautology nor
a contradiction.
Solution 1.2 (i)
(i) The conjunction of ‘p and q’ is the statement ‘p and q’ written p  q, and is considered true
if the statements p and q are both true.
p q pq
F F F
F T F
T F F
T T T
Alternatively, we can write

4
p q pq
0 0 0
0 1 0
1 0 0
1 1 1

(ii) The statement p  q is sometimes true, sometimes false, so it is neither a tautology nor
a contradiction. It is a contingency.

Notice that our table has a column for each of the inputs p and q, and a last column for the final
statement. This last column contains the truth value for each of the possible combinations of p
and q. Each row is dedicated to a possible combination of p and q with an associated truth value,
until all the possible combinations are exhausted. For example, referring to the fourth and second
lines in the table:
(a) when p is true and q is true then p  q (p and q) must be true,

(b) when p is false and q is true then p  q (p and q) must be false.

The statement p  q is only true when both inputs are true and is false otherwise for the
connective and.

Notice the order in which the combinations of 1 and 0 were listed. Counting in binary, from 0 0
to 1 1, ensures that no combination is left out, and also enables us to have standard truth tables.
Therefore, in other words, truth tables enable us to study how the various combinations of truth
values for p and q and their negations affect compound propositions.

Example 1.2 (ii)


(i) Construct a truth table for the injunction of p and q.
(ii) Determine whether the injunction of p and q is a tautology, a contradiction or neither.

5
Solution 1.2 (ii) (“is there any truth in that”)

(i) The injunction of ‘p and q’ is the statement ‘p or q’ written p  q, and we use the inclusive or.
‘p or q’ is true if the statement p or the statement q is true.
p q pq
0 0 0
0 1 1
1 0 1
1 1 1

(ii) The statement p  q is neither a tautology nor a contradiction.


Note, referring to the fourth and second lines in the table:

(a) when p is true and q is true, then p  q (p or q) must be true,

(b) when p is false and q is true, then p  q (p or q) must be true,

The statement p  q is only false when both inputs are false and is true otherwise for the
injunction or.

Practise Problem 1.2 (iii)


Use truth tables to decide whether the following statements are tautologies, contradictions or
neither.
(a) p  ~p (b) p  ~p.
Solution 1.2 (iii)(a)
p ~ p p~ p
0 1 0
1 0 0
This statement is never true, so it is a contradiction.
Solution 1.2 (iii)(b)
p ~ p p~ p
0 1 1
1 0 1
This statement is always true, so it is a tautology.

6
Practise Problem 1.2 (iv)
Use truth tables to compare the statements: ~ (p  q) and ~ p  ~ q.
Solution 1.2 (iv)
For ~ (p  q), we have
p q p  q ~(p  q)
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0
For ~p  ~q, we have
p q ~p ~q ~p  ~q
0 0 1 1 1
0 1 1 0 1
1 0 0 1 1
1 1 0 0 0
The two statements are the same.

Exercise 1.2 (A)


1. Given that p represents the statement ‘I will practise’, express the following statement in
logic notation: ‘Either I will practise or I will not practise’. Ans. p  ~ p

2. (i) Construct a truth table to show the truth values of p  ~ q.


(ii) Determine whether p  ~ q is a tautology, a contradiction or neither. Ans. Neither

3. (i) Construct a truth table to show the truth values of ~ p  q.


(ii) Determine which truth value of p and of q makes ~p  q true. Ans. p = 0, q = 1

4. (i) Construct a truth table for the statement p  ~ q.


(ii) Determine which truth value of p and of q makes p  ~q true. Ans. p = 1, q = 0

End of Handout # 1

7
2023 - 2024 CAPE Mathematics Unit 1 Module 1: Basic Algebra and Functions

REASONING AND LOGIC – Handout # 2


1.2 − Truth Tables (Continued)

Conditionality
Let p and q be statements. A conditional is a statement of the form if p then q (p → q). The
conditional maybe considered to have the following requirement: In every circumstance under
which p is true, it is required that the statement q should also be true. Note
(i) In a statement under which p is false, no requirement is made
(ii) The statement ‘if p then q’ does not assert that the statement p is true. It merely asserts
that every single time the statement p is true, it also happens that q is true.

The statement p in a conditional, p → q is called the hypothesis and q is called the conclusion.
Alternatively, p is the antecedent and q is the consequent.

Examples of conditionals
If 1 + 2 = 5 then 9 + 4 = 5 → (True) (1) (start wrong, likely to end wrong) (TRUE)
If 1 + 2 = 5 then 9 + 4 = 13 → (True) (2) (start wrong, can end right) (TRUE)
If 1 + 2 = 3 then 9 + 4 = 5 → (False) (3) (start right, can end wrong) Not Likely (FALSE)
If 1 + 2 = 3 then 9 + 4 = 13 → (True) (4) (start right, likely to end right) (TRUE)
Let us examine the truth value for the conditional p → q for all the possible combinations of
truth values for p and q.
p q p→q Line
0 0 1 (1)
0 1 1 (2)
1 0 0 (3)
1 1 1 (4)

We can apply these values to each row of the table:


(1) If p and q are both false, p → q is true.
(2) For p → q when the first proposition is false, we define p → q as always being true.
(3) For p → q when the first proposition is true and the second false, we define p → q as
being false.

8
(4) If p and q are both true, p → q is true.
These results can be applied to all propositions.

This truth table always seems strange at first sight. This truth table arises because we consider a
statement to be true unless we can prove it to be false (innocent until proven guilty). The only
way to prove an if… then … statement false is for the first part to happen, and then for the
second part to fail to happen. For example, if a teacher said to you: if you buy this book, you will
pass your exam, you might:
➢ Not buy the book - in which case you could never prove that the teacher was lying. This
is represented in the first two lines of the truth table.
➢ Buy the book and fail - in which case you decide the teacher was lying (or perhaps the
teacher meant you had to read it as well!) – the third line.
➢ Buy the book and pass - in which case the teacher appears to be telling the truth – the
fourth line.

Note: If you start with a false assumption, you can prove anything to be true.

Example 1.2 (v)


Given p: It is Sunday.
q: I will go to the library.
Express the following statements in logic notation.
(i) If it is Sunday then I will not go to the library.
(ii) If it is not Sunday then I will go to the library.
Solution 1.2 (v)
(i) p → ~ q (ii) ~ p → q

Implication
Consider the following three propositions:
(a) If I study well then I will pass my mathematics examination.
(b) If there is a hurricane then school will be closed.
(c) If x > 4 then 3x > 12.

9
In each of these examples the first part of the sentence implies the second part. In logic notation
we write an implication as p  q, where the symbol  represents the word ‘implies’. We will
now consider the truth value for the implication p  q for all the possible combinations of truth
values for p and q. To help you understand the logic we will use specific propositions for p and q
although one should appreciate that the results can be applied to all propositions.

Consider the following statements concerning a natural number n.


p: n is the square of an even number
q: n is a multiple of 2
r: n is an even number

Then the statement q is true if p is true, but q is true only if r is true. Hence, p  q  r, that is, if
p  q and q  r, then p  r. So, if p is true then r is also true.
The truth of r is a necessary condition for q to be true, but p is a sufficient condition for q to be
true.

Clearly implication signs provide the most economical way of expressing connections between
statements. The process of deduction is based on a law of implication which we can now state in
the form: if a  band b  c, then a  c.

Example 1.2 (vi)


Given p: I will practise.
q: I will pass the driving test.
Express the following statements in logic notation.
(i) If I practise then I will pass the driving test.
(ii) I won’t pass the driving test unless I practise.
(iii) If I do not practise then I will not pass the driving test.

Solution 1.2 (vi)


(i) p  q (ii) p  q OR ~ q  ~ p (contrapositive) (iii) ~ p  ~ q (inverse)

10
For implication, we have
p q p q
(a) 0 (or F) 0 (or F) 1 (or T)
(b) 0 (or F) 1 (or T) 1 (or T)
(c) 1 (or T) 0 (or F) 0 (or F)
(d) 1 (or T) 1 (or T) 1 (or T)

We can apply these values to each line of the table.

(a) If p and q are both false, p  q is true since p is false.

(b) We have a problem here in deciding the truth value for p  q when the first proposition

is false (F). To avoid this problem, we define p  q as always being true when p is false.
Remember this definition, as it occurs frequently.

(c) If p is true and q is false, so p  q is false.

(d) If p and q are both true, so p  q is true.

Therefore, when we examine the statement p  q, the resulting truth table is

p q pq
(a) 0 (or F) 0 (or F) 1 (or T)
(b) 0 (or F) 1 (or T) 1 (or T)
(c) 1 (or T) 0 (or F) 0 (or F)
(d) 1 (or T) 1 (or T) 1 (or T)

Contrapositive
The contrapositive of p → q is ~ q → ~ p.
Consider the following statements:
p: x < 5, x ∈ R
q: x < 7, x ∈ R
p  q is true since if x is less than 5 then x is also less than 7. This implication can be rephrased
without losing its meaning. ‘If x is not less than 7 then x is not less than 5.’ This statement is
written as ~ q  ~ p and is called the contrapositive of p  q.

11
Example 1.2 (vii)
Given the statements:
p: Andrew is a pilot
q: Andrew flies planes
Express in words the contrapositive of p  q.

Solution 1.2 (vii)


Recall, the contrapositive of p  q is ~ q  ~ p.
So ‘If Andrew does not fly planes, then he is not a pilot.
[Note, this can also be written as: ‘Andrew does not fly planes unless he is a pilot.’

Exercise 1.2 (B)


1. (i) Copy and complete the truth table for the contrapositive of p → q.
p q p→q ~q ~p ~q→~p
0 0
0 1
1 0
1 1

(ii) Copy and complete the following statement: ‘~ q → ~ p is … p → q.’


Ans.

2. Show that
[p  (q  r)] → [(p  q)  r] represents a tautology.

Inverse
Consider the following statements:
p: x > 20, x ∈ Z
q: x > 25, x ∈ Z
p → q means ‘If x is greater than 20 then x is greater than 25.’ Therefore, the inverse of p → q is
~ p → ~ q, which means: ‘If x is not greater than 20 then x is not greater than 25.’ Note that the
inverse statement does not have the same meaning as the original statement.

12
Example 1.2 (viii)
Construct a truth table to show the truth values for p → q and ~ p → ~ q.
p q p→q ~p ~q ~p→~q
0 0 1 1 1 1
0 1 1 1 0 0
1 0 0 0 1 1
1 1 1 0 0 1

Converse
Consider the following statements:
p: x > 25, x ∈ Z
q: x > 20, x ∈ Z
p → q means ‘If x is greater than 25 then x is greater than 20.’
The converse of this is q → p, which means: ‘If x is greater than 20 then x is greater than 25.’
The converse statement does not have the same meaning as the original statement.

The truth table for the converse of p → q is shown below:


p q p→q q→p
0 0 1 1
0 1 1 0
1 0 0 1
1 1 1 1

Note p → q and q → p are not the same.


Notice that the truth tables for ~ p → ~ q (see Example 1.2 (viii)) and q → p are the same, that
is, the inverse and converse of a statement / proposition are the same (i.e., EQUIVALENT).

Bi-conditional
A way of writing two conditionals at once: both a conditional and its converse. When the
converse of a true conditionality is also true, then such a situation is described as a bi-
conditional. So, if p and q are statements, a bi-conditional is ‘if p then q and if q then p’, written

13
p ↔ q. Let us construct a truth table for the compound statement: p ↔ q. Note that p ↔ q means
the same as (p → q)  (q → p).
p q p → q q → p (p → q)  (q → p)
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
Hence,
p q p↔q
0 0 1
0 1 0
1 0 0
1 1 1

This table shows that p ↔ q is only true when:


(i) both p and q are true, or (ii) both p and q are false.

Example 1.2 (ix)


Construct a truth table for the following compound statement: (~ p  q)  (q → p)

Solution 1.2 (ix)


Starting with the usual combination of inputs for p and q, we have:
p q ~ p ~ p  q q → p (~ p  q)  (q → p)
0 0 1 1 1 1
0 1 1 1 0 0
1 0 0 0 1 0
1 1 0 1 1 1
Notice that the compound statements (~ p  q)  (q → p) and p ↔ q are logically equivalent.

14
Example 1.2 (x)
Use a single truth table to show that the statements ~ p  ~ q and ~ (p  q) are the same.
Solution 1.2(x)
p q ~ p ~ q ~ p  ~ q p  q ~ (p  q)
0 0 1 1 1 0 1
0 1 1 0 1 0 1
1 0 0 1 1 0 1
1 1 0 0 0 1 0

As the truth values in column 5 are identical to that of column 7, then ~ p  ~ q and ~ (p  q) are
identical, given the same combination of inputs. Hence, the two statements are equivalent.

Equivalence / Two-way implication


Consider the implication:
p = q  – p = – q where p R, q R (True).
The converse of this implication is:
–p = –q  p = q.

Recall 1:
For x R, if for the equation (x – 2)(x – 5) = 0 → the roots are x = 2 and x = 5, which is a
tautology.
∴(x – 2)(x – 5) = 0  x = 2 and x = 5.
The converse of this implication is the quadratic equation with roots x = 2 and x = 5
 (x – 2)(x – 5) = 0.
So (x – 2)(x – 5) = 0  x = 2 and x = 5 OR (x – 2)(x – 5) = 0 ≡ x = 2 and x = 5

Recall 2: When a conditional p → q is a tautology; we write p  q (p implies q).


A conditional that is a tautology is called an implication.

15
When a bi-conditional p ↔ q is a tautology, p and q necessarily have the same truth values, and
are therefore equivalent; and when a bi-conditional is a tautology and therefore an equivalence, it
is often symbolized as  . Equivalence is often denoted by ≡.

When the converse of a true implication is also true then such a situation is described as a two-
way implication or equivalence. For example, if today is Sunday, then it is the first day of the
week; the converse, if today is the first day of the week, then it is Sunday. The symbol for
equivalence is  and can be read as: ‘is equivalent to’ or ‘if and only if’. The truth table for
equivalence is shown below. The table shows that p  q is only true when:
(i) both p and q are true, or
(ii) both p and q are false.

p q pq qp p q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1

Alternatively, we can construct a truth table for the statement: p  q


This table will be constructed by remembering that p  q means the same as (p  q)  (q  p).
(Note the use of brackets to ensure that the statement is unambiguous).
Constructing the table for this compound statement, we get

p q p  q q  p (p  q)  (q  p)
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1

Note that it is often helpful to highlight the column representing the overall statement. This is
always the last column to be filled in. Hence

16
p q pq
0 0 1
0 1 0
1 0 0
1 1 1

Example 1.2 (xi)


Evaluate the bi-conditional [p  (p  q)] ↔ p
Solution 1.2 (xi)
p q p  q p  (p  q) [p  (p  q)] ↔ p
0 0 0 0 1
0 1 0 0 1
1 0 0 1 1
1 1 1 1 1

So [p  (p  q)] ↔ p is a tautology

RECALL: Example 1.2 (xii)


Use truth tables to show that the statements
~ p  ~ q and ~ (p  q) are equivalent.

Solution1.2 (xii)
We construct the truth tables for each statement separately, and note that the final result is the
same in each case.
p q ~ p ~ q ~ p~ q p q p  q ~ (p  q)
0 0 1 1 1 0 0 0 1
0 1 1 0 1 0 1 0 1
1 0 0 1 1 1 0 0 1
1 1 0 0 0 1 1 1 0

17
This shows that the overall value of each statement is the same, given the same combination of
inputs, so the two statements are equivalent.
It is important to realise that if two statements are equivalent, then if one is true the other must be
true, and if one is false the other must be false.

This leads to a different way of setting out our solution. Rather than constructing two separate
truth tables, we construct a single table for the compound statement ~ p  ~ q  ~ (p  q). This
has the advantage of not needing duplicate columns for p and q.

p q ~ p ~ q (~ p  ~ q) (~ p  ~ q)  ~ (p  q) (p  q) ~ (p  q)
0 0 1 1 1 1 0 1
0 1 1 0 1 1 0 1
1 0 0 1 1 1 0 1
1 1 0 0 0 1 1 0

Here we have used bold to indicate the main connective in each of the separate statements, and
then highlighted the column giving the value of  . Since this final column is all 1’s, we
conclude that ~ p  ~ q  ~ (p  q) is a tautology and so the two statements are equivalent.

Exercise 1.2 (C)


1. Construct a truth table for the following compound statement: (~ p  q)  (p  ~ q)
2. Show that the statements ~ (p  q) and ~ p  ~ q are equivalent.
3. Construct truth tables to determine which of the following statements are
tautologies, contradictions or contingencies.
(a) [p  (p → q)] → q Ans. tautology
(b) [(p  q)  (p → r)] → r Ans. tautology
(c) [(p  q)  (p → r)] → r Ans. contingency
(d) [(p → q)  ~ q] → ~ p Ans. tautology
(e) ~ (p  ~ q) → ~ p Ans. tautology

End of Handout # 2

18
2023-2024 CAPE Mathematics Unit 1 Module 1: Basic Algebra and Functions

REASONING AND LOGIC – Handout # 3


1.3 - Boolean Algebra
Boolean algebra is named in honor of George Boole who developed the idea in 1847, and is used
to describe the rules which can be used to manipulate statements of the form that we have
previously encountered. It is based upon the idea of equivalent expressions. Many of these rules
are based on the work done with Venn diagrams, and apply to concepts in set theory.

Laws of Algebra of Propositions


For ease of understanding; Truth, 1, is equivalent to the Universal Set and False, 0, is
equivalent to the Empty Set. Recall, the Empty Set is a subset of every set.
Identity rules
pp ≡ p pp ≡ p
p  1≡1 p  1≡p
p0 ≡ p p0 ≡ 0

Complement rules
p~ p ≡ 0
p~ p ≡ 1

Distributive rules
p  ( q  r) ≡ (p  q)  (p  r)
p  ( q  r) ≡ (p  q)  (p  r)

Associative rules
p  ( q  r) ≡ (p  q)  r
p  ( q  r) ≡ (p  q)  r

Commutative rules
pq ≡ qp p→q≠q→p
pq ≡ qp p↔q≡q↔p

19
Double negation
~ (~ p) ≡ p

Absorption rules
p  ( p  q) ≡ p
p  (p  q) ≡ p
Hence, p  ( p  q) ≡ p  (p  q)

De Morgan’s rules
~ (p  q) ≡ ~ p  ~ q
~ (p  q) ≡ ~ p  ~ q

Practise Problem 1.3 (i)


Using rules of Boolean algebra, prove that (p  q)  ( p  r) ≡ p  (q  r)

Solution 1.3 (i)


(p  q)  (p  r) ≡ p  (q  r)
Proof: Using Left Hand Side
(p  q)  (p  r)
=p  (q  r) distributive rule
≡ RHS

Practise Problem 1.3 (ii)


Simplify the expression p  (~ p  q).

Solution 1.3 (ii)


p  (~ p  q)
= (p  ~ p)  (p  q) Distributive rule
=1  (p  q) Complement
= (p  q) Identity

20
Practise Problem 1.3 (iii)
Using rules of Boolean algebra, prove that [(q  p)  ( q  r)]  (~ p  q) ≡ q  ~p  r

Solution 1.3 (iii)


Proof: LHS
[(q  p)  (q  r)]  (~ p  q)
= [q  (p  r)]  (~ p  q) distributive rule
=q  (p  r)  ~ p  q removing unnecessary [ ] brackets, and the unnecessary last ( )
brackets
=q  q  (p  r)  ~p commutative rule
=q  (p  r)  ~ p identity
=q  [~ p  (p  r)] (commutative rule) this step can be omitted
=q  [(~ p  p)  (~ p  r)] distributive rule
=q  [0  (~ p  r)] complement
=q  [~ p  r] identity
≡q  ~p  r removing [ ] brackets
≡ RHS

Exercise 1.3
Using rules of Boolean algebra, prove the following statements

1) (p  q)  (p  ~ q) ≡ p
2) p  [( q  r)  ( q  ~ r)] ≡ p  q
3) ~ p  (~ q  p) ≡ ~ (p  q)
4) Using and stating the appropriate rule(s) of Boolean algebra
prove that ~ (p  q)  (p  ~ q) ≡ ~ q.
5) Using and stating the appropriate rule(s) of Boolean algebra
prove that (p  q)  (p  q) ≡ (p  q).

21
BONUS Exercise 1.4
Use the laws of the algebra of propositions to prove the following statements
1) p  (p → q) ≡ (p  q)
Hint: (p → q) ≡ ~ p  q, (called conditional disjunction). See also sample
examination Question 1 (Essay) and multiple-choice Sample Examination Question 4

2) (p  q)  ~p≡~p  q

3) ~ (p → q) ≡ p  ~q Use hint in Question 1)

4) ~ (p  ~ q)  (~ p  ~ q) ≡ ~ p

Sample Examination Questions (Essay)

1. Let p and q be given propositions.


(i) Copy and complete the table below to show the truth tables of p → q and ~p ∨ q. [3]

p q ~p p→q ~p∨q

(ii) Hence, state whether the compound propositions p → q and ~p ∨ q are


logically equivalent, stating reasons for your answer. [2]

(iii) Use the algebra of propositions to show that p ∧ (p → q) = p ∧ q. [3]

Solution
1. (i)

p q ~p p→q ~p∨q
0 0 1 1 1
0 1 1 1 1
1 0 0 0 0
1 1 0 1 1

T = true F = false [1 may be used for T and 0 for F]. [3]

(ii) p → q and ~ p  q are logically equivalent since columns 4 and 5 are identical. [2]

22
(iii) p ∧ (p → q) = p ∧ (~ p ∨ q) from part (i) above (1)
= (p ∧ ~ p ) ∨ (p ∧ q) … distribute ∧ over ∨
= 0 ∨ (p ∧ q) complement (1)
= (p ∧ q) identity (1)
2. Given that p and q are two propositions
(i) State the converse of p → q. [1]
(ii) Show that the contrapositive of the inverse of p → q is the converse of p → q. [2]

Solution

2. (i) The converse of p → q is q → p

(ii) The inverse of p → q is ~ p → ~ q


The contrapositive of ~ p → ~ q is ~ ~ q → ~ ~ p which is q → p

3. Let p and q be two propositions. Construct a truth table for the statements

(i) p → q (ii) ~ (p  q) [3]

Solution
(i) p → q

p q p→q
0 0 1
0 1 1
1 0 0
1 1 1
(ii) ~ (p  q)

p q (p  q) ~ (p  q)
0 0 0 1
0 1 0 1
1 0 0 1
1 1 1 0

4. Let p, q and r be three propositions. Construct a truth table for the statement
(p → q) (r → q). [5] (2014)

23
Sample Examination Questions (Multiple Choice)

1. Let p, q and r be the propositions

p: Students have a driving licence,


q: Students have a passport,
r: Students have an identification card.

The compound proposition, students have a driving licence or identification card (but not both)
together with a passport is expressed as

(A) [(p  r)  ~ (p  r)]  q


(B) [(p  r)  ~ (p  r)]  q
(C) [(p  r)  ~ (p  r)]  q
(D) [(p  r)  ~ (p  r)]  q

2. The compound proposition p  q is true can be illustrated by the truth table

(A)
p q pq
0 0 0
0 1 0
1 0 0
1 1 1
(B)
p q pq
0 0 1
0 1 0
1 0 0
1 1 1
(C)
p q pq
0 0 0
0 1 0
1 0 1
1 1 1
(D)
p q pq
0 0 1
0 1 0
1 0 1
1 1 0

24
3. The contrapositive for the conditional proposition p → q is
(A) q → p
(B) ~ p → q
(C) ~ q → ~ p
(D) p → ~ q

4. The proposition q → p is logically equivalent to

(A) ~ p  ~ q
(B) p  ~ q
(C) ~ q  p
(D) q  ~ p

Points to Note
(1) p and q can represent any statement (or proposition).
(2) A tautology is a compound proposition that is always true.
(3) A contradiction is a compound proposition that is always false.
(4) The compound proposition p  q is only true when both p and q are true.
(5) The compound proposition p  q is only false when both p and q are false.
(6) The contrapositive of p → q is ~ q → ~ p. These two propositions are equivalent, that is,
p → q  ~ q → ~ p or we can write p → q ≡ ~ q → ~ p.
(7) The inverse of p → q is ~ p → ~ q.
(8) The converse of p → q is q → p.
(9) The converse and the inverse are equivalent, that is, q → p  ~ p → ~ q or we can write
q → p ≡ ~ p → ~ q.

End of Handout # 3

25
Reasoning and Logic

SOME ANSWERS

Exercise 1.1

1. (a) I am well
(b) I do not have a high fever
(c) I am unwell and I am not in bed
(d) I am unwell or I am in bed
(e) If I have a high fever, then I am unwell
(f) If I am well, then I am not in bed
(g) If I am in bed, then I am unwell
(h) If I am well and do not have a high fever, then I am not in bed
(i) If I am unwell then I have a high fever, and If I have a high fever then I am in bed
(j) If I have a high fever then I am in bed, If I am in bed then I have a high fever

2. Let p represent “It is midnight”


Let q represent “I am at school”
Let r represent “I am writing an examination”

a) p  ~q
b) p → ~q
c) r  q
d) p → (~q  ~r)
e) q → r OR ~ r → ~ q

End of Handout # 3 (Final on Topic)

26

You might also like