Linear Algebra & Discrete Math Guide
Linear Algebra & Discrete Math Guide
MATHEMATICS
April 2024
Contents
1 Set, Logic and Matrix. 2
1.1 Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1
1. Set, Logic and Matrix.
1.1 Set
Definition 1.1.1. A set is a collection of well defined and distinct objects.
Definition 1.1.4. A set is said to be finite if it has finite number of elements, otherwise it is
infinite.
Example 1.1.5. A set {6, 8, 10, 12, 14, 16, 18, 20} is finite set while a set R is infinite.
Definition 1.1.6. The cardinality of a set is defined as the number of elements in a set. Two
sets are said to be equivalent if they have the same cardinality while two sets are said to be equal
if they have the same cardinality and all elements are equal.
Example 1.1.7. Let A = {a, e, i, o, u}, B = {e, a, i, u, o} and C = {a, b, c, d, e}. We note that
A is equal to B but not equal to C. Also these sets are equivalent to each other i.e A = B ̸= C
while A ≡ B ≡ C.
Definition 1.1.8 (Set difference). The difference of two sets A and B written as A \ B or A − B
is a set that contains elements of A that are not in B. Mathematically, A − B = A ∩ B c .
Definition 1.1.9 (Symmetric difference). The symmetric difference of two sets A and B written
as A ⊖ B or A∆B is a set that contains elements which are either in A or in B but not in both.
Mathematically, A∆B = (A ∩ B c ) ∪ (B ∩ Ac ).
2
Section 1.1. Set Page 3
(A ∪ B)c = Ac ∩ B c
(A ∩ B)c = Ac ∪ B c
2. Commutative Laws.
A∪B =B∪A
A∩B =B∩A
3. Associative Laws.
(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
4. Distributive Laws.
(A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C)
(A ∩ B) ∪ C = (A ∪ C) ∩ (B ∪ C)
5. Absorption Laws.
(A ∪ B) ∩ A = A
(A ∩ B) ∪ A = A
6. Identity Laws.
A∪∅=∅∪A=A
A∩U =U ∩A=A
A∪U =U
A∩∅=∅
8. Complement Laws.
A ∪ Ac = U
A ∩ Ac = ∅
9. Double Complement.
(Ac )c = A
Section 1.1. Set Page 4
Exercise 1.1.12. Let A, B and C be non-empty sets. Use set identities to:
1. Prove that:
(a) (A − B) ∪ B = A ∪ B.
(b) (A − B) ∩ B = ∅.
2. Show that, if A ∩ B = ∅, then A − B = A.
3. Show that:
(a) (A ∩ B) − (A ∩ C) = A ∩ (B − c) = A ∩ (B − C).
(b) (A \ B) ∪ (A \ C) = A \ (B ∩ C).
4. Prove that, (A \ B) \ (B \ C) = A ∪ B.
5. Prove that, (A − B) ∩ (B − A) = ∅.
Relation
Cartesian Product.
Definition 1.1.13. Let A and B be non empty sets. The cartesian product of A with B is the
set
A × B = {(a, b) : a ∈ A and b ∈ B}.
The element (a, b) is called an ordered pair with co-ordinates a and b.
If A1 , A2 , . . . , An are non empty sets, then the product of these sets is:
A1 × A2 × . . . × An = {(a1 , a2 , . . . , an ) : ai ∈ Ai , i = 1, 2, . . . , n}.
If A and B are finite sets with |A| = m and |B| = n, then |A × B| = m × n.
Relation on a Set.
Definition 1.1.15. Let A and B be non empty sets. A relation R from A to B denoted as A RB
is a subset of a cartesian product A × B.
Definition 1.1.18. Let R be a relation from A to B. The inverse of R denoted by R−1 is the
relation R−1 = {(b, a) : (a, b) ∈ R}.
Example 1.1.19. Let A = {a, b, c} and B = {1, 2, 3, 4}; R = {(a, 1), (a, 2), (c, 4)} is a relation
from A to B and R−1 = {(1, 1), (2, a), (4, c)} is the inverse of R.
1.2 Logic.
Logic is the science of reasoning. Reasoning in logic is called inferring (drawing conclusion from
premises).
Definition 1.2.2. An argument is a collection of statements, one of which is the conclusion and
others are statement.
Definition 1.2.4. Inductive logic is the form of logic which draws probable(likely) conclusion.
That is, the truth value of premises does not guarantee the truth value of the conclusion.
Argument 1 is inductive logic as the existence of smoke does not guarantee the existence of fire.
Definition 1.2.5. Deductive logic is the form of logic whereby the truth value of the premises
necessitates the truth of the conclusion.
Statement Vs Proposition.
Definition 1.2.6. A statement is a declarative sentence that is either true or false, but not both
and the truth or falsehood of the provided statement may be unknown.
Definition 1.2.8. A proposition is a declarative sentence that can either be true or false but not
both, and the truth or falsehood of the provided statement must be known.
1. 5 + 9 = 12.
2. A statement “God exists” is not a proposition as the existence of God is unknown.
Remark 1.2.9. Every proposition is a statement but not every statement is a proposition.
Definition 1.2.10. A proposition is said to be atomic if its truth value does not depend on the
truth value of any other proposition. Example, A proposition 2 + 3 = 5 is an atomic proposition
Exercise 1.2.12. Let P, Q, R and S be atomic proposition. Construct the truth table for each
of the following.
1. (P ∧ Q) −→ R.
2. (P ∧ (Q −→ R)) ∨ S.
3. (P ∨ Q) −→ (P ∧ Q).
4. P ↔ (R ∧ S).
5. ¬(¬P ∨ Q).
6. ¬((P ∧ (¬R ∨ Q)) ∧ R).
Definition 1.2.16. Two statements are said to be logically equivalent if they always produce
the same truth value (they have the same truth value under every valuation). If P is equivalent
to Q, we denote it as ≡ Q.
2. Commutative Laws.
P ∨Q≡Q∨P
P ∧Q≡Q∧P
3. Associative Laws.
(P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)
(P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)
Section 1.2. Logic. Page 10
4. Distributive Laws.
(P ∨ Q) ∧ R ≡ (P ∧ R) ∨ (Q ∧ R)
(P ∧ Q) ∨ R ≡ (P ∨ R) ∧ (Q ∨ R)
5. Absorption Laws.
(P ∨ Q) ∧ P ≡ P
(P ∧ Q) ∨ P ≡ P
6. Identity Laws.
P ∨F ≡F ∨P ≡P
P ∧T ≡T ∧P ≡P
P ∨T ≡T
P ∧F ≡F
8. Negation Laws.
P ∨ ¬P ≡ T
P ∧ ¬P ≡ F
¬P (¬P ) ≡ P
¬T ≡ F
¬F ≡ T
P ∨P ≡P
P ∧P ≡P
Exercise 1.2.18. Repeat exercise 1.2.17 by using the laws of logical equivalences.
Section 1.3. Matrix Page 11
1.3 Matrix
1.3.1 Definition and notations. A representation of items (information) stored or arranged in
an order fashion is simply called a Matrix. Mathematically, the concept of a matrix refers to a
set of numbers, variables or functions ordered in rows and columns.
Definition 1.3.4. A matrix is said to be a column matrix (column vector) if it has only one
column and several row(s). While a matrix with only one row and several column(s) is called a
row matrix (row vector).
is a row matrix.
5 0 4
3. (5) ·
−1 2 3
3 7 5 2 1 1
4. 4 5 −2 + 9 −11 0
3 0 −7 2 3 1
3 7 5 2 1 1
5. 4 5 −2 − 9 −11 0
3 0 −7 2 3 1
Definition 1.3.7 (Trace of a matrix). If A is the square matrix, then the trace of A denoted by
tr(A) is defined as the sum of all entries in the main diagonal of A.
2 1 1
Example 1.3.8. If A = 9 −11 0, then tr(A) = 2 + (−11) + 1 = −8.
2 3 1
Definition 1.3.11 (Square Matrix). A square matrix is a matrix of dimension n. i.e a matrix
with the same number of rows and columns.
Definition 1.3.13 (Identity Matrix). It is a square matrix in which all the elements of the
principal(main) diagonal are ones and all other elements are zeros.
Section 1.3. Matrix Page 13
Definition 1.3.15 (Diagonal Matrix). A diagonal matrix is an n × n matrix whose non diagonal
entries are zero.
is a diagonal matrix.
Definition 1.3.18 (Triangular Matrix). It is a square matrix which is either upper triangular or
lower triangular. An upper triangular matrix is an n × n matrix in which all entries below the
main diagonal are zero. A lower triangular matrix is a square matrix in which all entries above
the main diagonal are zero.
Definition 1.3.20 (Symmetric Matrix). A matrix A is said to be symmetric if aij = aji for all i
and j. That is, AT = A. .
Section 1.3. Matrix Page 14
Definition 1.3.26 (Minor and Cofactor). The minor of the entry aij in a given determinant is
denoted by Mij obtained from the determinant of order (n − 1 × n − 1) after deleting the ith
row and j th column of An matrix. The scalar(number) Cij = (−1)i+j Mij is called the Cofactor
of the element aij of the matrix A.
1 0 −2
Example 1.3.27. Consider the matrix A = −3 1 4 . We have:
2 −3 4
1 4
M11 = = 4 − (−12) = 16 and C11 = (−1)1+1 (16) = 16;
−3 4
0 −2
M21 = = 0 − 6 = −6 and C21 = (−1)2+1 (−6) = (−1)(−6) = 6.
−3 4
Section 1.3. Matrix Page 15
1 −2 0 −2 0 1
3 −2 +1 = 3(4 + 6) − 2(2) + (−1) = 25.
3 4 1 3 1 3
Definition 1.3.30 (Cofactor matrix and adjoint matrix). If A is a square matrix and Cij is a
cofactor of aij then, the matrix
C11 C12 · · · C1n
C21 C22 · · · C2n
C = ..
.. .. ..
. . . .
Cn1 Cn2 · · · Cnn
is called cofactor matrix. The transpose of cofactor matrix is called the adjoint matrix.
A matrix A is said to be invertible (has the inverse) if det(A) ̸= 0.
Definition 1.3.31. If the matrix A is invertible, then the inverse of A denoted by A−1 is given
by:
Adj(A)
A−1 = .
det(A)
3 2 1
Example 1.3.32. Given the matrix A = 0 1 −2;
1 3 4
1 −2 0 −2 0 1
C11 = = 10; C12 = − = −2; C13 = = −1
3 4 1 4 1 3
2 1 3 1 3 2
C21 = − = −5; C22 = = 11; C23 = − = −7
3 4 1 4 1 3
2 1 3 1 3 2
C31 = = −5; C32 = − = 6; C33 = = 3.
1 −2 0 −2 0 1
It follows that:
10 −2 −1 10 −5 −5
Cof (A) = −5 11 −7 and Adj(A) = −2 11 6 .
−5 6 3 −1 −7 3
Section 1.3. Matrix Page 16
1 −2 0 −2 0 1
det(A) = 3 −2 +1 = 3(4 + 6) − 2(2) + (−1) = 25.
3 4 1 3 1 3
Adj(A)
From A−1 = det(A)
, we get
−1 −1
2
5 5 5
10 −5 −5
−1 1 −2 11 6
A = −2 11 6 =
25 25 25
.
25
−1 −7 3
−1 −7 3
25 25 25
Exercise 1.3.33. For each of the following matrices, evaluate its determinant and compute the
inverse (if it exists).
1 2 3 1 0 3 3 2 −1 5 8 9 1 −7 3
1. 0 −1 1 2. −7 0 1 3. 1 6 3 4. 0 1 −2 5. 0 0 0
3 2 2 3 0 2 2 −4 0 1 3 4 3 5 −2
Definition 1.3.34. Two matrices are said to be row equivalent if there is a sequence of ERO
that transforms one matrix into the other.
Remark 1.3.35. Row operations are reversible. If two rows are interchanged they can be returned
to their original positions by another interchange. If a row is scaled by a constant c, then
multiplying by 1c produces the original row. Also, suppose that c times row 1 is added to row 2
to produce new row 2, to reverse this operation add −c times row 1 to new row 2 you will obtain
the original row 2.
Definition 1.3.36. A row (column) in a matrix is called a nonzero row (column) if it contains at
least one nonzero entry. Leading entry of a row is the leftmost nonzero entry in a nonzero row.
Row Echelon Form (Gauss method).
Section 1.3. Matrix Page 17
Definition 1.3.37. A rectangular matrix is in echelon form/row echelon form EF(REF) if it has
the following three properties:
1. All nonzero rows are above any rows of all zeros.
2. Each row leading entry is in a column to the right of the leading entry of the row above it.
3. All entries in a column below a leading entry are zeros.
1 2 1 1 1 2 1 1 1 2 1 1
R2 =2R1 −R2 & R3 =3R1 −R3
2 4 2 2 −−−−−−−−−−−−−−−−−→ 0
0 0 0 R2 ↔ R3 0
0 0 −1
3 6 3 4 0 0 0 −1 0 0 0 0
is in rref.
3 2 1 | 1 0 0 3 2 1 | 1 0 0
R =3R −R1
Solution: [A|I] = 0 1 −2 | 0 1 0 −−3−−−3−−→ 0 1 −2 | 0 1 0
1 3 4 | 0 0 1 0 7 11 | −1 0 3
y
R1 = R1 − 2R2
R3 = R3 − 7R2
3 0 5 | 1 −2 0
0 1 −2 | 0 1 0
0 0 25 | −1 −7 3
y
R1 = 5R1 − R3
R2 = 25R2 + 2R3
15 0 0 | 6 −3 −3
0 25 0 | −2 11 6
0 0 25 | −1 −7 3
y
1 1 1
R1 = R1 , R2 = R2 , R3 = R3
15 25 25
2 −1 −1
1 0 0 | 5 5 5 1 10 −5 −5
0 1 0 | −2 11 6 =⇒ A−1 = −2 11 6
25 25 25
−1 −7 3 25
0 0 1 | 25 25 25 −1 −7 3
Exercise 1.3.42. Reduce the following matrices into ref, state the rank and reduce into rref.
1 2 3 1 0 3 3 2 −1 5 8 9 1 −7 3
1. 0 −1 1
2. −7 0
1 3. 1 6 3 4. 0 1 −2 5. 0 0 0
3 2 2 3 0 2 2 −4 0 1 3 4 3 5 −2
Find the inverse (if it exists) of each of the above matrices by elementary row operations.