Discrete Mathematics Notes - 2012
Discrete Mathematics Notes - 2012
Discrete Mathematics Notes - 2012
Department of Mathematics, University College London, Gower Street, London, WC1E 6BT
E-mail address: asobolev@maths.ucl.ac.uk
http://www.homepages.ucl.ac.uk/ucahaso
.
Abstract. This is is a draft a one term course for 1st year Computer Science students.
Contents
Chapter 1. Set Theory, Permutations, Groups
1. Basic definitions and concepts
2. Advanced operations on sets
3. Functions
4. Permutations and Groups
5. Binary operations and Groups
6. Equivalence relations and Lagranges Theorem
1
1
3
4
7
10
13
19
19
23
31
31
35
37
40
42
46
CHAPTER 1
Ac B c = (A B)c ,
(1.2)
Ac B c = (A B)c .
= {x : i I : x Ai };
\
Ai = {x : i I : x Ai }.
iI
iI
iI
iI
Proof.
or truth tables wouldnt help! Suppose
Venn diagrams
c
S
S
A
that x
,
that
is
x
/
i
iI
iI Ai . This means, that for all
T
Therefore x iI Aci .
i I we have x
/ Ai , i.e. x Aci . T
Conversely, assume that x iI Aci . This means that for every
c
i I we
S have x Ai , i.e. for no i I we have x Ai , and hence x is
not in Ai , as required.
Similarly one proves the second statement.
Ordered pairs and products. We have already seen that the
order of elements does not matter for a set. However, it is useful to
introduce the so-called ordered pairs, i.e. sets of the form (x, y),
where x, y are elements of some sets X and Y . In this object the order
of elements is important.
Example. Points on the plane are represented by their coordinates:
(x, y). The points (1, 2) and (2, 1) are different!
Given two sets X and Y we define the product set or simply
product X Y as the set of ordered pairs (x, y), where x X and
y Y.
3. FUNCTIONS
and
f (g h) = (f g) h.
Example. Let X = {1, 2, 3}, Y = {a, b}. Define f by f (1) =
a, f (2) = f (3) = b. Define g by g(a) = 1, g(b) = 3. Then (f g)(a) = a
and (f g)(b) = b, so that g is a right inverse.
On the other hand (g f )(2) = g(b) = 3, so g is not a left inverse!
Note that the right inverse is not unique. Indeed, let h : Y X be
defined by h(a) = 1, h(b) = 2. Then (f h)(a) = a and (f h)(b) = b,
so that h is another right inverse.
Example. Let f (x) = ex , f : R R To construct an inverse define
on R+ = {t R : t > 0} the function h(t) = log t as a unique number
x R such that ex = t. By this definition (h f )(x) = log(ex ) = x,
for all x R, so that h is a left inverse of ex . If we want to make this
function the right inverse, we need to re-define f as a function from R
into R+ . Then (f h)(t) = elog t = t for all t > 0.
3.2. Types of functions. For applications it is crucial to be able
to find inverses. This leads us to the following definition:
Definition 1.7. A function f : X Y is said to be injective
(or an injection) if for all a, b X, if a 6= b one has f (a) 6= f (b). In
other words, if f (a) = f (b), then a = b, i.e. each y Y has only one
pre-image.
It is said to be surjective (or a surjection) if for every y Y there
is at least one pre-image, i.e. an element x X such that f (x) = y.
The function is said to be bijective (or a bijection) if it is both
injective and surjective.
Theorem 1.8 (Inverses Theorem). Let f : X Y be a function
between non-empty sets X, Y . Then
(1) f has a left inverse iff f is injective;
(2) f has a right inverse iff f is surjective;
(3) f has a two-sided inverse iff f is bijective.
Proof. (1) Let f have a left inverse, that is g f = idX . Then
from f (a) = f (b) we infer that g(f (a)) = g(f (b)) = a = b, i.e. f is
injective.
Let f be injective. For each y R(f ) define x = g(y), where x is
the uniquely defined element such that f (x) = y. Then g f = idX .
(2) Let f have a right inverse, i.e. f h = idY . Thus for each y Y
we have f (x) = y with x = h(y), so that y has a pre-image, as required.
Suppose that f is surjective, i.e. each y has at least one pre-image.
Denote it by h(y). Then f (h(y)) = y by construction.
(f g)(t) = ( t)2 = t,
so that we have a right inverse. Left inverse? I does not exist, since
the function is not injective! The rule: reflect the graph of the function
in the line y = x and throw the part which prevents it from being a
function!
For the injective function we do what we did for the exponential.
3.4. Countability.
Definition 1.9. A set X is countable if there exists a bijection
between X and N.
Sometimes finite sets are also called countable.
Theorem 1.10. Z is countable.
Proof. For each n Z define
(
2n, n > 0;
F (n) =
2(n) + 1, n 0.
It is bijective, since it has a two-sided inverse:
(
m/2, m even;
g(m) =
(1 m)/2, m odd.
Theorem 1.11. The set N N is countable.
Proof. Arrange the pairs (m, n), m, n N in a table, and count
them.
As a corollary, the set Q is countable as well.
However, the set of real numbers R is not countable!
n
.
(n)
Example.
(1) In S6 :
1 2 3 4 5 6
(1435) =
.
4 2 5 3 1 6
(2) Not all permutations are cycles, but all of them can be represented as composition of cycles:
1 2 3 4 5
= (12)(354).
2 1 5 3 4
(3) Another observation: cycles can be written in more than one
way: (123) = (231).
(4) It is a convenient object to take a power of. Indeed (354)3 = id,
so that (354)24 = id and (354)26 = (354)2 = (345). (1534)246 =
(1534)2 = (13)(45).
Definition 1.14. Two cycles (a1 a2 . . . ar ) and (b1 b2 . . . bs ) are called
disjoint if they have no common elements.
For example, (12) (56) are disjoint, but (12) and (158) are not.
Proposition 1.15. If = (b1 b2 . . . bs ) and = (a1 a2 . . . ar ) are
disjoint cycles, then = .
Proof. We want to show that ( )(m) = ( )(m) for each m
{1, 2, . . . , n}.
Suppose that m {a1 , a2 , . . . , ar }, so that m
/ {b1 , b2 , . . . , bs }.
Thus (m) = m and (m)
/ {b1 , b2 , . . . , bs }, so that (m) = (m)
and (m) = (m).
The same is true if m {b1 , b2 , . . . , bs }.
Now assume that m is in neither of the two sets, so that (m) =
(m) = m, so that the claimed identity is trivial.
As a consequence, ( )k = k k for any two disjoint cycles.
Theorem 1.16. Any permutation can be represented as a composition of disjoint cycles.
Proof. Start with 1 and write (1, (1), 2 (1), . . . , k } where k is
the minimal number such that k+1 (1) = 1. Clearly, k n. Now take
the minimal m, which is not in the above set and repeat the procedure:
{m, (m), 2 (m), . . . , l (m)}, where l is the smallest number such that
l+1 (m) = m. This cycle is disjoint with the previous one. Continue
until all elements are exhausted.
Example.
(1) Let
1 2 3 4 5 6 7
=
7 6 5 4 3 2 1
Then
(1) = 7, (7) = 1, so we have a cycle (17).
(2) = 6, (6) = 2, so (26).
(3) = 5, (5) = 3, so (35).
(4) = 4, and hence = (17)(26)(35).
(2)
=
1 2 3 4 5 6 7 8 9
3 2 5 8 1 7 6 9 4
= (135)(489)(67).
(3)
1 2 3 4 5 6
=
= (1542).
5 1 3 2 4 6
Now to raise a permutation to power k represent it as a product(composition) of disjoint cycles = 1 2 . . . p , and then write k =
1k 2k . . . pk .
Example.
1234
1 2 3 4 5 6 7 8 9
= (1249)1234 (35)1234 (687)1234
2 4 5 9 3 8 6 7 1
= (1249)2 id(687) = (14)(29)(687).
Definition 1.17. For a permutation the order of is the smallest
number k such that k = id.
For a cycle the order is its length. Clearly, such a number exists,
since every permutation is a composition of cycles.
Theorem 1.18. If = 1 . . . p with cycles of lengths l1 , . . . lp , then
the order of the permutation equals the least common multiple of the
lengths.
Proof. Let l = lcm(l1 , l2 , . . . , lp ). Then l = id, since jl = id for
all j = 1, 2, . . . , p.
Let us prove the converse, i.e. that k 6= id for all k < l. Suppose
that k = id, so that one of the jk is not id. Assume that 1k 6= id. Then
there is an x {1, 2, . . . , n} such that 1k (x) 6= x and 2k . . . pk (x) = x,
and hence k (x) 6= x, which gives a contradiction.
10
4.2. Transpositions.
Definition 1.19. A transposition is a cycle of length 2.
Example: (12). Every permutation can be written as a product of
transpositions. To see this, decompose as a product of disjoint cycles:
= 1 2 . . . r . So, it suffices to represent each cycle as a product of
transpositions:
(a1 a2 . . . ar ) = (a1 a2 )(a2 a3 ) . . . (ar1 ar ).
The number of transpositions in this representation is r 1.
Example.
1 2 3 4 5 6 7 8 9
= (135)(489)(67)
3 2 5 8 1 7 6 9 4
= (13)(35)(48)(89)(67).
1 2 3 4 5 6 7 8 9
= (1249)(35)(687)
2 4 5 9 3 8 6 7 1
= (12)(24)(49)(35)(68)(87).
Definition 1.20. Let be a cycle of length l. Then the signature
of is defined to be ( ) = (1)l1 .
For a permutation written as = Q
cycles
1 2 . . . r with disjoint
P
r
(lj 1)
j
j , j = 1, 2, . . . , l, the signature is () = j=1 (j ) = (1)
.
A permutation is called even if () = 1, and odd if () = 1.
From the construction it is clear that for any two permutations
( ) = ()( ).
5. Binary operations and Groups
5.1. Definitions. Let X be a set. A binary operation on X is a
function : X X X. Instead of (x, y) we write x y.
Example.
(1) X = Z, x y = x + y - the usual addition of
integers.
(2) X = P (R), the power set of R: A B = A B.
(3) X = R: x y = xy - the usual product.
Alternatively, we can take X = R \ {0}.
(4) X = R: x y = y.
(5) X = Sn : = .
A binary operation is said to be associative if it satisfies the condition x, y, z, (x y) z = x (y z).
11
Example.
(1) X = Z: (x + y) + z = x + (y + z) for all integer
x, y, z.
(2) Same for examples 2, 3, 4, 5 above.
For example 4:
(x y) z = z, x (y z) = x z = z,
so it is also associative.
(3) X = R, x y = (x + y)/2. Then
(x y) z =
x+y
2
+z
x + y + 2z
=
,
2
4
12
B C AB BC (AB)C A(BC)
1 1
0
0
1
1
1 0
0
1
0
0
0 1
1
1
0
0
0 0
1
0
1
1
1 1
1
0
0
0
1 0
1
1
1
1
0 1
0
1
1
1
0 0
0
0
0
0
13
14
15
16
17
CHAPTER 2
a = bq + r, 0 r < b.
20
21
22
1.3. The Eucledian algorithm. Now we need to develop an algorithm which would allow us to find for any integers a, b
their greatest common divisor d,
numbers x, y such that xa + yb = d.
Examples: (6, 8) = 2, (8, 25) = 1, (7, 63) = 7.
We use the division algorithm (2.1). Note that m | a and m | b iff
m | b and m | r. Therefore (a, b) = (b, r). Thus we can use the above
algorithm to find (a, b).
Example (The Eucledian Algorithm). Find (24, 356). Write:
356 = 14 24 + 20,
so that (24, 356) = (24, 20). Continue:
24 = 1 20 + 4,
so that (24, 356) = (20, 4) = 4. Working backwards we see that
4 = 24 1 20
= 24 1 (356 14 24)
= 15 24 1 356.
Find (53, 77). Write:
77 =
53 =
24 =
5=
1 53 + 24
2 24 + 5,
4 5 + 4,
1 4 + 1,
and hence (77, 53) = (1, 4) = 1. Therefore the numbers 53 and 77 are
relatively prime. Again, working backwards, we find that
1 = 5 1 4 = 5 1 (24 4 5)
= 5 5 1 24 = 5 (53 2 24) 1 24
= 5 53 11 24 = 5 53 11 (77 1 53)
= 16 53 11 77.
2. CONGRUENCES
23
2. Congruences
2.1. Congruency classes. Recall Definition 1.26. We have established earlier that the congruence mod n is an equivalence relation.
Let us establish some elementary properties of congruent numbers.
Lemma 2.9. If a a0 (n), b b0 (n), then a + b = a0 + b0 (n) and
ab = a0 b0 (n).
Proof. By definition a = a0 + kn and b = b0 + mn with some
integer k, m. Thus
(a + b) (a0 + b0 ) = n(k + m),
and
ab a0 b0 = a(b b0 ) + b0 (a a0 ) = amn + b0 kn = n(am + b0 k).
The required relations follow.
0, 1, 2, . . . , n 1.
To see this we use the division algorithm, i.e. the fact that for any
a Z there exists a unique pair q, r such that
a = qn + r, and 0 r < n.
This identity shows that r a mod n and that r is defined uniquely.
Now, since the list (2.2) does not contain congruent pairs, we conclude
that there are exactly n distinct classes of residues modulo n.
Definition 2.11. The set of n numbers a1 , a2 , . . . , an is said to be
a complete system of residues modulo n, if every number from (2.2) is
congruent to one of the numbers al , l = 1, 2, . . . , n.
24
2. CONGRUENCES
25
Clearly, the multiplication is associative, and [1] is the identity element. By definition of G every element has an inverse. Thus G is a
group.
Let us find out when a number is invertible modulo n.
Proposition 2.13. A number a is invertible modulo n iff a and n
are relatively prime.
Proof. Let d = (a, n). Suppose that ak 1 mod n, so that
ak + nb = 1 with some b. By Corollary 2.7 this equation is solvable in
k and b, iff d | 1, that is d = 1.
Definition 2.14. The Euler totient function : N N is
defined by (n) = #Zn , i.e. (n) is the number of positive integers less
than n, which are coprime to n.
Example. (2) = 1, (3) = 2, (4) = 2, (5) = 4, (6) = 2.
The easiest case is when p is a prime, so that every number less
than p is relatively prime to p, so that
Zp = {[1], [2], . . . , [p 1]}, (p) = p 1.
Theorem 2.15 (Eulers generalisation of Fermats Little Theorem).
Let a be coprime to n. Then a(n) 1 mod n.
In particular, if p is a prime number, then ap1 1 mod p (Fermats Little Theorem).
Proof. Since Zn is a group, and (n) is its order, by Corollary
1.32 we have [a](n) = [1], i.e. a(n) 1 mod n.
2.3. Linear congruences. Using the above Proposition we can
solve Linear congruences, i.e. equations of the type
mx k
mod n.
To this end we need we need to find the inverse for m mod n. This
is only possible if (n, m) = 1. The inverse is found from the formula
1 = mp nq with some p, q, so we need to express (n, m) as a linear
combination of n and m.
Example 2.16.
as follows:
so
1 = 5 2 2 = 5 2(87 5 17) = 35 5 2 87 = 35 5
mod 87.
26
mod 87.
(2)
2.4. Calculating the Euler function. If p is prime, then we
know that (p) = p 1. More generally, if n = pa with some prime p,
then a natural number r is not comprime with n iff p | r. Therefore
Zpa = Zpa \ {[0], [p], [2p], . . . , [pa p]}.
This means that
(pa ) = pa pa1 = (p 1)pa1 .
To calculate (n) if n is not prime, we need the following notion:
Definition 2.17. A function : N N is called multiplicative if
for any two coprime numbers m, n we have (mn) = (m)(n).
We intend to show that Euler function is multiplicative. For this
we need this intermediate result.
Lemma 2.18. Suppose that (m, n) = 1. Let a1 , a2 , . . . , an be a complete set of residues modulo n, and let b1 , b2 , . . . , bm be a complete system of residues modulo m. Then the set
(2.3)
ak m + br n, k = 1, 2, . . . , n; r = 1, 2, . . . , m,
mod n, b b0
mod m.
2. CONGRUENCES
27
mod 15.
Example.
(1) Find 442 mod 25. First note: (4, 25) = 1 and
(25) = 20, so 442 42 16 mod 25.
(2) Find 764 mod 120. Note: (7, 120) = 1 and (120) = (23 3
5) = 1 22 2 4 = 32, so 764 70 1 mod 120.
Find 762 mod 120.
Write 762 764 72 72 491 mod 120.
In order to find 491 mod 120 we run the Euclidean algorithm:
120 = 2 49 + 22,
49 =2 22 + 5,
22 = 4 5 + 2,
5 = 2 2 + 1.
28
Thus
1 = 5 2 2 = 5 2 (22 4 5) = 9 5 2 22
= 9 (49 2 22) 2 22 = 9 49 20 22
= 9 49 20 (120 2 49) = 49 49 20 120
49 49 mod 120.
Thus 491 49 mod 120. Thus 762 49 mod 120.
(3) Find 16287 mod 765. Eulers function:
(765) = (5 32 17) = 4 2 3 16 = 384.
Note also that (16, 765) = 1 and
16287 = 24287 = 21148 = 233844 24
mod 765.
a1
)a b
aa1
mod n is a solution:
xaa
(xa )a
1
ba
mod n.
mod n.
2. CONGRUENCES
29
Example.
(1) Solve x3 3 mod 20. Write: 20 = 22 5, so
(20) = 2 4 = 8. The number 3 is coprime to 8 and to 20.
Thus the above theorem is applicable. Let us find first 31
mod 8:
8 = 2 3 + 2, 3 = 2 + 1,
so that
1 = 3 2 = 3 (8 2 3) = 3 3 8 3 3
mod 8,
53
mod 20 27
mod 20 7
mod 20.
(200) = 4 5 1 22 = 80.
Clearly, (53, 80) = 1, so that 53 is invertible modulo 80. Let
us find the inverse:
80 = 1 53 + 27, 53 = 1 27 + 26, 27 = 26 + 1.
From here:
1 = 27 26 = 27 (53 27) = 2 27 53
= 2 (80 53) 53 = 2 80 3 53 3 53
mod 80,
mod 200.
mod 200,
Consequently, x 37 163(200).
2.6. Public key cryptography. Here is a way of encoding and
decoding messages. Choose two primes p, q. Choose a number a coprime to (pq) and compute the inverse b of a modulo (pq). Then the
pair {pq, a} is the public key and {pq, b} is the private key. The
messages are encoded using the public key in the following way. The
message is a number M modulo pq. The encoded message is N M a
mod pq, which is easily found using the algorithms developed in the
lectures, using the public key. The message is recovered by calculating M N b mod pq, if one knows b. However, finding b is a serious
30
problem, if only the public key is given, since one needs to determine
(pq), which is done by finding p and q first. As there is no sensible
recipe how to find the factors p, q from the product pq, this procedure
is virtually impossible to implement.
Example. Let p = 3, q = 11. Then (pq) = (p 1)(q 1) = 20.
Take {33, 7} as the public key. The inverse of 7 modulo 20 is 3, so the
private key is {33, 3}. Suppose that we are sending the message which
is number 2. Then the coded message is 27 = 128 4 mod 33. To
decode the message calculate (4)3 = 64 2 mod 33.
CHAPTER 3
Linear Algebra
1. Basic definitions and concepts
1.1. Addition and multiplication. A real matrix A of size nm
is a n m array of real numbers:
anm
bn1 bn2 . . .
a11 + b11
a21 + b21
=
..
an1 + bn1
bnm
.
.
.
an2 + bn2 . . . anm + bnm
Example:
1 7 4
0 2 5
1 5 9
+
=
.
2 11 10
9 3 3
11 14 7
31
32
3. LINEAR ALGEBRA
0 5
1 3 0
3 11
1 2 =
,
2 0 6
12 10
2 0
1 3
2 4
3 2
18 16
=
,
5 6
14 28
7 1 4 7
23 5 2 5
2 0 3
2
5 0 4 =
.
15 6 26 39
4 1 5
3 1 2 3
1 0
1 1
1 1
1 1
=
.
0 1
1 2
1 0 ... 0
0 1 ... 0
In =
... ... . . . ... ,
0 0 ... 1
or, in other words, ajl = jl , where jl is the so-called Kroneker symbol:
(
jl =
1, j = l,
0, j 6= l
33
ann
In other words,
0
A =
...
a11 a12 a1n
0 ... 0
. . . 0 a21 a22 a2n
..
..
.. . .
. .
..
.
. .. ..
.
.
.
an1 an2 ann
0 0 ...
, R.
p
m
X
X
p
m
X
X
ajs bsk dkl =
ajs
bsk dkl ,
k=1 s=1
s=1
k=1
m
X
s=1
m
X
s=1
ajs bsl +
m
X
s=1
34
3. LINEAR ALGEBRA
a11 0 . . . 0
0 a22 . . . 0
A=
.. . .
..
...
.
.
.
0
...
...
ann
0
0
..
.
a1
nn
is the inverse to A.
(1)
1/5 0
0
5 0 0
1/3 0 .
A = 0 3 0 , A1 = 0
0
0 1/7
0 0 7
Example.
(2)
2 4
3/10 4/10
1
A=
, A =
.
1 3
1/10 2/10
(3) Arbitrary matrix T M(2, 2) is invertible if t11 t22 t12 t21 6= 0
and
1
t22 t12
1
T =
.
t11 t22 t12 t21 t21 t11
35
Let G = GL(n, R) M(n, n) be the subset of all invertible matrices. Claim: G is a group. Let us check first that multiplication defines
a binary operation on G, that is for any two matrices A, B G we also
have AB G:
Proposition 3.5. If A, B GL(n, R), then AB GL(n, R) and
(AB)1 = B 1 A1 .
Proof. Denote T = AB and S = B 1 A1 . We want to show
that S = T 1 . According to definition, for this we need to check that
ST = T S = In . Indeed:
ST = B 1 A1 AB = B 1 In B = B 1 B = In ,
T S = ABB 1 A1 = AIn A1 = AA1 = In .
We also know the following:
(1) Multiplication is associative;
(2) The element In is the identity;
(3) Every element has an inverse.
Thus GL(n, R) is a group. This group is called the general linear
group of n n-matrices.
x1
x2
x=
... .
xn
The elements of Rn are called vectors. One can view them as elements
of M(n, 1), that is matrices with one column and n rows. Therefore
they have natural operations defined: addition and multiplication by
36
3. LINEAR ALGEBRA
m n- matrices:
y1
x1
x2 y2
. + .
.. ..
yn
xn
a11
a21
.
..
a12
a22
..
.
..
.
am1 am2
x1 + y1
x2 + y2
,
=
..
xn + yn
x1
x1
x2 x2
... = ... , R.
xn
Define the vectors
1
0
0
1
e1 =
... , e2 = ...
0
0
xn
0
0
. . . , en =
... .
3. LINEAR SYSTEMS
37
Proof. Write
x1
n
n
X
X
x2
T (x) = T (
xj e j ) =
xj T (ej ) = (T (e1 ), T (e2 ), . . . , T (en ))
... .
j=1
j=1
xn
3. Linear systems
The concept of matrices is useful when studying the following system of linear equations:
a x + + a1m xm = b1 ,
11 1
a21 x1 + + a2m xm = b2 ,
...
a x + + a x = b ,
n1 1
nm m
n
where b1 , b2 , . . . , bn are fixed real numbers, and x1 , x2 , . . . , xn are unknown. They are sometimes called simultaneous equations. It is convenient to rewrite this system using the matrix notation:
anm
xm
bn
so that
Ax = b.
To solve the system define the augmented matrix:
anm bn
Now well perform a number of transformation which preserve the solutions. We will
Swap two equations,
Multiply an equation by a non-zero number,
Add one equation to another.
These operations correspond to the following ones on the augmented
matrix:
Swap two rows,
Multiply a row by a non-zero number,
38
3. LINEAR ALGEBRA
A =
2x + 3y = 7,
2 3
3
7
R1 R2
Thus
1 1
2 3
3
7
R2 2R1
1 1
0 1
3
1
Consequently, x1 = 2, x2 = 1.
(2) Consider the system
2 4 6
2x1 + 4x2 + 6x3 = 18,
4 5 6
4x1 + 5x2 + 6x3 = 24,
A =
3x1 + x2 2x3 = 4
3 1 2
1 0
0 1
2
1
.
18
24 .
4
Thus
2 4 6
18 1 2 3
9
4 5 6
24 R1/2 4 5 6
24
3 1 2
4
3 1 2
4
1 2
3
1
2
3
9
9
R2 4R1
0 3 6
12 R2/3 0 1
2
4
R3 3R1
0 5 11
23
0 5 11
23
1 0 1
1
1 0 1
1
R1 2R2
0 1 2
4
4
R3 0 1 2
R3 + 5R2
0 0 1
3
0 0 1
3
1 0 0
4
R1 + R3
0 1 0
2
R2 2R3
0 0 1
3
Consequently, x1 = 4, x2 = 2, x3 = 3.
(3) An example with infinitely many solutions. Consider the system
2 4 6
18
2x1 + 4x2 + 6x3 = 18,
4x1 + 5x2 + 6x3 = 24,
24 .
A = 4 5 6
2x + 7x + 12x = 30
2 7 12
30
2
2
3
3. LINEAR SYSTEMS
39
Thus
1 2 3
9
4 5 6
24
2 7 12
30
1 2
3
9
1 2 3
R2 4R1
0 3 6
12 R2/3, R3/3 0 1 2
R3 2R1
0 3
6
12
0 1 2
1 0 1
1
R1 2R2
0 1 2
4 ,
R3 R2
0
0 0 0
9
4
4
40
3. LINEAR ALGEBRA
1 2 3
a 1 2 3
a
R2 := 3R1 R2
3 1 2
0 7 11
b
3a b
R3 := R1 R3
1 5 8
c
0 7 11
ac
1 2 3
a
3a b
R3 := R3 R2 0 7 11
0 0 0
2a + b c
Example.
41
(1) Let
2 3
4 5
R2 + 2R1
A=
Write
R1 3R2
2 3
4 5
2 0
0 1
1 0
0 1
2 3
0 1
R1/2
1 0
R2
0 1
5 3
2
1
1 0
2 1
5/2 3/2
2
1
so that
A
=
5/2 3/2
2
1
1
2
2 4
R2 + 2R1
A=
Indeed,
1
2
2 4
1 0
0 1
1 2
0 0
(3) Let
1 1 1
A = 0 2 3 .
5 5 1
1 0
2 1
.
,
42
3. LINEAR ALGEBRA
Write
1 1 1
0 2 3
5 5 1
1 0 0
1 1 1
0 1 0 R3 5R1 0 2 3
0 0 1
0 0 4
1 0 0
0 1 0
5 0 1
1 0 0 4 4 0
15 4 3 4R1 + R3 0 8 0
0 0 4
5 0 1
1 1 1
4R2 + 3R3 0 8 0
0 0 4
4 0 0
R1 R2/2 0 8 0
0 0 4
1 0 0
R1/4, R2/8, R3/4 0 1 0
0 0 1
1 0 1
15 4 3
5 0 1
13/2 2 1/2
15 4
3
5
0
1
5. Determinants
5.1. Definition.
Definition 3.11. The determinant of an n n-matrix A is defined
to be
X
()a1(1) a2(2) an(n) ,
det A =
Sn
5. DETERMINANTS
43
1 . . .
0 2 . . .
A=
.. . .
.
...
. ..
.
0
...
(1) Let
2 1 4
5 .
A= 0 1
6 3 4
Then
2 1 4
2 1 4
2 1 4
0 1
5 .
5 R3 3R1 0 1
5 R3 6R2 0 1
0 0 46
6 3 4
0 6 16
1 3 2
A = 4 5 1 .
2 4 3
44
3. LINEAR ALGEBRA
Then
1 3 2
1 3
2
det 4 5 1 = det 0 7 7
2 4 3
0 2 1
1 3
2
1 3 2
1 = 7 det 0 1 1 = 7.
= 7 det 0 1
0 2 1
0 0 1
Comparing this procedure with the redaction to the row echelon
form, we deduce the following result:
Theorem 3.14. The matrix is invertible iff det A 6= 0.
How to find the determinant of the inverse matrix? One uses the
following important property:
Proposition 3.15. For any matrices A, B M(n, n) we have
det(AB) = det A det B.
Without proof.
If A is invertible, then
1
.
det A
This immediately follows from the above Proposition in view of the
identities AA1 = In and det In = 1.
det A1 =
(1)
2 1 4
5 .
A= 0 1
6 3 4
Then
0 1
1 5
2 4
M13 =
, M11 =
, M32 =
.
6 3
3 4
0 5
5. DETERMINANTS
45
k=1
n
X
akl Akl .
k=1
These formulae are called the expansion of the determinant in the jth
row and the lth column respectively.
Example. Let
2
A= 0
6
Let us expand the determinant in
1 4
1
5 .
3 4
the first row:
1 5
3 4
= 19, A12 = det
A13 = det
0 1
6 3
0 5
6 4
= 30,
= 6,
so that
det A = 2 (19) 1 30 + 4 (6) = 92.
Alternatively, we may notice that the expansion in the second row will
have only two co-factors:
det A = A22 + 5A23 ,
with
A22 = det
2 4
6 4
= 32, A23 = det
2 1
6 3
so that
det A = 32 + 5 (12) = 92.
= 12,
46
3. LINEAR ALGEBRA
Ann
In other words, the jkth entry of ad(A) is Akj , i.e. it is the transpose
of the matrix built of Ajk s.
Example. n = 2:
a11 a12
a22 a12
A=
, ad(A) =
.
a21 a22
a21 a11
The inverse of a matrix A is found as
A1 =
1
ad(A).
det A
1
=
a11 a22 a12 a21
a22 a12
a21 a11
.
1 0 . . . 0
0 2 . . . 0
A=
.. . .
. ,
...
. ..
.
0
...
0 l2 . . . 0
l
A = ..
.. . .
.
. ..
.
.
0 0 . . . ln
47
For example,
l l
2 0
0
2 0 0
0 3 0 = 0 3l
0 .
0 0 4
0 0 (4)l
In general, for diagonal matrices the elementary matrix operations become simpler.
If A = M DM 1 , then
Al = M DM 1 M DM 1 . . . M DM 1 = M Dl M 1 ,
so taking the power of A boils down to taking the power of a diagonal
matrix!
Definition 3.19. A real number is called an eigenvalue of A if
there exists a non-zero vector v such that Av = v.
A matrix may have more than one eigenvalue.
Observe straight away that if v is an eigenvector, then tv is also an
eigenvector for any non-zero t R.
Example.
(1) A = In . For any vector v 6= 0 we have Av = v,
so = 1 is the only eigenvalue of In and any non-zero vector
is an eigenvector.
(2) Let
2
10 18
,
, v=
A=
6 11
1
so that
10 18
2
2
Av =
=
.
6 11
1
1
Thus = 1 is an eigenvalue and v is an eigenvector.
The procedure for finding eigenvalues and eigenvectors is simple:
suppose that Av = v, so that (AIn )v = 0. Since we are looking for
a non-zero solution of this system, the matrix A In is not invertible,
i.e. det(A In ) = 0. Conversely, if the determinant equals zero, this
means that the system has either no or infinitely many solutions. Since
v = 0 is a solution, this means that one has infinitely many of them,
48
3. LINEAR ALGEBRA
1 0 . . . 0
0 2 . . . 0
A = M DM 1 , D =
.. . .
. .
...
. ..
.
0 0 . . . n
Example.
(1) Let
A=
1 2
3 2
.
49
1
=
5
3 2
1 1
.
1 2
1 3
3 2
4 4
=
1 2
3 2
.
1 2
1 3
(1)l
=
5
4l
+
5
1 2
1 3
1 2
1 3
(1)l 0
0
4l
3 2
1 1
3 2
1 1
(1)l
=
5
1 0
1 0
(1)l
=
5
3 2
3 2
1 0
0 0
0 0
0 1
3 2
1 1
4l
+
5
3 2
1 1
4l
+
5
0 2
0 3
2 2
3 3
.
3 2
1 1
50
3. LINEAR ALGEBRA
not be invertible!
matrix:
1 1
4
2
1
det(A I3 ) = det 3
2
1
1
2
1
= (1 ) det
1
1
3 2
+ 4 det
2
1
+ det
3
1
2 1
Thus
det(A I3 ) = (1 ) (2 )(1 + ) + 1 3(1 + ) + 2 + 4 3 2(2 )
= (1 )(2 1) 3 5 + 8
= (1 )(2 1) + 5( 1)
= ( 1)(2 6) = ( 1)( + 2)( 3).
51
0 1 4
0 0 1 4
0
R2 + R1
3 1 1
0
3 0 3
0
R3 + R1
2 1 2
2 0 2
0
0
0 1 4
R3/2 R2/3
1 0 1
R2/3
0 0 0
0
0 .
0
1
v1 = 4 .
1
Eigenvector for 2 = 2:
3 1 4
0 3 1 4
R2 R1
3 4 1
0
0 5 5
3R3 2R1
2 1
1
0
0 5 5
3 1 4
R3 R2
0 1 1
R2/5
0 0
0
0
3 0 3
0 R1 + R2 0 1 1
0
0 0 0
0
0
0
0
0 .
0
1
v2 = 1 .
1
Eigenvector for 3 = 3:
2 1 4
0 2 1 4
2R2 + 3R1
3 1 1
0
0 5 10
R3 + R1
2
1 4
0
0
0 0
2 1 4
R1
0 1 2
R2/5
0 0 0
0
0 .
0
0
0
0
52
3. LINEAR ALGEBRA