AdvancedMath Logic F5 Loibanguti (2022)
AdvancedMath Logic F5 Loibanguti (2022)
Page 1 of 32
Advanced Secondary Education
Physical Address;
Baraka Loibanguti,
P.O Box 687,
Songea Town,
Ruvuma Tanzania.
Or
Baraka Loibanguti,
P.O Box 7462,
Arusha,
Tanzania.
Page 2 of 32
Advanced Secondary Education
To my wife Caroline
Page 3 of 32
Advanced Secondary Education
LOGIC Chapter
PROPOSITIONS
A proposition is a statement that is either true or false but not both or neither.
Proposition are denoted by letters just as letters used in algebra. The most
common letter used to represent propositions are p , q and r although any other
letter may be used.
Page 4 of 32
Advanced Secondary Education
Sentence is a group of words to give out the meaning phrase. This book is not
discussing more about sentences but propositions (statements).
Example of propositions
(a) Arusha is a capital city of Tanzania
(b) You are a single girl.
(c) Dar Es Salaam is the city in Eastern Tanzania
(d) Kampala is a capital city of Kenya
(e) 3 + 5 = 8
(f) 2 + 2 = 22
The propositions (a), (d) and (f) are false whereas propositions (c) and (e) are true
statements, (b) is neither true nor false, it is hard to tell (this is not a proposition).
Each sentence in this list is the kind of thing to which we might assent or dissent.
We may agree or disagree, believe or disbelieve, or simply be undecided, about
each of these claims.
Not every sentence is proposition; Sentences such as those expressing emotions,
greeting, asking questions or making requests are not propositions.
Example of sentences, which are not propositions: Questions, emotion expression,
commands, etc.
(a) What is your name?
(b) Hello! How are you?
(c) Where is my book?
(d) 3x + 1 = 7
(e) x + y = z
(f) I am very happy today!
All these are not propositioning. Propositions are the sorts of things that can be
true or false. In the study of logic, we are interested in relationships between
propositions, and the way in which some propositions can act as reasons for other
propositions. These reasons are what we call arguments.
An argument is a list of propositions, called the premises, followed by a word such
as ‘therefore’, or ‘so’, and then another proposition, called the conclusion.
Example of an argument.
“If I study Mathematics, I will not study physics. I am studying physics; therefore, I
am not studying Mathematics”
The first two sentences
(a) If I study Mathematics, I will not study Physics.
(b) I am studying Physics.
Page 5 of 32
Advanced Secondary Education
Are premises, while the last sentence
(c) Therefore, I am not studying Mathematics.
Is a conclusion
For an argument to be good is for the premises to guarantee the conclusion. That
is if the premises are true then the conclusion has to be true. These good
arguments are called valid arguments. Generally, an argument is valid if and only
if whenever the premises are true, so is the conclusion. In other words, it is
impossible for the premises to be true while at the same time the conclusion is
false.
Consider the next argument below
“If people are mammals, they are not cold-blooded. People are cold-blooded.
Therefore, people are not mammals”
Note that, the argument may be invalid in real life but valid logically. Example of
the argument that is invalid in real life but valid logically
“If human are cold blooded animals, then they are reptilians, human are cold
blooded animas. Therefore, they are reptilians”.
This argument is invalid in real world; we need to be careful here because logically
this argument is valid.
This is clearly a valid argument, but no one in his or her right mind would believe
the conclusion. That is because the premises are false. Well, the second premise
is false—but that is enough. One premise being false is enough for the argument
to be bad. The bad arguments are called invalid arguments.
Sometimes we do not have enough information in our premises to guarantee the
conclusion, but we might make the conclusion more likely than it might be
otherwise. We say that an argument is inductively strong if, given the truth of the
premises, the conclusion is likely. An argument is inductively weak if the truth of
the premises does not make the conclusion likely. The study of inductive strength
and weakness is the study of inductive logic. We will not explore inductive logic in
this book. We will concentrate on what is called deductive logic — the study of
validity of arguments.
Page 6 of 32
Advanced Secondary Education
• Be warned—an argument can be an instance of an invalid form, while still
being valid.
Logic is all about reasoning. Letters are used to denote propositions just as letters
used to denote variables in algebra.
From the book of Thought written by English Mathematician George Boole 1954,
we have methods of producing new propositions from those that we already have.
Many Mathematical statements are constructed by combining one or more
propositions.
Definition: “Compound proposition is formed from existing proposition using logical
operators. These are mathematical statements constructed by combining two or
more propositions”
TRUTH TABLE
The truth table displays the relationship between the truth-values of proposition.
The truth table are especially valuable in the determination of the truth-values of
propositions constructed from simpler propositions. To construct the truth table,
follow steps below: -
(i) First column has T = 2n −1 and F = 2n −1 truth values
(ii) The second column has T = 2n − 2 and F = 2n − 2 truth values
(iii) The r th column has T = 22 − r and F = 22 − r truth-values, where n is
number of simpler propositions and r is the specified column.
Numbers of T and F occurs alternate in the truth table.
LOGIC OPERATORS
The propositional connectives are negation ( , not), conjunction ( , and),
disjunction ( , or), implication ( , if - then) and bi-implication ( , if and only
if). The connectives , , and are designated as binary while is
designated as unary.
Conjunction (and, )
Let p and q be simple propositions. The proposition “p and q” denoted by p q is
the proposition that is true when both p and q are true and is false otherwise. The
proposition p q is called the conjunction of p and q.
Here we have two propositions p and q therefore n = 2 (number of simple
propositions p and q)
Therefore T = 2 and F = 2 in the first column
Page 7 of 32
Advanced Secondary Education
p q pq
T T T
T F F
F T F
F F F
Disjunction (OR, )
Let p and q be simple propositions. The proposition “p or q” denoted by p q is
the proposition that is false when both p and q are false and is true otherwise. The
proposition p q is called the disjunction of p and q.
Truth table of p q is given below
p q pq
T T T
T F T
F T T
F F F
Exclusive Or ( )
Let p and q be propositions. The exclusive or of p and q is denoted by p q is the
proposition that is true when exactly one p and q is true and is false otherwise. The
proposition p q is called the exclusive or of p and q.
Truth table of p q is given below
p q p q
T T F
T F T
F T T
F F F
Negation, (NOT, )
Let p be a proposition. The negation of p is denoted by p or ~p. p is false only
when p is true and false otherwise.
Truth table of p
p p
T F
T F
F T
F T
Page 8 of 32
Advanced Secondary Education
Condition/Implication, ( → )
Let p and q be propositions. The implication p → q is the proposition that is false
when p is true and q is false and is true otherwise. In this implication p is called
hypotheses, antecedent, or premise and q is called the conclusion or
consequence.
Truth table of p → q p q p →q
T T T
T F F
F T T
F F T
Because implication arise in many places in mathematical reasoning a wide variety
of terminology is used to express p → q . Keywords used to show implication are:
(a) If p then q (e) p is necessary for q
(b) p is sufficient for q (f) q if p
(c) if p, q (g) q whenever p
(d) p only if q
Note that p → q is false only in the case that p is true but q is false so that
it is true when both p and q are true and when p is false (No matter what
truth-value q has).
Consider the example below about implication “If you make more than
Tshs. 75,000/- per month then you must file a tax return”. This statement
is saying nothing about somebody making less than Tshs. 75,000/- and do
not file a tax return.
Similarly, the statement “If a player hits more than 60 home runs, then a
bonus of 10 million is awarded”, then this contract will be violated only if
the player hits more than 60 home runs and not awarded but it says
nothing if the player hits fewer than 60 home runs.
Page 9 of 32
Advanced Secondary Education
Example 1
Write down the converse and contrapositive of the implication “If today is
Thursday, then I have a test today”
Solution
Let p be “today is Thursday” and q be “I have a test today”, then the
compound statement can be written as p → q , it is converse q → p , In
words is “If I have a test today, then today is Thursday”. Contrapositive of
p → q is q → p then it is “If I do not have a test today, then today is not
Thursday”.
Biconditional/double implication, ( )
Let p and q be propositions. The biconditional p q is the proposition
that is true when p and q have the same truth-values and false otherwise.
Truth table for p q
p q pq
T T T
T F F
F T F
F F T
Page 10 of 32
Advanced Secondary Education
p T p
pF p
p p T
p p F
(b) Domination law
p T T
p F F
(c) Idempotent law
p p p
pp p
(d) Double negation law
(p) p
(e) Commutative law
p qqp
p qqp
(f) Associative law
(p q) r p (q r)
(p q) r p (q r)
(g) Distributive law
p (q r) (p q) (p r)
p (q r) (p q) (p r)
(h) De Morgan’s law
(p q) p q
(p q) p q
(i) p → q p q
p q (p → q) (q →p) (p q) (q p)
Page 11 of 32
Advanced Secondary Education
EXERCISE 1: LOGIC
1. Draw the truth table of the following
(a) (p q) → q (e) (p → q) p
(b) (p → q) → p (f) (p q) → r (q → p)
(c) (p q) → r (g) (p q) (p q)
(d) (p q) → (p → q)
2. Use the algebra laws of proposition simplify the following
(a) (p q) → (p q) q
(b) (p q) (q → p ) (e) (p q) → (p → q)
(c) (p → q) → (p q) (f) (p → q) → (q → p)
(d) (q p) (q p)
(g) (p q) (p q) (p q)
Page 12 of 32
Advanced Secondary Education
ARGUMENTS
In everyday situations, arguments are dialogues between people. Here we
do not study everything of these dialogues. We just stick on the
propositions people express when they give reasons for things. In logic,
argument is a list of propositions called the premises, we saw early,
followed by a word such as “therefore” or “so” and then another
proposition called conclusion.
In simple words; an argument is a sequence of statements.
Premises or assumptions or hypothesis these are statements in an
argument.
Conclusion is the final statement in an argument.
Example 2
“If I live in Arusha, then I’m a Maasai. I’m a Maasai; therefore, I live in
Arusha”.
Solution
Let p be “I live in Arusha” and q be “I am a Maasai”
Here the conclusion is “I live in Arusha”
Logically equivalent
The compound propositions that have the same truth-values in all possible
cases are called logically equivalent. The symbol stands for “Equivalent
to”.
One the way to show that the logical propositions are equivalent is by
using truth table and another way is to use laws of algebra of propositions
to resemble either left hand sides to the right-hand side or vice versa.
Propositions p and q are said to be logically equivalent if and only if the
columns giving their truth-values agree otherwise, they are not logically
equivalent.
Example 3
Use the truth table to show that (p q) p q
Page 13 of 32
Advanced Secondary Education
Solution
p q (p q) p q
T T F F
T F F F
F T F F
F F T T
Because the columns of (p q) and p q on the truth table have
the same truth values, then they are equivalent, written as
(p q) p q
Example 4
Show that the propositions p → q and p q are logically equivalent.
Solution
Using the truth table
p q p q p→q
T T T T
T F F F
F T T T
F F T T
The columns of p q and p → q have the same truth values,
therefore p → q p q
Page 14 of 32
Advanced Secondary Education
Page 15 of 32
Advanced Secondary Education
Example 8
Show that (p q) → (p q) is tautology using laws of proposition.
Solution
Given (p q) → (p q)
(p q) (p q) - Negation law
p q p q - De Morgan’s law
T - Identity law
Page 16 of 32
Advanced Secondary Education
(b) Use the truth table to check the validity of an argument or use
laws of algebra of propositions to simplify the compound
statement
(c) Write the conclusion
Example 9
Test the validity of the following argument using the truth table “If I love
Mathematics then I will practice Mathematics. I do not practice
Mathematics; therefore, I hate Mathematics”
Solution
Using the truth table
Let p be “I love mathematics” and q be “I will practice Mathematics”
Truth table
p q (p → q) (p → q) q (p → q) q → p
T T T F T
T F F F T
F T T F T
F F T T T
Therefore, the argument is valid (tautology)
Using laws of algebra of propositions
(p → q) q → p
(p q) q → p - Negation law
(p q) p - Associative law
Page 17 of 32
Advanced Secondary Education
T
Hence, the proposition is valid
Example 10
Test the validity of the argument; “If 6 is even then 2 divide 7, either 5 is
not prime or 2 divide 7, but 5 is Prime. Therefore 6 is odd”.
Solution
Let p be “6 is even” q be “2 divide 7” and r be “5 is prime”
Symbolically
(p → q) (r q) r → p
Using the truth table
(p → q) (p → q)
p q p → q r q (r q) r → p
r
(r q) r
T T T T F F T
T T F T T F T
T F T F F F T
T F F F T F T
F T T T T T T
F T F T F F T
F F T T T T T
F F F T F F T
Using the truth table, the conclusion is valid.
Example 11
Determine the validity of the following statement: “If there is no Law,
there is no justice. There is no Law, there is no justice”
Solution
Let p be “there is no law” and q be “there is no justice”
Symbolically
Page 18 of 32
Advanced Secondary Education
ACTIVITY 2
1. (a) Check the validity of the following argument p → (q r ) ,
r → p , q → r and r
(b) What does the proposition (p q) r → (p q) represent?
2. (a)What is mean by the terms;
(i) Fallacy statement
(ii) Tautology statement
(b) Translate into symbolic form and test the validity of the following
argument: “If Kanzi speaks logically, then He does not contradict
laws of Algebra. Either there is no meaning or He contradicts laws
of Algebra. However, there is meaning. Therefore, Kanzi speaks
logically”.
Page 19 of 32
Advanced Secondary Education
ELECTRICAL NETWORK
Logic is very useful in daily life of electric. For the bulb to be light up the
complete circuit must be well connected, thus wire, source of power and
bulb itself. Electric circuit can also be used to verify or test the validity of
the logical statements (compound statements).
Consider the circuits below
Switch
Switch
q
T1 T2
Page 20 of 32
Advanced Secondary Education
To light the bulb all one switch (p or q) need to be closed (on). For this
case, the bulb will light when one or both (all) the parallel switches turned
on.
Using the logic concept, one or both switches should be true (on) but not
both for the bulb to work and it will not work only when both p and q are
p
false (off)
T1 q
T2
As seen here only switch p is closed and q is open, this makes the current
to pass through the switch p to connect the source of power and the bulb,
which makes the bulb to light up.
Let p and q be the compound statement represented by the following
circuits, the series switches are connected by the word “and” while the
parallel switches are connected by the word “or”.
q
T1 T2
r
Source of power Bulb
Page 21 of 32
Advanced Secondary Education
Switch p and q are parallel and both are in series with switch r. Even if
switch p and q will be closed and r left, open there is no way a bulb will
light up. Switch r controls current to both switch p and q, logically this can
be expressed as (p q) r .
If switch p and q are closed and switch r is open, still the bulb will not work,
because r disconnect the current to reach the bulb.
Note that, when switches are opposite of the normal switch logically is
interpreted as negation of the switch.
Example 12
Express the following electric circuit in logical symbols using the switch
letters given
p
r
T1 q T2
S B
Solution
Switch p and q are parallel and r is in series with p and q, this can be written
as (p q) r
Example 13
Construct an electrical network corresponding to the proposition
(p q) r s
Solution
p and q are parallel, p q is in series with r and lastly (p q) r is parallel
to switch s
Page 22 of 32
Advanced Secondary Education
p
r
T1 q T2
Battery Bulb
Page 23 of 32
Advanced Secondary Education
Page 24 of 32
Advanced Secondary Education
b) q (p → q) → p
14. Show that p q is equivalent to (p q) (p q)
15. Determine if (p → q) → r and p → (q → r ) are not equivalent.
16. Show that p → q is equivalent to it is contrapositive
17. Use truth table to show that p q and p q are logically
equivalent
18. Show that (p q) and p q are logically equivalent
19. Write the negation of the following statements
(a) If she buys book, she will read
(b) If it rains, he will not go to play
(c) If it is a sunny day, we will wash our clothes
20. Symbolize the following statements and write their inverse, converse
and contrapositive
(a) If Mathematics is interesting then I will not study Physics
(b) If I get grade A in Physics then I will be an engineer
(c) If 3 is even, then 4 is odd
(d) History is interesting if and only if mathematics is boring and tough
21. Construct the truth table for the following statements
(a) If I work hard, I will be rich
(b) A number is even if and only if it is divisible by 2
(c) You will pass your examinations if you study hard
(d) We will play football if there is no rain or extensive sunlight
(e) You like Geography and Advanced Mathematics or you do not like
Geography and Economics’
22. Draw a simple electric network diagram for the statements
(a) (p → q) (p q)
(b) (p q) (p q)
23. Prove that (p → q) p and p q are equivalent, using
(a) Laws of algebra of sets
(b) The truth tables
24. Draw the electric network for the proposition (p q) (p q)
25. Use laws of algebra of sets to show if (p q) (p q) p
Page 25 of 32
Advanced Secondary Education
(b) T1 p
T2
p q
q
Page 26 of 32
Advanced Secondary Education
Page 27 of 32
Advanced Secondary Education
X (p, q , r ) T F T F F F F F
36. (a) Differentiate between Tautology and contradiction and give one
example for each.
(b) Determine whether or not, the statement (p q ) r → (p q )
is a tautology.
(c) Given that proposition (p q ) → r
Write: -
(i) The converse of its contrapositive
(ii) Inverse of its converse
(d) Let p be Sam is rich and q be Sam is unhappy. Write each of the
following in symbolic form.
(i) Sam is poor but unhappy
(ii) Sam is poor or else he is both rich and unhappy
(iii) Sam is either rich or unhappy
(iv) Sam is rich if and only if he is happy
37. (a) Show that p q does not logically imply p → q
(b) What is meant by saying that an argument is valid?
(c) Prove the validity of the following argument: “If the country is
democratic and governed by selfish leaders, then the country will
develop. If the leaders are not selfish, the country will not develop
therefore the country is not democratic.”
(d) Construct a truth table and simplified logical circuit of: -
(i) p (p → q ) (ii) (p → q ) → p
38. Consider two propositions p and q, complete the truth table below.
p q ¬q p ¬q ¬p ¬p q
Page 28 of 32
Advanced Secondary Education
p q p q p (p q) (p ( p q)) p
T T
T F
F T
F F
State whether the compound proposition (p ( p q)) p is a
contradiction, a tautology or neither.
40. Consider the following propositions.
p: Isaac finishes her homework
q: Isaac goes to the football match
Write in symbolic form the following proposition. If Isaac does not go
to the football match, then Isaac finishes his homework.
Page 28 of 32
Advanced Secondary Education
(b) ¬p q.
(c) The truth table for these compound propositions is given below.
p q K ¬p M
T T T …………. T
T F F …………. F
F T T …………. T
F F T …………. T
Page 29 of 32
Advanced Secondary Education
References
a) Greg Restall (2006) Logic: An Introduction, Madison AVe, New York,
NY 10016: Taylor & Francis e-Library, 2006.
b) Dr. A.R. Mushi Logic: Discrete Mathematics: Course notes
c) Kenneth H. Rosen (1998) Discrete Mathematics and Its applications,
fourth edition, Published by China Machine Press/McGraw-Hill
d) Prof. Mordechai (Moti) Ben-Ari Science teaching department (2012)
Mathematical Logic for Computer science, third edition, Springer
London Heidelberg New York Dordrecht
Page 30 of 32
Advanced Secondary Education
Page 31 of 32