Discrete Mathematics
Discrete Mathematics
lOGIC
The rules of logic give precise meaning to mathematical statements. They
are used to distinguish between valid and invalid mathematical arguments. In
other words logic is important in understanding mathematical reasoning.
In addition logic has a number of applicatuions to computere science e.g. in
the design of computer circuits, construction of computer programs, verification
of correctness of programs etc.
Propositions
Def: A proposition is a declarative sentence (i.e. a sentence that declares
the fact) that is either true or false, but not both. It is a statement whose truth
value may be determined. It is not a matter of opinion.
Example
Each of the folowing is a proposition
1. Nairobi is the capital of Kenya.
2. For all real numbers x and y,x + y = y + x
3. 1 + 1 = 2 :T
4. 2 + 2 = 3 : F
5. Kenya is an island; F
6. There is life in Mars.
7. Every prime number greater than 2 is odd and 6 is not a prime number.
T
Remarks.
• In the example above propositions (1), (2), (3) and (5) are true
whereas (4) and (5) are false. However, proposition (6) is one whose
truth value we do not know.
1
3. Possibiliies / Probabilities
4. Ambigous (both true and false at the same time)
Example
Consider the following sentences:
1. What time is it?
2. Read this carefully.
3. x+1=2
4. x+y=z
5. x-y=y-x
Sentences (1) and (2) are not propositions since there are not declarative sen-
tences, (3), (4) and (5) are neither true nor false since the variables have not
been assigned any values. Furthermore, sentence (5) is ambigous: if x and y are
real numbers, the statemant will have truth false; however, if y-x=0, then the
statement will have truth value true.
We normally use lower case letters p, q, r, s,... to denote propositional /
statement variable. The truth value of a proposition is true, denoted by T, if it
is a true statement, and false, denoted by F, if it is a false statement.
Logical operators/ Connectives
Lofical operators, also called connectives, are used to form new propositions
from existing propositions.
Connective Notation
Negation ∼ or NOT
Conjunction ∧ AND
Disjunction ∨ OR
Logical implication/ conditional →
Double implication/biconditional ←→
1. Negation (∼p)
Let p be a proposition. The negation of p, denoted by ∼p and read “not p” is
the proposition “It is not the case that p” or “it is false that p”. If p is true,
(∼p) is false and vice versa.
Example
(a) Let p be the proposition 2+2=5. The (∼p) is the proposition 2 + 2 ≇ .
This can also be expressed as “it is not the case / it is false that 2+2=5”.
(b) If p is a statement “Today is sunday”, then ∼p is the statement “Today
is not sunday” or “It is not the case that today is sunday” or “It is false that
today is sunday”.
(c) The negation of the statement 2 + 2 > 5 is 2 + 2 ≯ 5 or 2 + 2 ≤ 5
Def: A truth table displays relationship between truth values. It is useful
in determining truth values of compound propositions.
2
NB In all tables, if the number of propositions are n, then we have up 2n
rows.
The truth table for the negation of a proposition p is:
p ∼p
T F
F T
Def: Propossition can be reprezsented graphically using venn diagram
MISSING VENN DIAGRAM
2. Conjunction (p ∧ q)
Any two prositions p and q can be combined using the word “and” to form
a compound proposition called the conjunction of p and q, denoted by (p ∧ q)
and read “p and q”.
Since (p ∧ q) is a proposition, it has a truth value and this truth value de-
pends only on the truth values of p and q. The conjunction (p ∧ q) is true when
both p and q are true and is false otherwise. E.g. Suppose p is the statement
“it is cold” and q the statement “it is raining”. Then (p ∧ q) is the statement “it
is cold and it is raining”
• Truth Table for the conjunction of two propsition p and q:
p q (p ∧ q)
T T T
T F F MISSING PIE CHART
F T F
F F F
• Truth Table for the conjunction of three propsition p, q and r:
p q r p∧q∧r
T T T T
T T F F
T F T F
F T T F MISSING PIE CHART
T F F F
F T F F
F F T F
F F F F
• Extended truth table for two propositionss p and q combining conjunctions
and negation.
p q ∼p ∼q p∧q ∼(p ∧ q) ∼ p∧ ∼ q ∼p∧q p∧ ∼ q
T T F F T F F F F
T F F T F T F F T
F T T F F T F T F
F F T T F T T F F
Example
3
Consider the following four statements
(i) Nairobi is in Kenya and 2+2=4
(ii) Nairobi is in Kenya and 2+2=5
(iii) Nairobi is in Ghana and 2+2=4
(iv) Nairobi is in Ghana and 2+2=5
Only the first statement are true. Each of the others is false at least one of
its subpropositions is false.
3. Disjunction (p ∨ q)
Any two propositions p and q can be combined using the word “or” to form
a compound proposition called the disjunction of p and q, denoted by (p ∨ q)
and read as “p or q”. The disjunction (p ∨ q) is false when both p and q are false
and is true otherwise.
Example
(i) Let p be the proposition “37 is prime” and q the proposition “he is a
policeman”. Then (p ∨ q) is the statement “37 is prime or he is a policeman”.
(ii) Let p be the statement that “he is tired” and q the statement “he is
hungry”. Then (p ∨ q) is the statement “he is either tired or hungry”
• Truth table and veen diagram for the disjunction of two proposition p and
q:
p q (p ∨ q)
T T T
T F T MISSING PIE CHART
F T T
F F F
• Truth table for the conjuction, disjunction and negation for two proposi-
tions p and q are:
p q ∼p ∼q p∨q ∼p ∨ q p∨ ∼ q ∼ p∧ ∼ q p∧q ∼ p∧ ∼ q ∼ (p ∧ q) ∼(p ∨ q)
T T F F T T T F T F F F
T F F T T F T T T T T F
F T T F T T F T F F T F
F F T T F T T T F T T T
• Def: Compound propositions that have the same truth values in all cases
are called logically equivalent. This means that in a truth table, the
columns of two logically equivalent expressions are identical.
Example
In the case above ∼ (p ∧ q) and ∼ p∧ ∼ q are logically equivalent. Similarly,
∼ (p ∨ q) and ∼ p∧ ∼ q are logically equivalent. These are the De morgan’s
laws.
Defn: Let p and q be propositions. The exclusive or of p and q, denoted
by p ⊗ q, is the proposition that is true when exactly one of p and q is the true
and is false otherwise i.e. the compound proposition (p ∨ q)∧ ∼ (p ∧ q)
4
p q p⊗q
T T F
T F T MISSING PIE CHART
F T T
F F F
4. Logical Implication (p q)
Let p and q be propositions. The logical implication (p q) is the proposi-
tion “if p, the q”. It is also called a conditional statement since (p q) assrts
that q is true on the condition that p holds / is true
NB: The logical implication (p q) is false when p is true and q is false and
is true otherwise.
In the implication (p q), p is called the hypothesis or premise or antecedent
and q the conclusion or consequence.
Example
(i) Let p be the statement “It is raining” and q the satement “It is wet”. Then
(p q) is the statement “If it is raining, then it is wet .”
• Truth table for the logical implication
p q pq
T T T
T F F
F T T
F F T
NB The implication p q is true when both p and q are true and when p
is false (irrespective of the truth value of q).
(ii) Let p be the statement that “2+2=4” and q the statement “3>5”. Then
p q is the statement “If 2+2=4, then 3>5”.
The following p q can be expressed in the following ways:
• If p, then q
• If p, q
• p implies q
• p only if q
• p is sufficient for q
• A suufficient condition for q is p
• q if p
• q whenever p
• q when p
• q is necessary for p
5
• a necessary condition for p is q
• q follows from p
• q unless ∼ p
Now consider the truth table for the compound proposition ∼ (p∧ ∼ q)
p q ∼ q p∧ ∼ q ∼ (p∧ ∼ q)
T F F F T
T T T T F
F T F F T
F F T F T
The final column for p → q and ∼ (p∧ ∼ q) are the same and hence the two
compound statements are logically equivalent. It therefore follows thats the two
have the same venn diagram representation.
MISSING VENN DIAGRAMS (2)
Converse, Inverse and contrapositive
Related to any conditional are three more compound propositions, namely
the inverse, converse and contrapositive.
(a) Converse
If p → q is the conditional, then the converse is the compound proposition
q→p
(b) Inverse
If p → q is the conditional, then the inverse is the compound proposition
∼ p →∼ q
(c). Contrapositive
If p → q is the conditional, then the contrapositive is the compound propo-
sition ∼ q →∼ p
NB For any given conditional p → q , the conditional is logically equivalent
to the contrapositive ∼ q →∼ p and the inverse is logically equivalent to the
converse.
p q ∼ p ∼ q p → q q → p ∼ p →∼ q ∼ q →∼ p
T T F F T T T T
T F F T F T T F
F T T F T F F T
F F T T T T T T
Example
Write down the converse, inverse and contrapositive of the conditional
“If dogs bite, then 2+2>0”
solution
Let p be the statement “dog bites” and q the statement “2+2>0”.
(a) Converse (q → p)
If 2+2>, then dog bites.
(b) Inverse (∼ p →∼ q)
If dogs don’t bite, then 2 + 2 ≤ 0
(c) Contrapositive (∼ q →∼ p)
6
If 2 + 2 ≤ 0, then dogs don’t bite.
5. Double Implication / Biconditional (p ↔ q)
Let p and q be propositions. The double implication p ↔ q is the propostion
that “p implies q and q implies p” or “if p, then q and if q, then p”. This is read
“p if and only if q”, denoted “p iff q”. It can also be read as “p is equivalent to
q”.
Other ways of expressig the statement p ↔ q are “p is necessary and sufficient
for q” and “if p then q, and conversely”.
• NB
(i) the biconditional statement p ↔ q is true when p and q have the same
truth values, and is false otherwise.
(ii) p ↔ q is logically equivalent to (p → q) ∧ (q → p)
p q p→q q→p p↔q (p → q) ∧ (q → p)
T T T T T T
T F F T F F
F T T F F F
F F T T T T
Venn diagram for the biconditional p ↔ q
MISSING PIE CHART
Example
Let p be the statement “The home team wins” and q the statement “It is
raining”. Then p ↔ q is the statement “The home team wins if and only if it is
raining”.
Necessity and Sufficiency
Condition A is said to be sufficient condition for B if and only if the truth /
occurence of A is sufficient to guarantee the truth / existence / occurence of B.
In general from the conditional p → qwe say that p is sufficient condition for
q.
e.g. Consider the statement :
“If you are registered to vote, then you are at least 18 years old”. The truth
of the condition “You are registered to vote” is sufficient to ensure the truth of
the condition “You are at least 18 years old”.
On the other hand, condition A is said to be a necessary condition for B if
the falsity / nonexistence / non-occurence of B.
In general, from the condition p → q we say that q is a necessary condition
for p.
e.g. In the previous statement , “You are at least 18 years old” is necessary
for “you are eligible to vote”.
Further Examples
Rewrite the conditional “If 2+2=5”, then he (not a statement since it may
be either be T or F depending on the value of the pronounce “he”) is tall using:
(a) Implies
(b) Only if
7
(c) Sufficient Condition
(d) Whenever
(e) Necessary
(f) Unless
Solution
(a) 2+2=5 implies he is tall
(b) 2+2=5 only if he is tall
(c) 2+2=5 is a sufficient condition for he is tall
(d) He is tall whenever 2+2=5
(e) He is tall is necessary for 2+2=5
(f) He is tall unless 2 + 2 6= 5
FURTHER EXAMPLES OF TRUTH TABLES
1. Compute the truth table for the compound proposition (p∧q)∨ ∼ (p → q)
p q p ∧ q p → q ∼ (p → q) (p ∧ q)∨ ∼ (p → q)
T T T T F T
T F F F T T
F T F T F F
F F F T F F
Remarks
Sometimes when computing truth tables, we can deduce the number of
columns by putting truth values under the proposition as well as under the
connectives. One then numbers the columns in the order in which they are
filled out. In this case we evaluate negation first followed by conjunction or
disjunction and finally the logical implication or double implication. When two
logical operators having the same precedence are present, parentheses may be
needed.
From the example above (p ∧ q)∨ ∼ (p → q)will have the truth table.
(p ∧ q) ∨ ∼ (p → q)
T T T T F T T T
T F F T T T F F
F F T F F F T T
F F F F F F T F
1 2 1 4 3 1 2 1
2. Construct the truth table of the compound proposition (p → q) ∧ [(q∧ ∼
r) → (p ∨ r)
8
(p → q) ∧ [(q ∧ ∼ r) → (p ∨ r)]
T T T T T F F T T T T T
T T T T T T T F T T T F
T F F F F F F T T T T T
F T T T T F F T T F T T
T F F F F F T F T T T F
F T T F T T T F F F F F
F T F T F F F T T F T T
F T F T F F T F T F F F
1 3 1 5 1 3 2 1 4 1 3 1
Exercise:
Construct a truth table for each of the following compound proposition
(a) (p → q) ∨ (∼ p ↔ q)
(b) (p → q) ∨ (∼ p → q)
(c) (p → q) ∧ [(p∨ ∼ r) → (q ∧ r)]
(d) (p q) ∧ (p ∼ q)
(e) (p ↔ q) (p ∧ q)
(f) ((p → q) → r) → r
PROPOSITIONAL EQUIVALENCES
Tautology
This is a compound proposition that is always true irrespective of the truth
values of the constituent proposition.
To check whether a given proposition is a tautology, it is sufficient to compose
its truth table and check whether the final column has every entry “T”.
Examples
1. p∨ p and p → q are tautologies.
2. [p ∧ (p → q)] → q
[p ∧ (p → q)] → q
T T T T T T T
T F T F F T F
F F F T T T T
F F F T F T F
1 3 1 2 1 4 1
Since the final column in the truth table has only truth entries “T” then th
proposition is a tautology.
3. ∼ (p ∨ q) ↔ (∼ p∧ ∼ q) is a tautology
∼ (p ∨ q) ↔ (∼ p ∧ q)
F T T T T F F F
F T T F T F F T
F F T T T T F F
T F F F T T T T
3 1 1 4 2 3 2
Contradiction
9
This is a compound proposition that is always false regardless of the truth
values of the constituent propositions.
To check whether a given proposition is a contradiction, we construct the
truth table and check whether the final column has every entry “F”.
The classical contradiction is p∧ ∼ p.
p ∼ p p∧ ∼ p
T F F
F T F
Remarks
1. If in a truth table the final column has every entry “T”, the particular
compound proposition is a tautology. The proposition in this case is called
logically true.
2. If in a truth table the final column has every entry “F”, the particular
compound proposition is a contradiction. The proposition in this case is
called logically false.
3. If in a truth table the final column has both entries “F” and “T”, then the
particular compound proposition is a contradiction. The proposition in
this case is called logically indeterminable.
Contingency:
This is a compound proposition that is neither a tautology nor a contradic-
tion.
Logical Equivalences
Proposituon p and q are called logically equivalent if p ↔ q is a tautology.
We denote this by p ≡ q or p ⇔ q.
Examples
1. Show that the proposition p → q and ∼ p ∨ q are logically equivalent
(p → q) ↔ (∼ p ∨ q)
T T T T F T T T
T F F T F T F F
F T T T T F T T
F T F T T F T F
1 3 1 4 2 1 3 1
Since the final column of the truth table has every entry “T” then (p →
q) ⇔(∼ p ∨ q)
2. Show that p ∨ (q ∧ r) and (p ∨ q) ∧ (p ∨ r) are logically equivalent.
10
p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
T T T T T T T T T T T T T
T T T F F T T T T T T T F
T T F F T T T T F T T T T
F T T T T T F T T T F T T
T T F F F T T T F T T T F
F F T F F T F T T F F F F
F F F F T T F F F F F T T
F F F F F T F F F F F F F
1 3 1 2 1 4 1 2 1 3 1 2 1
Since the final column of the truth table has every entry as “T” then
p ∨ (q ∧ r) ⇔(p ∨ q) ∧ (p ∨ r)
Boolean Algebra Identities
Suppose T denotes the compound proposition thats is always true and F de-
notes the compound proposition that is always false. Then we have the following
important inequalities.
Equivalence Name
P ∧ T ⇔ P, P ∨ F ⇔ P Identity laws
P ∨ T ⇔ P, P ∧ F ⇔ P Domination laws
p ∨ p ⇔ p,p ∧ p ⇔ p Indempotent laws
∼ (∼ p) ∼ p Double negation law
p ∨ q ⇔ q ∨ p,p ∧ q ⇔ q ∧ p Commutative laws
p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r),p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r) Distributive laws
(p ∨ q) ∨ r ⇔ p ∨ (q ∨ r),(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r) Associative laws
∼ (p ∧ q) ⇔∼ p∧ ∼ q,∼ (p ∨ q) ⇔∼ p∧ ∼ q De Morgan’s law
p ∨ (p ∧ q) ⇔ p,p ∧ (p ∨ q) ⇔ p Absorption laws
p∨ ∼ p ⇔ T,p∧ ∼ p ⇔ F Negation laws
Logical equivalences involving conditional statements
1. p → q ⇔∼ p ∨ q
2. p → q ⇔∼ q →∼ p
3. p ∨ q ⇔∼ p → q
4. p ∧ q ⇔∼ (p →∼ q)
5. (p → q) ∧ (p → r) ⇔ p → (q ∧ r)
6. (p → r) ∧ (q → r) ⇔ (p ∨ q) → r
7. ∼ (p → q) ⇔ p∧ ∼ q
8. (p → q) ∨ (p → r) ⇔ p → (q ∨ r)
9. (p → r) ∨ (q → r) ⇔ (p ∧ q) → r
Logical Equivalences involving Biconditional Statements
11
1. p ↔ q ⇔ (p → q) ∧ (q → p)
2. p ↔ q ⇔∼ p ↔∼ q
3. p ↔ q ⇔ (p ∧ q) ∨ (∼ p∧ ∼ q)
4. ∼ (p ↔ q) ⇔ p ↔∼ q
NB The De Morgan’s laws can be extended to
(a). ∼ (p1 ∨ p2 ∨ ... ∨ pn ) ⇔∼ p1 ∧ ∼ p2 ∧ ...∧ ∼ pn ) and
(b).∼ (p1 ∧ p2 ∧ ... ∧ pn ) ⇔∼∼ p1 ∨ ∼ p2 ∨ ...∨ ∼ pn )
Constructing New Logical Equivalences.
Established logical equivalences can be used to construct new logical equiv-
alences. This enables us to replace a proposition by a compound proposition
that is logically equivalent to it without changing the truth value of the original
compund proposition. The technique also uses the fact that if p ⇔ q and p ⇔ r,
(i.e. logical equivalence of propositions is transitive)
Example
1. Show that ∼ (p → q) ⇔ p∧ ∼ q
solution
∼ (p → q)
⇔∼ (∼ p ∨ q)(Since p → q ⇔∼ p ∨ q)
⇔∼ (∼ p)∧ ∼ q (By second De Morgans law)
⇔ p∧ ∼ q (by the double negation law)
2. Show that ∼ (p ∨ (∼ p ∧ q)) ⇔∼ p∧ ∼ q.
Solution
∼ (p ∨ (∼ p ∧ q))
⇔∼ p∧ ∼ (∼ p ∧ q)(By second De morgans law)
⇔∼ p ∧ (∼ (∼ p)∨ ∼ q)(By first De morgans law)
⇔∼ p ∧ (p∨ ∼ q)(By double negation law)
⇔ (∼ p ∧ p) ∨ (∼ p∧ ∼ q) (By second distributive law)
⇔ F ∨ (∼ p∧ ∼ q) (Since ∼ p ∧ p ⇔ F )
⇔∼ p∧ ∼ q (by the identity law of F)
3. Show that (p ∧ q) → (p ∨ q) is a tautology
solution
(p ∧ q) → (p ∨ q)
⇔∼ (p ∧ q) ∨ (p ∨ q)
⇔ (∼ p∨ ∼ q) ∨ (p ∨ q) by De morgans law
⇔ (∼ p ∨ p) ∨ (∼ q ∨ q) By associativity and commutativity
⇔T ∨T
⇔T
Exercise:
(1) Use the truth tables to verify
(a) p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)
(b) ∼ (p ∧ q) ⇔∼ p∨ ∼ q
12
(2)Use truth tables or logical equivalences to show that each of the following
compound proposition is a tautology.
(a)(p ∧ q) → (p ∨ q)
(b) [∼ p ∧ (p ∨ q)] → q
(c) [(p → q) ∧ (q → r)] → (p → r)
VALID ARGUMENTS IN PROPOSITIONAL ,LOGIC
An argument is a sequence of statements A1 , A2 , ..., An followed by a
statement A. All but the final proposition in the argument are called premises
or assumptions or hypothesis and he final proposition is called conclusion.
We denote the argument by
A1 , A2 , ..., An thus A
OR
A1
A2
...
An
A
From A1 , A2 , ..., An we have premises ans A is the conclusion.
An argument is valid if whenever all the premises are true, the conclusion is
also true. In other words, an argument is valid and (an argument is invalid if it
is not valid) and only if it is impossible for all the premises to be true and the
conclusion to be false.
Proofs in mathematics are valid arguments that establish the truth of math-
ematical statements.
Def An argument is called sound if and only if it is valid and all its premises
are true. An argument that is not sound is called unsound.
Steps in Determining validity or invalidity of an Argument
1. Identify the premises and conclusion of the argument.
2. Construct a truth table showing the truth values of 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 to have true premises and a false conclusion,
and so the argument is invalid. If the conclusion in every critical row is
true, then the argument is valid.
Example
1. Consider the argument
p → q e.g If it is raining, then it is wet.
p it is raining.
Thus q it is wet
13
p q p→q
T T T
T F F
F T T
F F T
The bolded row represent critical row
The first row is the only one in which both premises are true, and the
conclusion in that row is also true. Hence, the argument is valid.
2. p → q e.g If it is raining then it is wet
q it is wet thus it is raining.
Thus p
p q p→q
T T T
T F F
F F T
F F T
The bolded rows have are critical rows.
The third row, both premises are true but the conclusion in that row is false.
Hence the argument is invalid.
3. Show that the following argument is invalid
p → (q∨ ∼ r)
q → (p ∧ r)
thus p → r
p → (q ∨ ∼ r) q → (p ∧ r) p → r
T T T T F T T T T T T T T
T T T T T T F T F F T F F
T F F F F F T T T T T T T
F T T T F T F F F T F T T
T T F T T F T T F F T F F
F T T T T T F F F F F T F
F T F F F F T F F T F T T
F T F T T F T F F F F T F
1 3 1 2 1 1 3 1 2 1 1 2 1
In the fifth row, both premises are true but the conclusion in the row is false.
Hence the argument is invalid.
4. Test the validity of the following argument
xis positive or x is negative
If x is positive, then x2 > 0
If x is negative, then x2 > 0
Thus x2 > 0
solution
p = x is positive
q = x is negative
r = x2 > 0
p∨q
14
p→r
q→r
Thus r
p q r p∨q p→r q →r r
T T T T T T T
T T F T F F F
T F T T T T T
F T T T T T T
T F F T F T F
F T F T T F F
F F T F T T T
F F F F T T F
In each of the firdt, third and forth rows, all the three premises are true, and
the conclusion in each of these rows is also true. Hence, the argument is valid.
Exercise
1. Show that each of the following arguments is valid
(a) p ∧ q thus p (b).p ∧ q thus q (c). p ∧ q , ∼ q thus p (d) p ∨ q, ∼ p thus q
(e) If p , then q, ∼ q thus ∼ p (f)p → q, q → r,thus p → r (g)p → (q∨ ∼ r)
p → (q ∧ r) thus p → r
2. Test the validity of each of the following arguments
(a) (p ∧ q) → r, p thus r (b) p → (q → r), q thus p → r (c) p∨ ∼ s, r ←→ s,
r → q thus p ∨ q (d) p → q, q → (r∨ ∼ s) p ∧ s thus r
Definition An incorrect reasoning that leads to an invalid argument is called
a fallacy.
NB In logic, the words “true” and “valid” have different meanings. A valid
arguments may have false premises and a false conclusion, and an invalid argu-
ment may have true premises and a true conclusion.
Predicates and Quantifiers
Predicates
Statements involving variables, such as “x > 3”, x + y = 3 and ”x + y = z”
are not propositions since the values of the variables are not specified. The
statements “x > 3” ha stwo parts; x which is the variable is called subject ,
and “is greater than 3” is called predicate (the property that the subject of the
statement can have).
Consider the statement “x > 3”. Let p denote the predicate “is greater than
3” and x is the variable. We can denote the statement by P (x) where P (x)
is called the value of the propositional function P at x. In this case the set of
possible values of x is called the domain of discourse or universe of discourse
or simply domain of x. Once a value has been assigned to the variable x, the
statement P (x) becomes a proposition and has a truth value.
Definition If P(x) is a proposition 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 subsituted for x.
This is denoted as {xǫD|P(x)}.
Example
If P (x) is the statement “x > 3”, where the domain is the set of all real
15
numbers, then the truth set of P (x) is the set of all real numbers greater than
3 e.g. P (4) is true since 4 > 3 but P (2) is false since 2 ≯ 3.
We can also have statgements that involve more than one variable
e.g. the statements ”x + y = 3” can be denoted by Q(x, y), where x and y
are variables and Q is the predicate. When values are assigned to the variables
x and y, the statement Q(x, y) becomes a proposition and has a truth value.
For instance Q(1, 2) is the statement Q(1, 2) is the statement 1 + 2 = 3 which
is true while Q(1,0) is the proposition 1+0=3 which is false.
Quantifiers
Quantification can also be used to create a proposition from a propositional
function. This expresses the extent to which a predicate is true over a range of
elements. There are two types of quantification:
1. Universal quantification - Shows that a predicate is true for every
elements under consideration / every element in the domain.
2. Existential quantification - shows that there is one or more elements
under consideration for which the predicate is true.
The area of logic that deals with predicates and quantifiers is called predicate
calculus.
Universal Quantifier:
Definition: The universal quantification of P (x) is the statement “P(x) for
all values of x in the domain”. This is denoted by ∀xP (x), and read “for all x
P(x)” or “for every x P(x)”. In this ∀ is called universal quantifier.
Besides “for all” and “for every”, the universal quantification can also be
expressed as “all of” , “for each”, “given any”, “for arbitrary”, and “for any”.
NB:
(1) The domain must always be specified when a universal quantifier is used.
(2) The truth value of ∀xP (x) depends on the domain.
Remarks
The quantification ∀xP (x) is true when P (x) is true for every x in the domain
and is false when there is an x in the domain for P (x) is false.
Defn: An element for which P (x) is false is called counterexample
So a counterexample is used to show that P (x) is not always true when x is
in the domain.
Examples
1. The square of every real number is non-negative. This can be written as
∀xǫR, x2 ≥ 0.
2. All cars have wheels. This can be written as ∀x, P )(x) where the domain
consists of all cars and P (x) is the predicate “has wheels”.
3. Let P (x) be the statement ”x + 1 > x”where the domain consists of all
real numbers. The universal quantification of P (x) i.e. ∀xP (x) is the
statement “For all real numbers x, x + 1 > x” which is true.
16
4. Let Q(x) be the statement ”x < 2” where the domain consists of all
real numbers. The quantification ∀xQ(x) is the statement. “For each
real number x, x<2”. This is false since Q(3) is false. So, x = 3 is a
counterexample for the statement ∀xQ(x).
5. Suppose P (x) is the statement ”x2 > 0” where the universe of discourse
consists of all integers. Then the statement ∀xP (x) is false. In this case
x = 0 is a counterexample since x2 = 0 when x = 0, i.e. x2 ≯ 0 when
x = 0.
Remarks
When all the elements in the universe of discourse can be listed say, x1 ,x2 ,...,
xn , the universal quantification ∀xP (x)is the same as the conjunction.
P (x1 ) ∧ P (x2 ) ∧ ... ∧ p(xn ).
Example
Determine the truth value of ∀xP (x), where P (x) is the statement “x2 < 10”
and the domain consists of the positive integers not exceeding 4.
Solution
The statement ∀xP (x) is the conjuction
P (1) ∧ P (2) ∧ P (3) ∧ P (4)
since the domain consists of the integers 1, 2, 3, and 4. But P (4) which is
the statement ”42 < 10” is false. It then follows that ∀xP (x) is false.
Exercise
Find the truth of the statement ∀x x2 ≥ x if the domain consists of
(a) all real numbers (False)
(b) all integers (True)
Existential Quantifier:
Definition: The existentential quantification of P (x) is the proposition
“There exists an alement x in the domain such that P(x)”. This is denoted by
∃x,P (x). In this case ∃ is called the existential quantifier.
The existential quantification ∃x,P(x) is read as
(i) “There exists xsuch that P (x)” or
(ii) “There is an x such that “P (x)””, or
(iii) “There is at least one xsuch that “P (x)”” or
(iv) “For some x “P (x)””.
NB
1. The domain must be specified when a statement ∃x,P (x) is used.
2. The truth value of ∃x,P (x) depends on the domain.
Remarks:
The existential quantification ∃x,P (x) is true when there is an x in the
domain for which P (x) is true and is false when P (x) is false for every x in the
domain.
Examples
17
1. There exists a solution in the set of real numbers such that x2 + 7x = 0.
This is written as ∃xǫR|x2 + 7x = 0.
2. Let P (x) be the statement ”x > 3” where the domain consists of all real
numbers. Then the existential quantification ∃x, P (x) is the statement
“There exists a real number x, x > 3”. This is true for insatnce, when
x = 4.
3. Let Q(x) be the statement “x = x + 1” where the domain is the set
of all integers. Since Q(x) is false for every integer x, the exisstential
quantification of Q(x) i.e. ∀xQ(x) is false.
Reamarks
When all elements in the domain can be listed say, x1 , x2 , ..., xn , the exis-
tential quantification ∃x,P (x) is the same as the disjunction
P (x1 ) ∨ P (x2 ) ∨ ... ∨ P (xn )
since the disjunction is true if and only if at least one of P (x1 ),P (x2 )...P (xn )
is true.
Example
What is the truth value of ∃x,P (x), where P (x) is the statement ”x2 > 10”
and the universe of discourse consists of positive integers not exceeding 4?
solution
The domain {1, 2, 3, 4}. Hence, the proposition ∃x,P (x) is the same as the
disjunction
P (1) ∨ P (2) ∨ P (3) ∨ P (4).
Since P (4), which is a statement “42 > 10” is true, it follows that ∃x,P (x)
is true.
Normally the two types of quantification can be used together.
Example
1. ∀xǫR, ∃yǫR, x + y = 0
2. For every even number x, there exists an integer y such that x = 2y.
Uniqueness Quantifier:
Defn: The notation∃!x, P (x) or ∃, x, P (x) is the statement “There exists a
uniquex such that P (x) is true”. This can also be phrased as “There is exactly
one x for which P (x) is true” or “There is one and only one x for which P (x) is
true”.
example
∃!x, x−1 = 0. This is a true statement since x = 1 is the unique real number
fow which x − 1 = 0.
Negation
Consider the statement: “Every student in this class takes mathematics”.
This can be expressed as ∀xP (x) where P (x) is the statement “x takes
mathematics” and the domain consistsof the students in this class. The negation
of this statement is “It is not the case that every student in this class takes
mathematics”. This is equivalent to “There is a student in this case who does
18
not take mathematics”. This is existential quantification of the negation of the
original propositional functions, i.e. ∃, x, ∼ P (x)
Therefore ∼ ∀x,P (x) ⇔ ∃x,∼ P (x)
Now, consider the proposition “There is a student in this class who takes
mathematics”. This is an existential quantification ∃x, Q(x) where Q(x) is the
statement “x takes mathematics”. The negation of the statement is “It is not
the case that there is a student in this class who takes mathematics”. This is
equivalent to “Every student in this class does not take mathematics”. This is
just the universal quantification of the negation of the original propositional
function, i.e. ∀x, ∼ Q(x).
Therefore ∼ ∃x,Q(x) ⇔ ∀x, ∼ Q(x).
Example
Negate each of the following statements if the universe of discourse is the set
of integers.
(a) ∀n,n2 ≥ 0
(b) ∃n,n2 = 0
(c) ∀n ∀m, n2 + m2 = 6
(d) ∀n ∀m,∃p, [p − (m + n)]|2
solution
(a) ∃n,n2 < 0
(b) ∀n,n2 6= 2
(c) ∃n ∃m,n2 + m2 6= 6
(d) ∃n ∃m,∀p [p − (m + n)] ∤ 2
Application of Propositional Logic
1. Translating from English into Logical expressions and vice versa
Example
(a) Let
p- “Milka reads the standard”.
q-” Milka reads the Daily Nation”.
r-”Milka reads the People”
Rewrite each of the following using logical expressions.
(i) Milka reads the standard and the Daily Nation or does not read the
people.
(ii) Milka reads the standard and the daily nation or does not read the
standard and the people.
(iii) It is not true that Milka reads the standard but not the Daily Nation.
(iv) It is not the case that Milka reads the people or the daily nation but
not the standard.
solution
(i) (p ∧ q)∨ ∼ r
(ii) (p ∧ q)∨ ∼ (p ∧ r)
(iii) ∼ (p∧ ∼ q) ⇔∼ p ∨ q
(iv) ∼ [(r ∨ q)∧ ∼ p]
(b) Let p, q and r be the following propositions
p-John is a bright student
q- John is a good citizen
19
r- John drinks illicit brews.
Rewrite each of the following logical expressions in English.
solution
(a) p → (∼ q ∨ r)
(b) ∼ p → (q → r)
(c) p ∨ q) ∨ r
(d) (p ∧ q) ∨ r
(e) (p ∧ q)∧ ∼ r
2. Logic Circuits
Propositional logic can be applied to the design of computer hardware.
A logic (digital) circuit receives input signals p1 ,p2 , ..., pn each a bit [either
0 (off) or 1 (on) ], and produces output signals s1 , s2 , ...sn each a bit.
We restrict ourselves to logic circuits with a single output signal; in general
digital circuits may have multiple outputs.
They are three basic circuits also called gates:
(a) Inverter / Not gate - takes an input bit p, and produces an output ∼ p
MISSING FIGURE
(b) OR gate - takes two input signals p and q, each a bit and produces as
output the signal p ∨ q
MISING FIGURE
(c) AND gate - takes two input signals p and q each a bit, and produces as
output the signal p ∧ q
MISSING FIGURE
Complex circuits are constructed from nasic gates. Given a circuit built
from the basic logic gates and inputs to the circuit, we determine the output by
tracing the circuit.
SET THEORY
Definition: A set is an (unordered) collection of objects that are precisely
defined. By porecisely defined means that no two objects of a set are indistin-
guishable and given any object it is possible to tell whether or not it belongs to
a givem set. The objects of a set are called members or elements. A set is said
to contain its elements, an element is said to belong to a set.
Set Notation:
Normally we use upper case letters to denote sets and lowercase letters to
denote elements. The notation xǫA means x is an element of the set A, and is
read “x is an element of A” or “x is a member of A”. The notation x ∈ / A means
that x is not an element of the set A.
Describing a set:
There are two ways to describe a set:
(a) Listing (Roster) Method
This is usually used for finite sets (Sets whose elements are finite). In this
case we list all the elements of the set between curly brackets, separated by
commas. For example, if the elements of the set A are a, b, c,and d, this is
denoted by A = a, d, c, d.
The method is also used to describe a set without listing all its elements. In
this case, if the general pattern of the elements is clear, we lists a few elements
20
of the set and then three dots / ellipses (...) read “and so forth”. For example,
the set of the first 100 positive integers can be denoted by {1, 2, 3, ..., 100}
while the set of all positive integers can be represented by:
A = {1,2, 3, ...}.
The method also works in the works in the case where the set extends indef-
initely on either end. For instance, suppose B is the set of all whole numbers.
Then, this can be represented as
B={..., -3, -2, -1, 0, 1, 2, 3, ...}
or
B={0, ±1,±2,±3, ...}
(b) Set-Builder Notation
In this method we use the notation {x | p(x)} read as “the set of all elements
x such that p(x)” where p(x) is a property | condition that x must satisfy for it
to be a member of the given set. The method may be used in the case where it
is not possibble to list all the elements of a given set.
Example
(1) Let A={1, 3, 5, 7, 9}. This can be written as
A={x | x is an odd positive integer less than 10}
Or
A={x ∈ Z+ |x is odd and x < 10}
(2) |The set B={1, 2, 3, 4, ...} can also be described as
B={x|x is apositive integer}
(3) Suppose C={3, 5, 7, 11, 13, 17, 19}. Then
C={x|3 ≤ x ≤ 19,x is prime}
(4) We also have the following notations
N = {1, 2, 3, ...}, the set of all natural numbers.
Z = {..., −3, −2, −1, 0, 1, 2, 3, ...}, The set of integers (whole numbers}
Z+ = {1, 2, 3, ...}, The set of positive integers
Q = { ab |a, b, ∈ Z, b 6= 0}, the set of rational numbers.
R = the set of real numbers.
R+ =the set of positive real numbers.
C the set of complex numbers.
Cardinality of a Set
The cardinality of a set, sometimes called order of a set, is the number of
elements in the set.
If A is a set, then the cardinality of A is denoted by |A| or nA.
A set is said to be finite if its cardinality is finite and is said to be infinite
otherwise.
A set of order one is called a singleton set.
Example
21
Empty Set
The empty set , also called the null set, is a set that has no elements. It is
denoted by ∅ or {}. So, by definition |∅| = 0.
Example:
1. Let A={xǫR|x2 +1 = 0}. In this case not exists x ∈ R such that x2 +1 = 0.
So, A = ∅
2. Similarly, if B={x ∈ R|x = x + 1}, then B = ∅
3. Suppose C={x|x is prime and x is a multiple of 4}
Set of primes = {2,3,5,7,11,13,17,...}
Multiples of 4={..., -16,-12,-8,-4,0,4,8,12,16,...}
Clearly, no prime is a multiple of 4 and vice versa.
So, C is null i.e. C=∅ or C={}
NB
The empty set ∅ should not be confused with the set {∅}, which is singleton
set.
Subsets
Let A and B be sets. We say that A is a subset of B if and only if every
element of A is also an element of B i.e. ∀x ∈ A, x ∈ B. This os denoted by
A ⊆ B and read as “A is a subset of B” or “A is contained in B”. From the bigger
set point of view, B ⊇ A, read as “B is a superset of A” or “B contains A”.
Now, if there is at least one element x of A that does not belong to B, then
we say that A is not a subset of B and write A * B or A + B . So, such an x
is a counterexample to the claim that x ∈ A implies x ∈ B. If A is a subset of
B and A 6= B, i.e. ∃x ∈ B but x ∈ / A, then we write A ⊂ B and say that A is a
proper subset of B.
Example
1. Let A={k, 3, 5, x, a, t} and B={a, k, t, 3, y, x, 5, 10}.
Then A ⊂ B or A ⊃ B since every element in A is also an element of B.
2. Let A={1, 3, 5, 8, 9}, B={1, 2, 3, 5, 7} and C={1, 5}.
Then C ⊂ A and C ⊂ B. However, B * A since 2 ∈ B but 2 ∈ / B. Similarly,
A * B since 8 ∈ A but 8 ∈ /A.
3. Let A={a, e, i, o, u} and let B be the set of all letters of the English
alphabet. Then A ⊂ B.
Remarks
1. For every set A, ∅ ⊆ A. In this case ∅ is called the trivial subset.\
2. For every set A, A ⊂ A. In this case A is called the improper subset.
3. A non-trivial proper subset A is any subset of A different from ∅ and A
itself.
4. For all sets A, B and C, if A ⊆ B and B ⊆ C , then A ⊆ C.
Equal Sets
Two sets A and B are equal if and only if they have the same elements, i.e.
∀x ∈ A, x ∈ B and ∀y ∈ B, y ∈ A. In other words , A and B are equal if and
only if A ⊂ B and B ⊂ A. In this case we write A=B.
22
Example
There is only one empty set. If A and B are both empty, then A=B since
they have exactly the same elements, namely : none.
NB: In a set, the order in which the elements appear is irrelevant. A set
remains the same even if its elements are repeated or interchanged. For instance,
the set {1, 2, 3} and {3, 1, 2} are equal since they have elements. Similarly, {1,
3, 5} and {1, 1, 3, 3, 3, 5} are equal.
Equivalent Sets.
Two sets A and B are said to be equivalent if there exists a one-to-one
correspondence between them, i.e. ∀x ∈ A there exists a unique y ∈ B, ∀k ∈ B
and ∃!l ∈ A.
NB:
1. Equal sets are equivalent but equivalent sets are not necessarily equal.
2. If A and B are equivalent, then |A|=|B|.
Power set
Let A be a set. The power set of A, denoted by P (A), is the set of all subsets
of A.
NB: If |A|=n, then |P (A)| = 2n
Example:
1. Let A={1, 2}. Then P (A)={∅, {1}, {2}, A
2. Let B={a, b, c}. Then P (A) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, B}.
3. P (A) = {∅} while P ({∅}) = {∅, {∅}}
Universal Set:
All sets under investigation in any application of set theory are assumed to
be contained in some larger fixed set called the universal set denoted by ⊔. The
elements of the universal set comprise of all elements in the sets of discussion
and possibly extra elements i.e. the universal set is a set such that all the sets
of discussion are its subsets.
Example:
1. Suppose that the sets of discussion are:
A={a, b, c, d, e}
B={a, e, i, o, u}
C={g, k, p, t, s, a, m}
A convenient universal set ⊔ in this case would be the set of the letters of
english alphabet.
2. Suppose the sets of discussion are
A= set of all saloon cars
B=set of all buses
C= set of all lorries
D=set of all tractors
A convenient universal set ⊔ in this case would be the set of all motor
vehicles.
23
Venn Diagrams:
Sets can be represented pictorially using venn diagrams. In venn diagrams
the universal set ⊔ is represented by a rectangle. Inside this rectangle, circles
are used to reepresent the subsets under consideration. Sometimes points are
used to represent particular elements of a set.
MISSING VENN DIAGRAMS
Set Operations
We now define ways of constructing new sets from existing ones.
Set union
Let A and B be sets. The union of A and B, denoted by A ∪ B and read as
“A union B”, is the set of all elements that are either in A or in B, or in both,
i.e.
AU B = {x|x ∈ A or x ∈ B}
In this case “or” is used to sense of “and / or”
MISSING VENN DIAGRAM
Example:
1. Let A={1, 2, 3} and B={1, 3, 5, 7, 8}. Then A ∪ B={1,2,3,5,7,8}
2. Let A={a,b,6,p,4} and B={1,k,t,2,-1,b}. Then A∪B ={a,b,6,p,4,1,k,t,2,-
1}
Remark:
For any sets A, B, and C
(a) A ∪ ∅ = A (Identity law)
(b) If A ⊂ B, then A ∪ B = B
(c) (A ∪ B) ∪ C = A ∪ (B ∪ C) (Associative law)
(d) A ∪ B = B ∪ A (Commutative law)
(e) A ∪ A = A (Idempotent law)
(f) A ⊆ A∪B, B ⊆ A∪B,
The union of a finite
Sncollection A1 , A2 ,..., An , of sets is denoted by:
A1 ∪ A2 ... ∪ An = i=1 Ai S∞
If the collection A1 , A2 ,..., An , is infinite then A1 ∪ A2 ... ∪ An = i=1 Ai
MISSING VENN DIAGRAM
Set Intersection:
Let A and B be sets. The intersection of A and B denoted by A ∩ B and
read as “A intersection B” is the set of all element that belong to both A and
B, i.e. x ∈ A ∩ B if and only if x ∈ A and x ∈ B. In other words,
A ∩ B={x|x ∈ A and x ∈ B}.
Definition: Two sets A and B are called disjoint if and only if they have
no element in common.
So, if A and B are disjoint, then A ∩ B = ∅.
Two disjoint sets A and B are represented in a venn diagram as two non-
intersective circles.
MISSING VENN DIAGRAM
Example
1. Let A={1, 2, 3} and B={1, 3, 5}. Then A ∩ B={1, 3}. So, A and B are
not disjoint.
24
2. Let A={1, 2, 3} and B={a, b, c, d}. Then A ∩ B=∅. Hence, A and B
are disjoint.
3. Let A={a, b, 1, 3, c, d} and B={1, 2, c, k, f}. Then A ∩ B = {1,c}.
4. Let
A= set of all JKUAT students.
B=set of all female students taking discrete mathematics
C=set of all male students taking discrete mathematics
Then,
A ∩ B= Set of all JKUAT female students taking discrete mathematics
A ∩ C=Set of all JKUAT male students taking discrete mathematics
B∩C =∅
Remarks:
For any sets A, B and C
(a) A ∩ ∅ = ∅ (Unity or identity laws)
(b) If A ⊆ B, then A ∩ B=A
(c) A ∩ B ⊆ A and A ∩ B ⊆ B
(d) A ∩ B ∩ C = A ∩ (B ∩ C
(e) A ∩ B = B ∩ A
(f) A ∩ A = A (Indempotent law)
The intersection of a finite collection A1 , A2 ,..., An , of set as denoted by:
A1 ∩ A2 ... ∩ An = ∩ni=1 Ai
If the collection A1 , A2 ,..., An , is infinite then A1 ∩ A2 ... ∩ An = ∩∞
i=1 Ai
MISSING VENN DIAGRAM
Definition: Set A1 , A2 , A3 , ... are mutually disjoint | pairwise disjoint |
non-overlapping if and only if Ai ∩ Ai = ∅ whenever i 6= j.
Example
1. Let A={1, 2, 3}, B={4, 5} and C={6}. Then A,B and C are mutually
disjoint since A ∩ B = ∅, and B ∩ C = ∅.
2. Let D={1, 2, 3}, E={4, 5} and F={2}. In this case D, E and F are not
mutually disjoint since D ∩ F = {2} 6= ∅.
Definition: A collection {A1 , A2 , A3 , ... } of non-empty set is a partition of a
set A and only if:
(i) A is a union of all the Ai (i = 1, 2, 3, ...}.
(ii) The sets A1 , A2 , A3 , ... are mutually disjoint.
Example
Let A={1, 2, 3, 4, 5, 6}, A1 ={1, 2}, A2 = {3,4} and A3 = {5,6}. Then
{A1 , A2 , A3 } is a partition of A since A=A1 ∪ A2 ∪ A3 and A1 , A2 and A3 are
mutually disjoint.
Set Difference (Relative Complement}
Let A and B be sets. The difference of A and B (or the relative complement
of A in B, denoted by A|B or A-B, is the set of all elements in A but not in B,
i.e. A-B={x|x ∈ A and x ∈ / B}
MISSING VENN DIAGRAM
Example
25
1. Let A={1, 3, 5} and B={1, 2, 3}. Then A-B={5} and B-A={2}.
2. Let X={a, b, c, d, e} and Y={a, e, i, o, u}. Then X-Y={b, c, d} and
Y-X={i, o, u}.
3. Let A be the set of all JKUAT students and B the set of all JKUAT stu-
dents taking discrete mathematics. Then A-B is the set of all JKUAT Students
who don’t take Discrete Mathematics.
NB: If A and B are disjoint, then A-B=A and B-A=B.
Exampe:
Let A={1, 2, 3} and B={4, 5, 6}. Then A-B=A and B-A=B.
Remarks:
1. In general, A-B6=B-A.
2. (A-B)∩(B-A)=∅.
3. A-B=A ∩ B c
Complement of a Set
Let ⊔ be the universal set and let A ⊂ ⊔. The complement of the set A, also
′
called universal set A, denoted by Ac or A or Ā, is the set of elements in ⊔ but
not in A. Therefore, Ac = ⊔ − A. In other words:
Ac = {x|x ∈ ⊔ and x ∈ / A}
MISSING VENN DIAGRAM
Example
1. Let A={x ∈ Z|x > 5} where the universal set ⊔ is Z+ , the set of positive
integers. then,
Ac = {x ∈ Z+ |x ≤ 5}
={1, 2, 3, 4, 5}
2. Let ⊔={a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}
A={a, b, c, d}
B={e, f, g}
V={a, e, i, o, u}
Then
Ac = {e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}
B c = {a, b, c, d, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}
V c = {b, c, d, f, g, h, i, k, l, m, n, p, q, r, s, t, v, w, x, y, z}
In this case,
A ∪ B=a, b, c, d, e, f, g and A ∩ B = ∅
Also
(A ∪ B)c = {h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z}
(A ∩ B)c = ∅c = ⊔ = ⊔ − ∅ = ⊔
Ac ∪ B c =a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z =⊔
Ac ∩ B c = h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
Comparing we have (A ∪ B)c = Ac ∩ B c and (A ∩ B)c = Ac ∪ B c .
For any two sets A and B, these two are called the De Morgans laws for set
theory.
Symmetric Difference
26
Let A and B be sets. The symmetric difference of A and B denoted by A⊕B,
consists of those elements in either A or B, but not in both A and B, i.e.
A ⊕ B = {(A ∪ B) − (A ∩ B)}
or
A ⊕ B = {(A − B) ∪ (B − A)}
MISSING VENN DIAGRAM
Example
1. Let A={1, 2, 3, 4} and B={3, 4, 5, 6, 7}. Then A-B={1, 2} and B-A={5,
6, 7}
So,
A ⊕ B = (A − B) ∪ (B − A)
={1, 2, 5, 6, 7}
Alternatively, A ∪ B ={1, 2, 3, 4, 5, 6, 7} and A ∩ B = {3,4}
so,
A ⊕ B = {(A ∪ B) − (A ∩ B)}
={1, 2, 5, 6, 7}
MISSING VENN DIAGRAM
Reamarks
(a) A ⊕ A = ∅
(b) A ⊕ ∅ = A
(c) A ⊕ ⊔ = Ac
(d) A ⊕ Ac = ⊔
(e) A ⊕ B = B ⊕ A
(f) (A ⊕ B) ⊕ B = A
(g) A ⊕ B = A ∪ B if A ∩ B = ∅
Set Identities
1. Identity laws | unity laws
A∪∅=A
A∩⊔=A
2. Domination | Zero Laws
A∪⊔=⊔
A∩∅=∅
3. Commutative laws.
A∪B =B∪A
A∩B =B∩A
4. Associative laws
(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
5. Distributive laws.
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
6. Idempotent Laws.
A∪A=A
A∩A=A
7. Absorption Laws.
A ∪ (A ∩ B) = A
27
A ∩ (A ∪ B) = A
8. Complementation Laws
A ∪ Ac = ⊔
A ∩ Ac = ∅
9. Double Complementation Law
(Ac )c = A
10. Universal Laws
⊔c = ∅
∅c = ⊔
11. De Morgans Law
(A ∪ B)c = Ac ∩ B c
(A ∩ B)c = Ac ∪ B c
Remarks:
1. All the laws except the double complelmentation law are in pairs.
2. Any of the properties in a given pair is said to be the dual property of the
other.
3. To obtain the dual property you replace ∪ with ∩ or ⊔ with ∅ and vice
versa.
4. These set identities are similar to the logical equivalences seen earlier.
5. The set identities and propositional equivalences are special cases of iden-
tities for boolean algebra.
Proving Set Identities:
There are three methods of proving the set identities:
1. Use of Venn diagram.
2. Showing that each of the sets is a subset of the other.
3. Using Boolean algebra.
28
Let x ∈ A ∪ (B ∩ C) . Then x ∈ A or x ∈ (B ∩ C)
If x ∈ A, then x ∈ (A ∪ B) and x ∈ (A ∪ C). So,
x ∈ (A ∪ B) ∩ (A ∪ C).
On the other hand, if x ∈ (B ∩ C), then x ∈ B, x ∈ C
So, x ∈ (A ∪ B) and x ∈ (A ∪ B). Hence x ∈ (A ∪ B) ∩ (A ∪ C)
Either case shows that
A ∪ (B ∩ C) ⊂ (A ∪ B) ∩ (A ∪ C)..............................(I)
Now let, y ∈ (A ∪ B) ∩ (A ∪ C). Then y ∈ (A ∪ B) and y ∈ (A ∪ C)
So y ∈ A, or y ∈ B and y ∈ A or y ∈ C
⇒ y ∈ A or y ∈ B and y ← C
⇒ y ∈ A or y ∈ B ∩ C
⇒ y ∈ A ∪ (B ∩ C)
Thus (A ∪ B) ∩ (A ∪ C) ⊂ A ∪ (B ∩ C)..................(II)
From (I) and (II)
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
(ii) A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
Let x ∈ A ∩ (B ∪ C) Then x ∈ A and x ∈ B ∪ C
⇒ x ∈ A and x ∈ B or x ∈ C
⇒ x ∈ A and x ∈ B or x ∈ A and x ∈ C
⇒ x ∈ A ∩ B or x ∈ A ∩ C
⇒ x ∈ (A ∩ B) ∪ (A ∩ C
So, A ∩ (B ∪ C) ⊂ (A ∩ B) ∪ (A ∩ C) ...............(I)
Now, let y ∈ (A ∩ B) ∪ (A ∩ C. Then y ∈ A ∩ B or y ∈ A ∩ C
⇒ y ∈ A and y ∈ B or y ∈ B and y ∈ C
⇒ y ∈ A and y ∈ B or y ∈ C
⇒ y ∈ A and y ∈ B ∪ C
⇒ y ∈ A∩(B ∪ C)
So, (A ∩ B) ∪ (A ∩ C) ⊂ A ∩ (B ∪ C)...........(II)
From (I) and (II) we have A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
(b) De Morgan’s Laws
(i) (A ∪ B)c = Ac ∩ B c
We show that (A ∪ B)c ⊂ Ac ∩ B c and Ac ∩ B c = (A ∪ B)c
Let x ∈ (A ∪ B)c
⇒x∈ / A∪B
⇒x∈ / A and x ∈
/B
⇒ x ∈ Ac and x ∈ B c
⇒ x ∈ Ac ∩ B c
So, (A ∪ B)c ⊂ Ac ∩ B c ....................(I)
Now, let y ∈ Ac ∩ B c
⇒ y ∈ Ac and y ∈ B c
⇒y∈ / A and y ∈
/B
⇒y∈ / A∪B
⇒ y ∈ (A ∪ B)c
So, (A ∪ B)c ⊂ Ac ∩ B c ..............(II)
From (I) and (II) (A ∪ B)c = Ac ∩ B c
(ii) (A ∩ B)c = Ac ∪ B c
29
Let x ∈ ((A ∩ B)c . Then x ∈ / A∩B
⇒x∈ / A or x ∈
/B
⇒ x ∈ Ac or x ∈ B c
⇒ x ∈ Ac ∪ B c
So, (A ∩ B)c ⊂ Ac ∪ B c .............(I)
Now let y ∈ Ac ∪ B c . Then y ∈ Ac or y ∈ B c
⇒y∈ / A or y ∈
/B
⇒y∈ / A∩B
⇒ y ∈ (A ∩ B)c
So, (A ∩ B)c ⊂ Ac ∪ B c
Example:
1. Show that for any two sets A and B, A-B=A ∩ B c
Solution:
We need to show that A − B ⊂ A ∩ B c and A ∩ B c ⊂ A − B.
Let x ∈ A − B. Then x ∈ A and x ∈ /B
⇒ x ∈ A and x ∈ B c
⇒ x ∈ A ∩ Bc
So, A − B ⊂ A ∩ B c ............(I)
Now let y ∈ A ∩ B c . Then y ∈ A and y ∈ B c
⇒ y ∈ A and y ∈∈ /B
⇒y ∈ A−B
So, A ∩ B c ⊂ A − B ..........(II)
From (i) and (II) ⇒ A − B = A ∩ B c
2. Show that (A ∩ B) ∩ C = A ∩ (B ∩ C)
Solution:
Suppose x ∈ (A ∩ B) ∩ C. Then x ∈ A ∩ B and x ∈ C
⇒ x ∈ A and x ∈ B and x ∈ C
⇒ x ∈ A and x ∈ B ∩ C
⇒ x ∈ A ∩(B ∩ C)
So, (A ∩ B) ∩ C ⊂ A ∩ (B ∩ C) ...........(I)
Now, suppose y ∈ A ∩ (B ∩ C). Then y ∈ A and y ∈ B ∩ C
⇒ y ∈ A and y ∈ B and y ∈
⇒ y ∈ A ∩ B and y ∈ C
⇒ y ∈ (A ∩ B) ∩ C
So, A ∩ (B ∩ C) ⊂ (A ∩ B) ∩ C ..........(II)
From (I) and (II) we have ⇒ (A ∩ B) ∩ C = A ∩ (B ∩ C)
3. Prove that if A ⊂ C and B ⊂ D, then A ∪ B ⊂ C ∪ D
Proof:
Let x ∈ A ∪ B. Then x ∈ A or x ∈ B
If x ∈ A, than x ∈ C since A ⊂ A
If x ∈ B, then x ∈ D since B ⊂ D
So, x ∈ C ∪ D
Thus A ∪ B ⊂ C ∪ D
4. Prove that if A ⊂ C and B ⊂ D, then A ∩ B ⊂ C ∩ D
Proof
Suppose x ← A ∩ B. Then x ∈ A or x ∈ B.
30
So, x ∈ C since A ⊂ C and x ∈ D since B ⊂
Hence, x ∈ C ∩ D
Therefore A ∩ B ⊂ C ∩ D
Exercise:
Prove that for any sets A, B and C.
(a) A ∪ (B ∪ C) = (A ∪ B) ∪ C
′ ′ ′ ′
(b) [A ∪ (B ∩ C)] = (C ∪ B ) ∩ A \
(c) A ∩ (A ∪ B) = A
(d) A ∪ (A ∩ B) = A
(e) (A − B) − C = (A − C) − (B − C)
(f) A ⊕ B = (A ∪ B) − (A ∩ C)
(g) A ⊕ B = (A − B) ∪ (B − A)
Using Boolean Algebra
1. Simplify A ∩ (Ac ∪ B)
Solution:
A ∩ (Ac ∪ B)
= (A ∩ Ac ) ∪ (A ∩ B) (By distributive laws)
= ∅ ∪ (A ∩ B) (By complement law)
= A ∩ B (By unity law)
2. Show that A − (B ∪ C) = (A − B) ∩ (A − C)
Solution:
A − (B ∪ C)
′
= A ∩ (B ∪ C)
′ ′
= A ∩ (B ∩ C ) (De Morgan’s law)
′ ′
= (A ∩ B ) ∩ (A ∩ C ) (By distributive law)
= (A − B) ∩ (A − C)
′ ′
3. Simplify A ∩ B ∩ (A ∪ B ∪ C)
Solution:
′ ′
A ∩ B ∩ (A ∪ B ∪ C)
′
= (A ∪ B) ∩ [(A ∪ B) ∪ C] (By De Morgan’s law)
′ ′
= [(A ∪ B) ∩ (A ∪ B)] ∪ [(A ∪ B) ∩ C] (by distributive law)
′ ′
= ∅ ∪ [A ∩ B ∩ C] (by complement law and De Morgan’s law)
′ ′
= A ∩ B ∩ C (by unity law)
4. Show that (A − C) − (B − C) = (A − B) − C
Solution:
′
(A − C) − (B − C) = (A − C) ∩ (B − C)
′ ′ ′
= (A ∩ C ) ∩ (B ∩ C )
′ ′ ′ ′
= (A ∩ C ) ∩ [B ∪ (C ) ] (By De Morgan’s law)
′ ′
= (A ∩ C ) ∩ (B ∪ C) (By double complementation law)
′ ′ ′
= (A ∩ C ∩ B ) ∪ (A ∩ C ∩ C) (by distributive law)
′ ′
= (A ∩ C ∩ B ) ∪ (A ∩ ∅) (By complement law)
′ ′
= A ∩ C ∩ B ∪ ∅ (by zero law)
′ ′
= A ∩ C ∩ B (by unity law)
′ ′
= A ∩ B ∩ C (by commutative law)
′ ′
= (A ∩ B ) ∩ C (By associative law)
31
= (A − B − C.
′ ′ ′ ′
5. Show that [A ∪ (B ∩ C)] = (C ∪ B ) ∩ A
Solution:
′
[A ∪ (B ∩ C)]
′ ′
= A ∩ (B ∩ C) (by De Morgan’s law)
′ ′ ′
= A ∩ (B ∪ C ) (by De Morgan’s law)
′ ′ ′
= A ∩ (C ∪ B ) (by commutative law)
′ ′ ′
= (C ∪ B ) ∩ A (by commutative law)
Exercise:
1. Let A, B and C be sets. Draw a Venn diagram for each of the following:
(a) A ∩ (B ∪ C)
′ ′ ′
(b) A ∩ B ∩ C
(c) (A − B) ∪ (A − C)
(d)A ∩ (B − C)
(e) (A ∩ B) ∪ (A ∩ C)
2. Simplify by eliminating the minus sign:
(a) A − (B ∪ C)
(b) A − (B ∩ C)
(c) A − (B − C)
(d) (A − B) − C
(e) A ∩ (B − C)
3. Let A, B and C be sets. Show that
′
(a) (A ∩ B) ∪ (A ∩ B ) = A
(b) (B − A) ∪ (C − A) = (B ∪ C) − A
(c) (A − C) ∩ (C − B) = ∅
The Principle of Inclusion and Exclusion:
If A and B are disjoint sets, then the number of elements in their unions
equals the sum of their respective orders i.e. A∩B = ∅, then |A∪B| = |A|+|B|.
However if A ∩ B 6= ∅, then |A + B| = |A| + |B| − |A ∩ B|. This is called
the principle of inclusion and exclusion for two sets. It can be extended for any
finite number of sets using the folloeing theorem.
Theorem: If A1 , A2 ,..., An are sets, then
P
n P P
|A1 ∪ A2 ... ∪ An | = |A1 |− |Ai ∩ Aj |+ |Ai ∩ Aj ∩ Ak | +
i=1 1≤i<j≤n 1≤i<j<k≤n
... + −(−)n |A1 ∩ A2 ∩ ... ∩ An |
From the above theorem |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |B ∩ C| −
|A ∩ C| + |A ∩ B ∩ C|
Example:
1. Determine the number of integers between 1 and 100, inclusively, that
are divisible by either 2 or 5.
Solution
Let A be the set of all integers divisible by 2, between 1 and 100. Then , A
= {A|1 ≤ x ≤ 100, x is divisible by 2}
= {2, 4, 6, 8,..., 100}
= {2y|y ∈ Z, 1 ≤ y ≤ 50}
32
⇒ |A| = 50
Now, let B be the set of all integers divisible by 5, between 1 and 100. Then
B
= {x|1 ≤ x ≤ 100 x is divisible by 5}
={5, 10, 15, 20, ..., 100}
= {5y|y ∈ Z, 1 ≤ y ≤ 20}
⇒ |B| = 50
In addition, A ∩ B is the set of all integers divisible by both 2 and 5 (i.e.
divisible by 10), between 1 and 100.
So,
A∩B
= {x|1 ≤ x ≤ 100, x is divisible by 10}
={10, 20, 30, ..., 100}
= {10y|y ∈ Z, 1 ≤ y ≤ 10}
⇒ |B ∩ B| = 10
By the principle of inclusion and exclusion,
|A ∪ B| = |A| + |B| − |A ∩ B|
=50+20-10
=60
(A ∪ B is the set of integers between 1 and 100, inclusively, divisible by 2 or
5)
2. Determine the number of integers between 1 and 100, inclusively, that
are divisible by either 3, 5 or 7.
Solution:
Let A
= {x|1 ≤ x ≤ 100, x is divisible by 3}
={3, 6, 9, ..., 99}
= 3y|1 ≤ y ≤ 33}
⇒ |A| = 33
And B
= {x|1 ≤ x ≤ 100, x is divisible by 5}
={5, 10, 15, ..., 100}
= {5y|y ∈ Z, 1 ≤ y ≤ 20}
⇒ |B| = 20
And C,
= {x|1 ≤ x ≤ 100, x is divisible by 7}
={7, 14, 21, ..., 98}
= {7y|y ∈ Z, 1 ≤ y ≤ 14}
⇒ |C| = 14
A ∩ B =Set of integers between 1 and ∞, divisible by 15 ( the l.c.m of 3 and
5). So,
A∩B
= {x|1 ≤ x ≤ 100, x is divisible by 15}
={15, 30, 45, ..., 90}
= {15y|y ∈ Z, 1 ≤ y ≤ 6}
⇒ |A ∩ B| = 6
33
A ∩ C =Set of integers divisible by 21 ( the l.c.m of 3 and 7), between 1 and
100. So,
A∩C
= {x|1 ≤ x ≤ 100, x is divisible by 21}
={21, 42, ..., 84}
= {21y|y ∈ Z, 1 ≤ y ≤ 4}
⇒ |A ∩ C| = 4
B ∩ C =Set of integers divisible by 35 ( the l.c.m of 5 and 7), between 1 and
100. So,
B∩C
= {x|1 ≤ x ≤ 100, x is divisible by 35}
={35, 70}
⇒ |B ∩ C| = 2
A ∩ B ∩ C = Set of all integers between 1 and 100, divisible by 105 (the l.c.m
of 3, 5 and 7). Clearly, A ∩ B ∩ C = ∅.
Now, the required number is:
|A ∩ B ∩ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|
= 33 + 20 + 14 − 6 − 4 − 2 − 0
= 55
3. In a survey including 60 people, 25 take water, 26 tea and 26 coffee, 9
take both milk and tea, 11 take milk and coffee, 8 take coffee and tea and 8 take
none of the drinks.
(a) Find the number of people who take any of the three drinks.
(b) Find the number of people who take coffee, tea, milk alone.
Solution:
Let
M= Set of those taking milk.
T= Set of those taking tea
C=Set of those taking coffee.
Then,
|M | = 25, |T | = 26, |C| = 26, |M ∩ T | = 9, |M ∩ C| = 11, |C ∩ T | = 8
The number of those who take any of the three drinks is |M ∪ T ∪ C| =
60 − 8 = 52
Those who take all the three drinks are |M ∩ T ∪ C|.
|M ∪ T ∪ C| = |M | + |T | + |C| − |M ∩ T | − |M ∩ C| − |C ∩ T | + |M ∩ C ∩ T |
⇒ 52 = 25 + 26 + 26 − 9 − 11 − 8 + |M ∩ T ∩ C|
⇒ |M ∩ T ∩ C| = 3
Those who take,
milk alone =|M | − |M ∩ T | − |M ∩ C| + |M ∩ T ∩ C|
= 25 − 9 − 11 − 3
=8
Tea alone=|T | − |M ∩ T | − |C ∩ T | + |M ∩ T ∩ C|
= 26 − 9 − 8 − 3
=12
Coffee alone=|C| − |M ∩ C| − |C ∩ T | + |M ∩ T ∩ C|
=26-11-8+3
34
=10
Those who take exactly one drink is 8+12+10=30
Those who take milk and coffee but not tea is
M ∩ C| − |M ∩ T ∩ C| = 11 − 3 = 8
We can also use a Venn diagram to solve the problem:
MISSING VENN DIAGRAM
C alone = 26-11-8+x = 7 + x
M alone = 25-9-11-x= 5+ x
T alone = 26-9-8+x= 9+ x
⇒ 25 + 9 + x + 7 + x + 8 − x = 52
⇒ 49 + x = 52
x=3
So,
C alone =7 +3 =10
M alone = 5+3 =8
T alone = 9+ 3=12
⇒ Those taking exactly one drink are 10 + 8 +12=30
All the three drinks = |M ∩ T ∩ C| = x = 3
M $ T only= 9 - 3 = 6
M $ C only = 11 - 3 =8
T and C only = 8 - 3 =5
⇒ Number taking exactly 2 drinks is 6 + 8 +5 = 19
Those taking almost 2 drinks is:
(None of the drinks) or (exactly one drink) or (exactly 2 drinks)
⇒ Required number is 8 + (10 +8 +12) + (6 +8 +5) = 57
or
Total population - (number taking all the three drinks)
= 60 − 3
= 57
4. Out of a group of 85 people, 30 invested in the stock market, 45 has
certificates of deposits (CD’s) and 44 had savings bonds. Furthermore, 23 had
both CD’s and bonds, 13 had both CD’s and stocks, and 13 had stocks and
bonds. Finally, 10 of them had no investments. Determine how many of the
people had:
(a) all the three types of investment
(b) at least two investments
(c) at most two investments
(d) CD’s only.
Solution:
Let
S= set of those who invested in stock market.
C= set of those who invested in CD’s.
S= set of those who invested in saving Bonds.
Then,
|S| = 30, |C| = 45, |B| = 44, |C ∩ B| = 23, |C ∩ S| = B, |S ∩ B| = 13,
′
|(S ∪ B ∪ C) | = 10, |S ∪ B ∪ C| = 85 − 10 = 75
35
MISSING VENN DIAGRAM
|S ∪ B ∪ C| = 75 = 30 + (x + 9) + (23 − x) + (x + 8)
⇒ 75 = 70 + x
⇒x=5
(a) |S ∩ B ∩ C| = x = 5
(b) (13 − x) + (13 − x) + (23 − x) + x
= 49 − 2x
= 49 − 10
= 39
(c) | ⊔ | − |S ∩ B ∩ C| = 85 − 5 = 80
(d) x + 9 = 5 + 9 = 14
Exercise:
In a survey of 500 people, 285 are interested in football game, 195 are inter-
ested in hockey game, 115 are interested in basketball game, 45 in football and
basketball, 70 in football and hockey and 50 in hockey and basketball games.
However, 50 are not interested in any of the three games. Determine the number
of people who are interested in:
(a) all the three games
(b) exactly one of the games.
(c) exactly two of the games .
(d) at least one of the games.
Cartesian Products of Sets:
The order of elements in a collection is often important. Since sets are un-
ordered, a different structure is needed to represent collections. This is provided
by ordered n-tuples.
Definition: The ordered n-tuple (a1 , a2 , ..., an ) is the ordered collection
that has a1 as its first element, a2 as its second element, ..., and an as its nth -
element.
Two ordered n-tuples are said to be equal if and only if each corresponding
pair of their elements are equal. i.e. (a1 , a2 , ..., an ) = (b1 , b2 , ..., bn ) if anf only if
ai = bi for i = 1, 2, ..., n. In particular, ordered 2-tuples are called ordered pairs.
For instance, (a, b) = (c, d) if and only if a = c and b = d. It then follows that
(a, b) 6= (b, a) unless a = b. Further, ordered 3-tuples are called ordered triples
while ordered 4-tuples are called ordered quadruples.
Definition: Let A and B be sets. The cartesian product of A and B, denoted
by A × B, and read as “A cross B”, is the set of all ordered pairs (a, b), where
a ∈ A and b ∈ B. In other words:
A × B = {(a, b)|a ∈ A and b ∈ B}
Example:
1. Let A={1, 2} and B={a, b , c}. Then
Solution:
A × B={(1, a), (1, b), (1, c), (2, a), (2, b), (2, c)}
B × A= {(x, y), | x ∈ B and y ∈ A}
B × A= {(a, 1), (a, 2), (b, 1), (b, 2) , (c, 1), (c, 2)}
Clearly, A × B 6= B × A
2. Let A = {a, b, c, d} and B={1, 2, 3}. Then
36
solution:
A × B= {(a, 1), (a, 2), (a, 3), (b, 1), (b, 2), (b, 3), (c, 1), (c, 2), (c, 3), (d,
1), (d, 2), (d, 3)}
B × A ={(1, a), (1, b), (1, c), (1, d), (2, a), (2, b), (2, c), (2, d), (3, a), (3,
b), (3, c), (3, d)}
Remarks:
1. For any set A, A × ∅ = ∅ × A = ∅
2. For any two sets A and B, A × B 6= B × A unless A=B, or A = ∅ or B = ∅.
3. If |A|=m and |B|=n, then |A × B| = mn
Now, the cartesian prosuct of more than two sets can also be defined by:
Defn: The Cartesian product of the sets A1 , A2 , ..., An denoted by A1 ×
A2 × ... × An , is the set of ordered n-tuples (a1 , a2 , ..., an ) where ai belongs to
Ai for i = 1, 2, ..., n.
In other words:
A1 × A2 × ... × An = {(a1 , a2 , ..., an )}|ai ∈ Ai , i = 1, 2, ..., n}
Example:
Let A = {0, 1}, B = {0, 2} and C = {1, 2}. Then
Solution:
A × B × C ={(0, 0, 1), (0, 0, 2), (0, 2, 1), (0, 2, 2), (1, 0, 1), (1, 0, 2), (1, 2,
1) , (1, 2, 2)}
If A1 = A2 = A3 = ... = An = A, then A1 × A2 × A3 × ... × An is denoted
by An i.e.
An = {(a1 , a2 , ...an ) |ai ∈ A, i = 1, 2, ..., n}
So, A × A = A2 , A × A × A = A3 , A × A × A × A = A4 etc.
In particular, for the set of all real numbers R, R × R = R2 is the Eucliclean
space of dimension 2, R× R × R is the eucliclean space of dimensions 3, ..., R×
R × ... × R = Rn is the eucliclean space of dimensions n.
Claim: For any three non-empty sets A, B and C
A × (B ∩ C) = (A × B) ∩ (A × C)
Proof:
Let (u, v) ∈ A × (B ∩ C.
Then u ∈ A and v ∈ B ∩ C
⇒ u ∈ A and v ∈ B and v ∈ C
⇒ (u, v) ∈ A × B and (u, v) ∈ A × C
⇒ (u, v) ∈ (A × B) ∩ (A × C)
So, A × (B ∩ C) ⊂ (A × B) ∩ (A × C).....................(1)
Now, let (x, y) ∈ (A × B) ∩ (A × C)
Then (x, y) ∈ A × B and (x, y) ∈ (A × C)
⇒ x ∈ A and y ∈ B and x ∈ A and y ∈ C
⇒ x ∈ A and y ∈ B and y ∈ C
⇒ x ∈ A and y ∈ B ∩ C
⇒ (x, y) ∈ A × (B ∩ C)
So, (A × B) ∩ (A × C) ⊂ (A × (B ∩ C)....................(2)
37
Therefore, from (1) and (2) A × (B∩) = (A × B) ∩ (A × C)
Exercise:
Let A, B, and C be sets. Prove that A × (B ∪ C) = (A × B) ∪ (A × C)
Claim: Let A, B, C and D be sets. If A × B 6= ∅ and A × B = C × D, the
A = C and B = D.
Proof:
We need to show that A ⊂ C and B ⊂ D and at the same time C ⊂ A and
D⊂B
Let a ∈ A and b ∈ B
Then (a, b) ∈ A × B
⇒ (a, b) ∈ C × D since A × B = C × D
⇒ a ∈ C and b ∈ D
⇒ A ⊂ C and B ⊂ D.....................(1)
Now, let c ∈ C and d ∈ D.
Then (c, d) ∈ C × D
⇒ (c, d) ∈ A × B since A × B = C × D
⇒ c ∈ A and d ∈ B
⇒ C ⊂ A and D ⊂ B....................(2)
From (1) and (2) A = C and B = D.
NB: The results above could not necessarily hold if A × B = ∅.
For instance, let A = D = ∅ and let B = {x} and C = {y} .
Then A × B = ∅ and C × D = ∅
⇒A×B =C ×D
However, B * D
FUNCTIONS:
Defn: Let A and B be non-empty set sets. A function f from A to B is a
rule that assigns to each element of A exactly one element of B. We write f(a)
= b if b is a unique element of B assigned by the function f to the element a of
A. If f is a function from A to B, we write
f : A → B or A → B
In this case we call A the domain of f, denoted dom f, and B the codomain
of f; denoted cod f. If f(a) = b, we say that b is the image of a and a is the
preimage of b. The range, or image of f is the subset of B containing all the
images of the elements of A. It is denoted f (A) or range f or imf .
In other words, f (A)=imf = imf = {b ∈ B| ∃a ∈ A, b = f (a)}
Remark: Functions are also called mappings or transformations. We usu-
ally use lower case letters to denote functions.
If f : A → B, we say that f maps A to B.
Example:
1. Consider the following relations:
MISSING DIAGRAMS
In this case f is a function with domain A = a, b, cand codomain B = 1, 2, 3, 4.
Also, f (a) = 3, f (b) = 4, f (c) = 4, and f (A) = imf = 3, 4.
However, g is not a function since the element a in A is assigned two distinct
elements of B. Similarly, h is not a function since b ∈ A is not assigned any
element of B by h.
38
2. Let A = 1, 2, 3, 4, 5 and B = a, b, c, d with f (1) = b, f (2) = a, f (3) =
d, f (4) = a, and f (5) = a. Then f is a function from A to B and im f = a, b, d
3. Let f : Z → Z where f (x) = x2 . Then
domf = Set of all integers Z
codf = Set of all integers Z
rangef = the set of all integers that are perfect squares i.e. {0, 1, 4, 9, 16, ...}
2
4. If f (x) = x x+3 , then dom f =R|{0}.
Defn: A function is called a real-valued if its codomain is the set of real
numbers, and is called integer-valued if its codomain is the set of integers.
Defn: Let f1 and f2 be functions from A to R. Then f1 + f2 and f1 f2 are
also functions from A to R defined ∀x ∈ A by:
(f1 + f2 )(x) = f1 (x) + f2 (x)
(f1 f2 )(x) = f1 (x)f2 (x)
Example:
Let f1 and f2 be functions from R to R such that f1 (x) = x2 and f2 (x) =
x − x2 . Then
(f1 + f2 )(x) = f1 (x) + f2 (x)
= x2 + (x − x2 )
=x
and
(f1 f2 )(x) = x2 (x − x2 )
= x3 − x4 .
Types of Functions
One-to-one Functions (Injections)
A function f is said to be one-to-one (1 - 1), or injection, if and only if
f (a) = f (b) implies that a = b for all x and y in the domain of f i.e. if and
only if distinct images in the codomain. A function is called injective if it is
one-to-one.
NB: A function f is one-to-one if and only if f (a) 6= f (b) whenever a 6= b.
Example:
1. Determine whether the function f from {a, b, c, d} to {1, 2, 3, 4, 5} with
f (a) = 4, f (b) = 5, f (c) = 1 and f (d) 6= 3 is one-to-one.
Solution:
Representing the function using an arrow diagrams:
MISSING ARROW DIAGRAM
Distinct elements in domf have distinct images in codf . So, f is 1 − 1.
2. Let f : Z → Z where f (x) = x2 . In this case f (1) = f (−1) = 1. However,
1 6= 1. Therefore, the function is not 1 − 1.
3. The function g : Z → Z, g(x) = x3 is 1 − 1.
4. The function h : Z → Z, h(x) = x + 1 is 1 − 1 also.
Given a function f , to check whether f is 1 − 1, we first assume f (x) = f (y).
Then if we manage to show that x = y, the function is 1 − 1.
Example:
1. Let f : R → R be defined by f (x) = 2x + 3. Determine whether f is 1 − 1
or not.
39
Solution:
Suppose f (x1 ) = f (x2 ), Then
x21 = x22
= x1 = ±x2
i.e. x1 = x2 or x1 = −x2
Thus, f is not 1 − 1.
However, g : R+ → R, g(x) = x2 is 1 − 1.
NB: Let : A → B be a function. Then if |A| > |B|, then f is not 1 − 1.
Onto Functions (Surjections)
A function f : A → B is called onto, or a surjections, if and only if ∀b ∈ B
∃a ∈ A for which f (a) = b i.e. if and only if every element in the co-domain has
a pre-image. This in turn implies that f is onto if and only if imf = codf = B.
A function f is called surjective if it is onto.
Example:
1. Consider the function f and g with arrow diagrams as below
MISSING ARROW DIAGRAM
Then f is not onto since the element 3 in codf has no pre-image i.e. notexists
x ∈ domf for which f (x) = 3. However, f is 1 − 1.
On the other hand g is onto since ∀y ∈ cod g ∃x ∈ dom g such that g(x) = y.
However, g is not 1 − 1 since g(b) = g(c) = 2 yet b 6= c.
2. The function f : R → R, f (x) = x2 is not onto since R− (negative real
numbers) do not have pre-images. However, g : R+ → R+ , g(x) = x2 is onto.
3. The function f : R → R, f (x) → x3 is onto.
x if x ≥ 0
4. The function f : Z → Z+ , f (x) = |x| = is onto but not
−x if x < 0
one-to-one.
5. Show that the function f : Z → Z, f (x) = x + 1 is onto
Solution:
∀y ∈ Z, ∃x ∈ Z, f (x) = y. This is so because f (x) = y if and only if x+1 = y
which is the case if and only if x = y − 1.
NB: If f : A → B is a function and |A| < |B|, then f is not onto.
Bijections:
A function f : A → B is called a bijection, or a one-to-one correspondence,
if it is both 1 − 1 and onto. In this case we say that f is bijective.
Example:
1. Let f be the function from {a, b, c, d} to {1, 2, 3, 4} with f (a) = 4, f (b) =
2, f (c) = 1, and f (d) = 3
MISSING ARROW DIAGRAM
The function f is both 1 − 1 and onto. Hence, f is a bijective.
2. The function f : R → R, f (x) = x3 is a bijection since it is both 1-1 and
onto. However, g : R → R with g(x) = x2 is not a bijection since it is not 1-1
or onto.
3. The function f : Z → Z, f (x) = x + 1 is a bijective.
Claim: If f : A → B is a bijection, then |A| = |B|.
Proof:
40
Due to one-to-oneness |A| = |f (A)| and due to ontoness |f (A)| = |B|. There-
fore |A| = |B|.
Identity Function:
For non-empty set A, there exists a trivial mapping that maps every element
a of A to itself. This is called the identity function, denoted by i. So i : A → A
such that a(a) = a ∀a ∈ A. The identity function is one-to-one and onto, so it
is a bijection.
Example:
Let A = {1, 2, 3, 4}. Then i : A → A, i(a) = a ∀a ∈ A, i.e i(1) = 1, i(2) = 2,
i(3) = 3 and i(4) = 4. From an arrow diagram point of view.
MISSING AN ARROW DIAGRAM
Constant Function
Let f : A → B be a function. Then f is called a constant function if there
is a fixed elements b ∈ B such that f (a) = b ∀a ∈ A
Example:
Let A={1, 2, 3, 4} and B = {a, b, c}. Define f : A → B such that
f (1) = f (2) = f (3) = f (4) = b. Then, f is constant function.
MISSING ARROW DIAGRAM
Inverse Functions
Suppose f : A → B is a bijection. Since f is onto, then every element b ∈ B
is the image of some element a ∈ A. Also, since f is 1-1, then for every b ∈ B
there is a unique a ∈ A such that b = f (a). Consequently, we can define a new
function from B to A. This function is called the inverse function of f , denoted
by f −1 . If f (a) = b, then f −1 (b) = a
NB:
1. A function f is invertible (i.e. has an inverse f −1 ) if and only if it is
bijective.
1
2. The inverse function f −1 is not the same as the function f.
Example:
1. Find the inverse function of f : R → R where f (x) = 2x − 3
solution:
Let y = f (x) = 2x − 3. Making x the subject we have
y + 3 ⇒ x = y+3 2 =f
−1
(y)
Now, replace x with y −1 = f −1 (x) and y and x gives :
y −1 = x+3
2
So that f −1 (x) = x+3
2
3x+1
2. Find the inverse function of f : R → R f (x) = 2x+7
Solution:
Let
y = f (x) = 3x+1
2x+7
⇒ 2xy + 7y = 3x + 1
⇒ 2xy − 3x = 1 − 7y
⇒ x(2y − 3) = 1 − 7y
1−7y
⇒ x = 2y−3
41
7y−1
⇒ x = 3−2y = f −1 (y)
Replacing x with f −1 (x) and y with x we have
7x−1
f −1 (x) = 3−2x
3. Let f be a function from {a, b, c} to {1, 2, 3} such that f (a) = 2,
f (b) = 3 and f (c) = 1. Then f is invertible since it is a bijection. Furthermore,
f −1 (2) = a, f −1 (3) = b and f −1 (1) = c.
MISSING DIAGRAM ARROW
4. The function f : Z → Z such that f (x) = x + 1 is invertible with
f −1 (y) = y − 1 while the function g : R → R where g(x) = x2 is not invertible
since g is not 1 - 1 or onto.
Composition of Functions
Suppose two functions are such that the codomain of the first is equal to the
domain of the second. Then we can define a function from the domain of the
first to the codomain of the second comprising of the two functions following
each other.
For instance, let f : A → B and g : B → C be functions. We can define a
function from A to C which would be f followed by g, denoted by gof and read
as “g composition f”. Such a function is called a composite function.
MISSING ARROW DIAGRAM
Clearly, (gof )(a) = g(f (a)).
NB: In the case above f og is not defined since cod g 6= dom f.
Example:
1. Let A={a, b, c}, B={1, 2, 3}, C={x, y, z} and let f : A → B with
f (a) = 2, f (b) = 3, f (c) = 1 and g : B → C with g(1) = z, g(2) = x, g(3) = y
Then gof is defined since cod f = dom g. In this case
(gof )(a) = g(f (a)) = g(2) = x
(gof )(b) = g(f (b)) = g(3) = y
(gof )(c) = g(f (c)) = g(1) = z
Note that f og is not defined since cod g6= dom f
MISSING ARROW DIAGRAM
2. Let f : R → R and g : R → R be defined by f (x) = x2 + 1 and
g(x) = 2x − 5 respectively. Then
(f og)(x) = f (g(x))
= f (2x − 5)
= (2x − 5)2 + 1
= 4x2 − 20x + 26
(gof )(x) = g(f (x))
= g(x2 + 1)
= 2(x2 + 1) − 5
= 2x2 − 3
NB:
In general, f og 6= gof . In other words, composition of functions is not
commutative.
A composition of two bijections is another bijection.
42
3. Let f,g : Z → Z be defined by f (x) = 2x + 3 and g(x) = 3x + 2. Find
f og and gof
Solution:
(f og)(x) = f (g(x))
= f (3x + 2)
= 2(3x + 2) + 3
= 6x + 7
(gof )(x) = g(f (x))
= g(2x + 3)
= 3(2x + 3) + 2
= 6x + 11
NB:
For any three functions f, g and h, (f og)oh = f o(goh). This is clear since
[(f og)oh]x = [f og]h(x) = f {g[h(x)]}
And
[f o(goh)]x = f {[goh](x)} = f {g[h(x)]}
Example:
Let f , g, h : Z → Z where f (x) = 3x + 2, g(x) = x2 − 3 and h(x) = 2x + 1.
Then
[f og)oh]x = [f o(goh)](x)
= f {g[h(x)]}
= f {g[2x + 1]}
= f {(2x + 1)2 − 3}
= f {4x2 + 4x − 2}
= 3(4x2 + 4x − 2) + 2
= 12x2 + 12x − 4
Theorem: If f : A → B is a bijection then f of −1 = f −1 of = i
Proof:
Recall that if f (a) = b, then f −1 (b) = a for a bijection f .
Now
(f of −1 )(b) = f [f −1 (b)]
= f (a)
=b
⇒ f of −1 = i
Also
(f −1 of )(a) = f −1 [f (a)]
= f −1 (b)
=a
⇒ f −1 of = i
Therefore, f of −1 = f −1 of = i
Exercise:
Show that if both f : A → B and g : B → C are surjectives then gof is also
surjective.
Functions that Involve Cartesian Products of sets
43
Since in the definition of a function we require the domain and the codomain
to be non-empty, either of the two or even both may be a cartesian product of
sets.
Example:
1. The function f : Z → Z, f (x, y) = x assigns to each pair of integers the
first integer in the pair. The function is onto but not 1 − 1. E.g. f (0, 1) =
f (0, 2) = 0.
2. Similarly, the function g : Z × Z → Z, f (a, b) = 2a − b is onto but not
1 − 1. E.g. g(1, 1) = g(0, −1) = 1
METHODS OF PROOF
Some Important Terminology:
• Theorem- a statement that can be shown to be true. Less important
theorems are called propositions. Theorems can also be reffered to as
facts or results.
• Proof - a valid argument that establishes the truth of a theorem, i.e. a
demonstration that a theorem is true.
• Axioms / Postulates - statements that are used in the proof of another
theorem.
• Lemma - a simple theorem that is used in the proof of another theorem.
• Corollary - a theorem that can be established directly from the theorem
that has been proved, i.e. a consequence of a theorem.
• Conjecture - a statement that is being proposed to be true but that has
not been proved i.e. its truth value is unknown. When the proof of a
conjecture is found, the conjecture becomes a theorem.
1. Direct Proof:
This is a proof p → q is true that proceeds by showing that q is true when
p is true. One begins with the premise p and comes up with some intermediate
propositions p1 , p2 , ..., pn , and end with the conclusion q, i.e. p → p1 → p2 →
... → pn → q.
Sometimes when coming up with the intermediate propositions one urgues
from both propositions p and q. This is called forward - backward reasoning.
Examples:
1. Use direct proof to proof that if a is odd and b is even, then ab is even.
Proof:
If a is odd, then a = 2x + 1 for some x ∈ Z and
if b is even, then b = 2y for some y ∈ Z
Now:
ab = (2x + 1)2y
= 4xy + 2y
= 2(2xy + y) where 2xy + y ∈ Z
Thus, ab is even.
44
2. Proof that the product of two odd numbers is odd.
Proof:
Suppose both a and b are odd. Then a = 2m + 1 and b = 2n + 1 where
m, n ∈ Z. Now,
ab = (2m + 1)(2n + 1)
= 4mn + 2m + 2n + 1
= 2(2mn + m + n) + 1
Which is odd.
3. Proof that the product of any two rational numbers is rational
Proof:
Let a, b ∈ Q. Then a = pq and b = rs where p, q, r, s ∈ Z and q, s 6= 0. Now,
ab = pq × rs
= prqs
Where pr, qs ∈ Z and qs 6= 0. Hence ab is rational.
4. Proof that if m and n are perfect squares, then mn is also a perfect
square.
Proof:
Suppose m = x2 and n = y 2 where x, y ∈ Z. Then
mn = x2 y 2
= (xy)2 where x, y ∈ Z
Therefore, mn is a perfect square.
5. Give a direct proof for the statement that “if q is even, then 4 divides q 2 ”
Proof:
Suppose q is even. Then ∃ t ∈ Z such that q = 2t .
Now,
q 2 = (2t)2
= 4t2
So, 4 divides q 2 .
6. Proof that if n is an odd integer, then n2 is also odd.
Proof:
Suppose n = 2p + 1, p ∈ Z. Then
n2 = (2p + 1)(2p + 1)
= 4p2 + 4p + 1
= 2(2p2 + 2p) + 1
Which is odd.
2. Proof by Contraposition:
This method makes use of the fact that the conditional statements p → q
is equivalent to its contrapositive ∼ q →∼ p. So, the conditional p → q can be
proved by showing that its contrapositive, ∼ q →∼ p, is true.
This method is used when we cannot easily find a direct proof. Such a proof
is called an indirect proof.
Example:
1. Prove that if n is an integer and 3n + 2 is odd, then n is odd.
Proof:
The corresponding contrapositive is “if n is even, then 3n + 2 is even”.
45
Suppose n is even. Then n = 2k, k ∈ Z.
Now,
3n + 2 = 3(2k) + 2 = 2(3 + 1) where 3k + 1 ∈ Z
So, 3n + 2 is even.
2. Show that x is odd if x2 is odd.
Proof:
It is enough to show that if x is even, then x2 is even also.
Suppose x is even. Then x = 2p, p ∈ Z
Now,
x2 = (2p)2
= 4p2
= 2(2p) where 2p ∈ Z
So, x2 is even. √
√ Prove that if n = ab for some positive integers a and b, then a ≤ n or
3.
b ≤ n.
Proof: √ √
The contrapositive of the given statement is “if a > n and b > n then
n 6= ab”. √ √ √ √
Suppose a > n and b > n. Then ab > n n = n, i.e. n < ab
So, n 6= ab
3. Proof by Contradiction:
Suppose p is a proposition. We can prove that p is true by showing that
∼ p is false; this can be done by showing that ∼ p → (q∧ ∼ q) is true for some
proposition q. This method of proof is called proof by contradiction, and it is
an indirect method of proof.
Example: √
1. Proof that 2 is irrational.
Solution: √
Suppose
√ 2 is rational. Then ∃ x, y ∈ Z such that
2 = xy , y 6= 0 and gcd(x, y) = 1
2
⇒ 2 = xy2
⇒ 2y 2 = x2
⇒ x2 is divisible by 2
⇒ x is divisible by 2
⇒ x = 2k, k ∈ Z
⇒ 2y 2 = (2k)2 = 4k 2
⇒ y 2 = 2k 2
⇒ 2 divides y 2
⇒ 2 divides y
Since 2 |x and 2 |y (i.e.
√ 2 divides x and 2 divides y), then gcd(x, y) 6= 1, a
contradiction. Therefore, 2 must be irrational.
2. Proof by contradiction that if n is an integer and that 3n + 2 is odd, then
n is odd.
Proof:
46
Suppose 3n + 2 is odd and n is even. Then n = 2k , k ∈ Z and 3n + 2 =
3(2k) + 2 = 2(3k + 1) which is even, a contradiction.
So, if 3n + 2 is odd, then n is odd.
Exercise:
√
1. Prove that p is irrational for any prime p.
2. Prove by contardiction that an integer n is odd if and only if n2 is odd.
3. Prove that if n is an integer and n3 + 3 is odd, then n is even, using
(a) Contaradiction
(b) Contaraposition
4. Prove that if n is an integer, the foloowing statements are equivalent :
(i) n is even.
(ii) n + 1 is odd.
(iii) 3n + 1 is odd.
(iv) 3n is even.
4. Disproof by counterexample:
Consider a statement of the form ∀x P (x). We may show that the statement
is false by showing that there exists an element x in the domain of discourse
such that P (x) is false. Such an x is called a counterexample.
Example:
1. The product of any two irrational numbers is irrational
Disproof:
√ √
2 2 = 2 which is rational.
2. For all real numbers a and b, if a2 = b2 , then a = b.
Disproof:
Let a = 1 and b = −1. Then a2 = 12 = 1 and
b2 = (−1)2 and so a2 = b2 . However a 6= b since 1 6= −1
3. Prive that it is not necessary that 2n + 1 is prime for all non-negative
integers n
Proof:
If n = 3, then 23 + 1 = 9 which is not prime.
5. Proof by Mathematical Induction:
This is used to proof propositions of the form ∀ np(n) is true where p(n) is
a property that n must satisfy.
i.e. p(n) is true for all positive integers.
The statement p(n) is called the inductive hypothesis.
Let p(n) be a property that n must satisfy for a variable natural number n,
then if p(1) is true and p(k + 1) is true whenever p(k) is true for k > 0 then
p(n) is true for every n ∈ N.
Examples:
1. Show that the sum of the first n natural numbers is
n(+1)
2
Proof:
n(n+1)
We show that 1 + 2 + 3 + ... + n = 2
There are two steps involved:
(a) Base step: Prove for n = 1
47
1 = n(2)
2 = 1
(b) Inductive step : Assume true for n = k and prove for n = k + 1
For n = k, then 1 + 2 + 3 + ... + k = k(k+1)
2
For n = k + 1
1 + 2 + 3 + ... + k(k + 1)
= k(k+1)
2 + (k + 1)
k(k+1)+2(k+1)
= 2
= (k+1)(k+2)
2 = (k+1)[(k+1)+1]
2
So true for n = k + 1
Since true for n = 1 and true for n = k + 1 whenever true for n = k, then it
is true for every n ≥ 1.
2. Prove that the sum of the first even n even natural number is n(n + 1).
Proof:
2 + 4 + 6 + ... +2n = n(n + 1)
Check if it is true for n = 1
2 = 1(2) = 2
Hence true for n = 1
Assume true for n = k, then
2 + 4 + 6 + ... +2k = k(k + 1)
For n = k + 1
2 + 4 + 6 +... + 2k + 2(k + 1) + 2(k + 1) = (k + 1)(k + 2)
Since true for n=1 and true for n = k + 1 , whenever true for n = k, it is
true for every n ≥ 1.
3. Prove that the sum of the first n odd natural numbers is n2 .
Proof:
1 + 3 + 5 + ... +(2n + 1) = n2
Check for n = 1,
1 = 12 , hence true for n = 1
Assume true for n = k, then
1 + 3 + 5 + ... + (2k − 1)= k 2
For n = k + 1
1 + 3 + 5 + ... + (2k − 1) + (2k + 1) = k 2 + 2k + 1 = (k + 1)2
Since true for n = 1 and true for n = k + 1 whenever true for n = k, it is
true for all values of n ≥ 1.
4. Prove that the sum of the squares of the first n natural numbers is
1
6 n(n + 1)(2n + 1)
Proof:
12 + 22 + 32 + ... + n2 = 61 n(n + 1)(2n + 1)
Check for n = 1
12 = 61 (1)(2)(3) = 1, hence true for n = 1.
Assume true for n = k, then
12 + 22 + 32 + ... + k 2 = 16 k(k + 1)(2k + 1)
For n = k + 1
12 + 22 + 32 + ... + k 2 + (k + 1)2 = 16 k(k + 1)(2k + 1) + (k + 1)2
= k+1
6 [k(2k + 1) + 6(k + 1)]
48
= k+1 2
6 (2k + 7k + 6)
k+1
= 6 (k + 2)(2k + 3)
= k+16 [(k + 1) + 1][2(k + 1) + 1]
So, true for n = k + 1 whenever true for n = k. Therefore, it is true for all
positive integers n ≥ 1.
5. 12 + 32 + 52 + ... + (2n − 1)2 = 13 n(4n2 − 1)
For n = 1
12 = 31 (1)[4(1) − 1] = 1, hence true for n = 1
Assume true for n = k, then
12 + 32 + 52 + ... + (2k − 1)2 = 13 k(4k 2 − 1)
For n = k + 1
12 + 32 + 52 + ... + (2k − 1)2 + [2(k + 1) − 1]2
= 31 k(4k 2 − 1) + [2(k + 1) − 1]2
k(4k2 −1)+3[2(k+1)−1]2
= 3 = k(2k+1)(2k−1)+3(2k+1)
3
3 2
4k −k+3[2k+1] (2k+1)[k(2k−1)+3(2k+1)
= 3 = 3
4k3 −k+3[4k2 +4k+1] (2k+1)(2k2 +5k+3)
= 3 = 3
4k3 +12k2 +11k+3
= 3 = (k+1)
3 (2k + 1)(2k + 3)
4k3 +4k2 +8k2 +8k+3k+3
= 3 = (k+1) 2
3 (4k + 8k + 3)
2
(k+1)(4k +8k+3)
= 3 = (k+1) 2
3 (4(k + 2k + 1) − 1]
(k+1) 2 (k+1) 2
= 3 [4(k + 2k + 1) − 1] = 3 (4(k + 1) −
1)
(k+1) 2
= 3 [4(k + 1) − 1]
So, true for n = k + 1 whenever true for n = k. Therefore, it is true for all
positive integers n.
6. Show that 82 − 1 is divisible by 7 for all positive integers n.
Proof:
For n = 1, 7 = 81 − 1 = 7(1) so true for n = 1
Suppose true for n = k
12 + 32 + 52 + ... + (2k − 1)2 + [2(k + 1) − 1]2
= 31 k(4k 2 − 1) + [2(k + 1) − 1]2
k(4k2 −1)+3[2(k+1)−1]2
= 3 = k(2k+1)(2k−1)+3(2k+1)
3
3 2
4k −k+3[2k+1] (2k+1)[k(2k−1)+3(2k+1)]
= 3 = 3
4k3 −k+3[4k2 +4k+1] (2k+1)(2k2 +5k+3)
= 3 = 3
4k3 +12k2 +11k+3
= 3 = (k+1)
3 (2k + 1)(2k + 3)
4k3 +4k2 +8k2 +8k+3k+3
= 3 = (k+1) 2
3 (4k + 8k + 3)
2
(k+1)(4k +8k+3
= 3 = (k+1) 2
3 [4(k + 2k + 1) − 1]
(k+1) 2 (k+1) 2
= 3 [4(k + 2k + 1) − 1] = 3 (4(k + 1) −
1)
(k+1) 2
= 3 [4(k + 1) − 1]
So, true for n = k + 1 whenever true for n = k. Therefore it is true for all
positive integers n.
7. Show that 8n − 1 is divisible by 7 for all positive integers n.
Proof:
49
For n = 1, 7 − 81 = 7 so true for n = 1.
Suppose true for n = k
8k − 1 = 7
For n = k + 1 Check if 8k+1 − 1 is divisible by 7.
8k+1 − 1 = 8(8k − 1) + 7
8k+1 − 1 = 8k+1 − 8.1 + 8.1 − 1 = 8(7x) + 7
= 8(8k − 1) + 7 = 7(8x + 1)
⇒ 7 divides 8k+1 − 1
So, true for n = k + 1 whenever true for n = k. Therefore, true for all
positive integers.
8. Show that 8 is a factor of 9n − 1 for every positive integer n.
Proof:
For n = 1, 91 − 1 = 8 = 8(1) so true for n = 1.
Suppose true for n = k, k ∈ Z+
⇒ 9k − 1 = 8(t)
NUMBERS
• The set of all natural numbers (positive integers) is
N = {1, 2, 3, 4, ...}.(It is also denoted by Z+ )
• The set of non-negative integers is
Znonneg = {0, 1, 2, 3, 4, ...} = Z+ ∪ {0}.
• The set of integers (whole number is)
Z = {..., −3, −2, −1, 0, 1, 2, 3, 4, ...}
• The set of rational numbers is
Q = {x|x = ab , a, b ∈ Z, b 6= 0 and gcd(a, b) = 1}
Numbers that are not rational are called irrational. The set irrational
numbers is denoted Qc .
• The set of all real numbers is given by R = Q ∪ Qc .
• A complex number is one of the form a+bi where√ a and b are real numbers
while i is the imaginary number defined as i = −1. The set of all complex
numbers is denoted by C.
NB: N ⊂ Z ⊂ Q ⊂ R ⊂ C
• A positive integer p is called prime if it has exactly two positive divisors,
namely 1 and p itself. The first few prime numbers are 2, 3, 5, 7, 11, 13,
17, 19 and 23. The number 2 is the only even prime number.
• An integer n > 1 is called composite if it is not prime. In other words
n is composite if there exists two integers a and b with 1 < a ≤ b < n
such that n = ab. Clearly, a composite number has at least three positive
divisors.
50
• A number n is even if ∃ k ∈ Z such that n = 2k.
• A number n is odd if ∃ k ∈ Z such that n = 2k + 1.
• A integer n is perfect square if and only if ∃a ∈ Z such that n = a2 .
Laws of Arithemtic on Real Numbers
• Closure law for addition:
∀ a, b ∈ R, a + b ∈ R
• Closure law for multiplication
∀ a, b ∈ R, a, b ∈ R
• Associative law for addition
∀ a, b, c ∈ R, (a + b) + c = a + (b + c)
• Associative law for multiplication
∀ a, b, c ∈ R, (ab)c = a(bc)
• Commutative law for addition
∀ a, b ∈ R, a + b = b + a
• Commutative law for multiplication
∀ a, b ∈ R, ab = ba
• Additive identity law
∃ an element 0 in R, called the zero element such that for any a ∈ R,
a + 0 = 0 + a = a.
• Multiplicative identity law
∃ an element 1 in R, called the unity element such that for any a ∈ R,
a.1 = 1.a = a.
51