Transcript A B
Uvod u
algebru realnih i kompleksnih
brojeva
Prof. dr Lazo Roljić
Na primjer, desiće vam se na ispitu
sljedeći zadatak (ili sličan):
„...Ovo je zadatak za „vađenje“ i nosi
duple poene!, ali i (u startu) najmanje
dvije ocjene manje od maksimalne ocjene
ako se ne da pravilan i tačan odgovor.
Pretpostavimo da vaš hipotetički program izvodi
slijedeće instrukcije:
-broj koji je zamislio vaš kolega, u svojoj memoriji
pomnožite sa brojem različitih neparnih cifara (5) u
aritmetici.
- Od tog umnoška, u svojoj memoriji, oduzmite
broj različitih parnih cifara (5) u aritmetici
(napomena: nula je paran broj) pomnožen brojem
cifara u Bulovoj algebri (2).
- Dobivenu razliku podijelite u memoriji s brojem
neparnih cifara (5) u aritmetici pomnožen s 2.
- U vašoj memoriji stoji da je rezultat 30.
a) Koji je broj zamislio vaš kolega?
b) Prikažite kompletan račun:
Ili, ovakav zadatak:
Ostrvo Manhattan plaćeno je indijancima
24 $.
Da je taj novac bio uložen kod banke uz
kamate od 6,5% na godišnjem nivou,
akumulirao bi se iznos otprilike onoliki
koliko su danas vrijedne sve nekretnine na
ostrvu Manhattan, tj. nekoliko hiljada
milijardi dolara (recimo 5 hilj. mlrd $).
Izračunajte prije koliko godina se ta
prodaja desila ako formula za
izračunavanje porasta vrijednosti
ukamaćivanjem glasi:
In = I0 x 1,065br.godina
Pri čemu:
In = 5.000 milijardi $
I0 = 24 $
Algebra realnih i
kompleksnih brojeva
Šta je algebra a šta
aritmetika???
Aritimetika (termin nastao od grčke riječi
aritmos, “broj”) odnosi se na elementarne
aspekte teorije brojeva, umijeća mjerenja i
numeričkog izračunavanja (tj. proces
sabiranja, oduzimanja, množenja, dijeljenja,
potenciranja i korijenovanja).
Algebra...
Algebra se može opisati kao generalizacija
(uopštenje) i proširenje aritimetike.
Na primjer, činjenica da kada na 2 dodamo 3
daje isti rezultat kao kada na 3 dodamo 2 je
aritmetički odnos (2+3=3+2);
Formula a+b = b+a, za sve brojeve a,b je
algebarski odnos (veza, izraz).
Aritmetika postaje algebrom kada se postave
opšta pravila koje se odnose na operacije + i
* (tzv. Zakon komutacije sabiranja).
Natural numbers..
Prvo su postojali prirodni brojevi (natural
numbers) ili pozitivni cijeli brojevi: 0, 1, 2, 3,
……
(Neki autori isključuju 0).
Prirodnim brojevima zovemo pozitivne
cijele brojeve .
Skup prirodnih brojeva u matematici
označavamo velikim slovom N.
Skup se često proširuje brojem nula (0) te
ga u tom slučaju označavamo sa N0.
Algebra of real and complex numbers..
The natural numbers were needed to count
objects.
(Example: Sumaran’s letters content, 5,000
years ago, e.g. 3,000 years before New Era
started.)
Zero and negative integers..
Zero and the negative integers:
0, -1, -2, -3, …..
Were introduced in order to
make it possible to subtract
any positive integer from any
other.
Rational numbers..
The number system was eventually
expanded to include all rational numbers
which have the form p/q, in which p and q
are integers (natural numbers and their
negatives), with q0;
2
3
4
5
6
5
, , , etc.
This was made necessary by the advent of
division.
Racionalni broj lat. (ratio - omjer,
razmjer) je broj nastao dijeljenjem dva
cijela broja, npr. 1:2, 1:3, 555:333.
Može se napisati
- u obliku razlomka, a/b, gdje je a brojnik
a b nazivnik (cijeli broj različit od 0) ili
- u obliku decimalnog broja, npr.
1/2 = 0,5; 1/3 = 0,3333333333...
Racionalni broj može imati oblik beskonačnog
decimalnog razlomka, ali uvijek periodičnog
(ponavlja se isti broj ili ista sekvenca brojeva).
Npr: 2/3 = 0, 6666...; 25/36 = 0, 6944444....
Irrational numbers..
The solution to certain problems and
equations led to irrational numbers such
as
2 , 3, 5 ,
3
Iracionalni brojevi (1)
Iracionalni brojevi (2)
Znači, ovdje nemamo opciju da se decimala ili
skup decimala periodično ponavlja, kao što je
npr:
0,345345345... ili 2,3333.... Ili 1,25855555.....
već imamo niz decimala koje se nikada ne
ponavljaju u istoj sekvenci.
Realni brojevi..
Skup ili kolekcija svih iracionalnih i
racionalnih brojeva.
2 , 3, 5 ,
3
2
3
4
5
6
5
, , , etc.
ALGEBRA
Algebra
Algebra is often described as the
generalization of arithmetic.
The systematic use of variables, letters used
to represent numbers, allows us to
communicate and solve a wide variety of
real-world problems.
For this reason, we begin by reviewing real
numbers and their operations.
Real Numbers
A set is a collection of objects, typically grouped within
braces { }, where each object is called an element.
When studying mathematics, we focus on special sets of
numbers.
N={1,2,3,4,5,…} Natural Numbers
W={0,1,2,3,4,5,…} Integers
Z={…,−3,−2,−1,0,1,2,3,…}
Whole Numbers
The three periods (…) are called an ellipsis
(elipse) and indicate that the numbers continue
without bound.
A subset (podskup), denoted ⊆, is a set
consisting of elements that belong to a given
set.
Notice that the sets of natural and whole
numbers are both subsets of the set of integers
and we can write:
N⊆Z (prir.br. su podskup svih) i
W⊆Z (cijel.br. je podskup svih)
Racionalni brojevi
Rational numbers, denoted Q, are defined as any
number of the form ab where a and b are integers and
b is nonzero. We can describe this set using set
notation:
The vertical line | inside the braces reads, “such that” and
the symbol ∈ indicates set membership and reads, “is an
element of.” The notation above in its entirety reads, “the
set of all numbers ab such that a and b are elements of
the set of integers and b is not equal to zero.”
Racionalni brojevi
Na primjer:
The set of integers is a subset of the set of
rational numbers, Z⊆Q, because every integer
can be expressed as a ratio of the integer and
1.
In other words, any integer can be written over
1 and can be considered a rational number.
Na primjer:
IRACIONALNI BROJEVI
Irrational numbers are defined as any
numbers that cannot be written as a
ratio of two integers.
Nonterminating decimals that do not
repeat are irrational.
Na primjer:
REALNI BROJEVI
Finally, the set of real numbers, denoted
R, is defined as the set of all rational
numbers combined with the set of all
irrational numbers.
Therefore, all the numbers defined so
far are subsets of the set of real
numbers. In summary,
REALNI BROJEVI
Natural Numbers – The set of counting numbers { 1, 2, 3, 4, 5, …}.
Whole Numbers – Natural numbers combined with zero { 0, 1, 2, 3,
4, 5, …}.
Integers – Positive and negative whole numbers including zero
{…,−5, −4, −3,−2, −1, 0, 1, 2, 3, 4, 5…}.
Rational Numbers – Any number of the form a/b where a and b are
integers where b is not equal to zero.
Irrational Numbers – Numbers that cannot be written as a ratio of
two integers.
When comparing real numbers, the larger
number will always lie to the right of smaller
numbers on a number line.
It is clear that 15 is greater than 5, but it
might not be so clear to see that −5 is
greater than −15.
Use inequalities to express order relationships between
numbers.
<
>
≤
≥
"less than"
"greater than"
"less than or equal to"
"greater than or equal to"
It is easy to confuse the inequalities with larger negative
values.
For example,
−120 < −10
“Negative 120 is less than
negative 10.”
Since −120 lies further left on the number line,
that number is less than −10.
Similarly, zero is greater than any negative
number because it lies further right on the number
line.
0 > −59
"Zero is greater than negative 59."
Absolute Value – The distance between 0
and the real number a on the number line,
denoted |a|.
Because the absolute value is defined to be
a distance, it will always be positive.
Važno je da napomenemo da je |0| = 0.
Kompleksni brojevi...
Kompleksni brojevi
Poznato je da je kvadrat svakog realnog
broja nenegativan broj. Zbog toga, na
primjer, jednostavna jednačina
x2 + 1 = 0
nema rješenja u skupu realnih brojeva.
Ovo je ekvivalentno sa tvrđenjem
da ne postoji realan broj koji bi bio
kvadratni korijen realnog broja - 1.
Kompleksni brojevi
Ovaj nedostatak skupa realnih brojeva
možemo otkloniti na taj način što ćemo
proširiti skup brojeva sa kojima radimo.
Pri tome ćemo voditi računa o tome da se
u novom skupu nađu realni brojevi kao
njegov podskup i da se sačuvaju važna
svojstva osnovnih operacija (sabiranja i
množenja) i relacije jednakosti.
Kompleksni brojevi
Kompleksni brojevi su izrazi oblika
gdje su
realni brojevi, a
neki simbol, za koje su definisane relacija
jednakosti (=) i operacije sabiranja (+) i
množenja (•) na slijedeći način:
Dijeljenje kompleksnih brojeva se svodi
na dijeljenje običnim brojem:
Algebra of real and complex numbers
Complex numbers..
The solution to certain problems and
equations led to complex numbers like:
2+3i, 0-4i, 7+0i,
where:
i 1
Complex numbers..
The complex numbers are constructed
from the real numbers together with a
number i, the square of which is -1.
These numbers can be added and
multiplied by well established rules.
Complex numbers..
Added, subtract, and multiply next two
complex numbers
(5-3i) and (1+2i)
Results: (6-i), (4-5i), (11+7i)
Algebra of real and complex numbers
Historically, these events probably did
not occur in the order in which they are
listed above.
In fact, fractions probably preceded
negative numbers in most civilizations.
Excercises
See next slide.
VJEŽBE
Dati su slijedeći brojevi:
2
3
4
2i
3
9
4
2 3i
3
6
2 3
7
1) Which are integers?
2) Which are real numbers?
3) Which are rational numbers?
4) Which are irrational numbers?
5) In which group are numbers that don’t
belong to any of the previous four groups?
MATRIX ALGEBRA
MATRIX ALGEBRA
Week 2
Matrix - basic definitions
In this section and the next, we
offer formal definitions
of matrices and matrix operations,
and state certain important
properties of matrix algebra.
MATRIX -- Basic definitions
You frequently see various types of
data presented in the form of
rectangular array of numbers, such as
the box score of a football, basketball,
or baseball game; or the vital statistics
of movies stars,etc.
What is an array?
What is an array?
An array is rectangular
arrangement of quantities
(mathematical elements) in rows
and columns.
It is another name for a matrix.
MATRIX -- Basic definitions
Consider the following price chart for
a length of pipe of given diameters.
2 in. 4 in. 6 in.
copper 50¢ 65¢ 75¢
tin
30¢
40¢ 45¢
2 in. 4 in. 6 in.
copper 50¢ 65¢ 75¢
tin
30¢ 40¢ 45¢
Such rectangular arrays when
subject to certain operations are
example of matrices..
They are usually designated by
capital letters A , B , C, etc.
Definition.
A matrix A is a
rectangular array of entries, denoted
by...
a11 a12 ... a1n
a
a 22 ... a 2 n
21
A
.
.
.
.
a m1 a m 2 ... a mn
a11 a12 ... a1n
a
a
...
a
21
22
2n
A
.
. . .
a m1 a m 2 ... a mn
The entries of matrix aij often are
called the elements of the matrix.
a11 a12 ... a1n
a
a
...
a
2n
A 21 22
.
.
.
.
a m1 a m 2 ... a mn
Matrix notation allows us to
manipulate large rectangular arrays
of numbers as single entities.
This frequently simplifies the
statements of various operations and
relationships.
Example 1. Let the matrix A
8
A
1
2
2
1
7
Represent the number of gadgets R, S, and T
that factories P and Q can produce in a day,
that is, matrix A represents the following
production capacity.
Factory P Factory Q
Gadget R 8 per day 2 per day
Gadget S 1 per day 1 per day
Gadget T 2 per day 7 per day
Gadget R
Gadget S
Gadget T
Factory P
8 per day
1 per day
2 per day
Factory Q
2 per day
1 per day
7 per day
Later, using the entity “matrix A”, we will
extend this example to accomplish some very
useful results.
8
A
1
2
2
1
7
Scalars?
Scalars...
Scalars!
In this course we shall assume,
unless it is stated otherwise, that
the entries of a matrix are scalars ;
(no matrices, no vectors)
We can interpret the term scalar
as a complex number, a real
number or a function thereof.
Under certain conditions, the
entries of a matrix may also be
certain other matrices.
Matrix is not a scalar !!!
Matrix does not represent a
number of any type!!
A matrix does not have a
numerical value; it is merely an
array.
Examples of matrices..
The following are examples of matrices:
The entries are integers, functions of x,
complex numbers, real numbers, and matrices.
2 1 2
4 0 1
2
3 5
2
3
2i i
3 i 1
x2 2
2 x x 2
2
4
6
1
0
1
3
0
1
4
2
4
Real matrix..
If all the entries of a matrix are real numbers, it
is called real matrix.
2 1 2
4 0 1
2
3 5
2
3
7 5
A
7 0
2
3
7
Zero matrix..
If all of the entries of a matrix are zero, the matrix is
called the zero matrix or null matrix and is denoted by
0. Bold print will be used to distinguish the zero matrix
from zero scalar.
0 0 0
0
0
0
0
The horizontal lines of the array are called
rows.
The vertical lines are columns.
What is a matrix?
So, we can say,
A matrix is a rectangular array of
numbers (or scalars) arranged in
rows and columns.
Matrix
Each entry is designated in
general as aij , where i represents
the row number, and j is the
column number; thus a31 is the
entry in the third row and first
column.
The double subscript can be
called the address of the entry.
2 1 2
A
4 0 1
The dimensions of the array (number of rows
stated first) determine the order or shape of
the matrix, designated “m by n”.
Matrix A in this example has a total 2 rows
and 3 columns of entries. We say that the
order (shape) of this matrix is 2 by 3.
The order of matrix in next example is ?
2
3 5
2
3
The order of this
matrix is 3 by 1.
2
3 5
2
3
Such a matrix with of a single column is called
a column matrix.
When a matrix consists of a single row (is of
order 1 by n), it is called a row matrix.
6
3
3 314
.
How many columns does this row matrix
have ?
6
3
3 314
.
Examples..
Example of row-matrix..
F f1 f 2 f 3
Example of matrix
g11 g12 g13
G
g
g
g
21
22
23
What is the address of entry g23 ?
(2,3)
Example of column matrix
x1
X x2
x
3
What is the address of entry x2 ?
(2,1)
Can one subtract or add column and row
matrices?
Why not?
Because they are not conformable for
subtraction and addition.
Transposition of matrices..
Definition..
The transpose AT of a m by n matrix
A=[aij] is the m by n matrix Q=[qij]
obtained by interchanging the rows and
columns of A, thus
AT=Q=[qij]
where qij=aji
(i=1,2,…,n; j=1,…,m)
For example..
then
if
1 1 3
A
3 7 4
2
5
1
1
T
A
3
2
3
7
4
5
and..
if
5
1
X
0
4
then
X 5 1 0 4
T
Several important properties of transposes..
1) The transpose of transpose is the
original matrix
(AT)T=A
2) The transpose of a sum is the sum of
transposes
(A+B)T=AT+BT
3) The transpose of a scalar times a
matrix is the same scalar times the
transpose of that matrix (kA)T=kAT
4) The transpose of a product is the
product of the transposes in reverse order:
(AB)T = BTAT
5) If A and B are two column vectors (ie,
row matrix or column matrix) each of row
degree n. Then ATB is a scalar;hence
(ATB)T=BT(AT)T=BTA ,
(ATB)T=BTA
called inner product, dot product or scalar
product.
Square matrix..
When the dimensions of a matrix are equal, it is
called a square matrix.
3
0
4 7
2 6
0 0
The main diagonal of a square matrix consists
of the entries
a11,a22,a33,…,ann
3
0
4 7
2 6
0 0
Does a non-square matrix have a
main diagonal?
No, it doesn’t!!!
Diagonal matrix..
A diagonal matrix is a square matrix
whose off-diagonal elements, aij for ij,
are equal to zero. Example..
4
A 0
0
0
7
0
0
0
3
A Unit Matrix, or Identity matrix, or
1 Matrix
Identity Matrix
A unit matrix, or identity matrix, or 1
matrix, is a diagonal matrix whose
diagonal elements are 1. A unit matrix of
order n is denoted by In or simply I.
For n = 3, we have
1 0 0
I 3 0 1 0
0
0
1
Identity Matrix
Can a non-square matrix be a
unit matrix?
No, it can’t, because non-square
matrix has no main diagonal.
Only square matrices have an
identity matrix!
Identity Matrix
Hence, the unit matrix is always a square
matrix.
This 3 by 3 real matrix is said to be of order 3.
In general an n by n matrix is said to be of
order n.
3
0
4 7
2 6
0 0
This is matrix of order 3.
Matrices are denoted in several different ways by
different authors. Some use parentheses, some use
double vertical lines. In this course we will use one
of the three following ways:
a11 a12
a
a
21
22
A
.
.
a m1 a m 2
... a1n
... a 2 n
aij
... .
... a mn
( m,n )
Notation
9 6 23
A
15 2 0
12 3 / 4 2.7
A 655
. 917
. 44
. 012
. 73
239
A Matrix does not represent a
number of any type!!!
A Matrix is not a scalar!!!
It does not have a value!!!
Exercises..
Exercises..
Is the number of rows of a given
matrix always the same as the
number of columns?
No, it isn’t.
Exercises..
Is the number of rows of a given
matrix always greater than the
number of columns?
No, it isn’t.
Is this a matrix ?
Why ?
2
1
0
-2
3
No, it isn’t, because is not a rectangular array.
Exercises
What is the entry in the third row and
second column of matrix A?
What is the address of the entry 6?
1
A 6
1
9
2
3
Exercises
What is a12 and what is a21 in next
matrix?
a
ij
( 2 ,2 )
2 2
0 1
2 3
1 4
9 8
7 5
Matrix Equalities and Inequalities
Definition:
Two matrices A and B are said to be
equal when they are of the same order
(have the same shape) and all their
corresponding entries are equal; that is,
aij = bij
for all i and j.
Matrix Equalities and Inequalities
Example: A=B
1
A 6
1
9
2
3
1
B 6
1
9
2
3
What is the condition for A=B in this example?
A=B only when x=3.
x
A 4
1
2
7
3
3
B 4
1
2
7
3
Why does AB in this next example?
x
A 4
1
2
7
3
x
B 4
1
2
7
3
5
1
9
AB because A and B do not have
the same order (do not have the
same shape).
Matrix Inequalities
Definition:
A real matrix A is said to be
“greater than” (>) real matrix B
of the same order when each of
the entries of A is “greater than”
each of the corresponding
entries of B.
Matrix Inequalities..
Matrices behave differently from real
numbers with respect to inequalities.
For two real numbers a and b:
If ab and ab,
then a=b.
That is not the case for real matrices
of the same order.
Matrix nonnegativity..
A matrix is said to be nonnegative if each
entry (elements) is said to be nonnegative
if each entry (elements) is nonnegative.
Thus we write
X 0
to indicate that each component xij of X is
a nonnegative real number
Exercises..
Matrix Equalities and Inequalities
Find, if possible, all values for
each unknown that will make
each of the following true:
1
x
0
4
1
4
y 2 x 1
2 y
3
0
3
Calculate if possible A+B+C=?
1
A
2
4
8
3 2
C
2 2
2 5
B
0 1
Result:
6 7
A BC
0 5
Find, if possible, all values for unknown x that
will make of the following true:
2
x
1
0 1
3
1 6 2
5
0
3
Matrix addition and subtraction..
Matrix Addition
Matrix addition and subtraction can be
performed only when the two matrices to
be added are of the same order.
We say then that they are
conformable for addition or
conformable for subtraction.
Definition:
Given matrices
A=[aij](m,n)
and
B=[bij](m,n)
Matrix addition is defined as
A+B=[aij+ bij] (m,n)
In other words, if two matrices are of the
same order they may be added by adding
corresponding entries.
The same rules are valid for
subtracting the matrices.
Matrix subtraction is defined as
A-B=[aij- bij] (m,n)
In other words, if two matrices are
of the same order they may be
subtracted by subtracting
corresponding entries.
Calculate if possible A+B=?
A 0 5 8
3
B 6
4
Not the same order, hence impossible.
Matrix Addition and Subtraction
If A is a 2 by 3 matrix and B is a 3 by 2
matrix, are A and B conformable for
addition?
Are A and B conformable for subtraction?
Why?
1 2
A
3 4
Using
2
and B
1
1
3
Prove rule 2) for the transpose of the sum
of two matrices :
(A+B)T=AT+BT
Prove rule 2) for the transpose validity for
the case (A-B)T =AT-BT
Example: Matrix Addition
A manufacturer produces
a certain metal. The costs of
purchasing and transporting
specific amounts of necessary
raw materials (ores) from two
different locations are given by
the following matrices:
Example:
Matrix Addition
p. c. t . c.
16 20 R
A 10 16 S
4
9
T
p. c. t . c.
12 10 R
B 14 14 S
12 10 T
p.c. means purchasing costs; t.c.means transport costs
R, S and T are ores
Find the matrix representing the total p.c. and
t.c. of each type of ore!
Find the matrix representing the total p.c. and
t.c. of each type of ore!
p. c.
28
A B 24
21
t . c.
30 R
30 S
14 T
MSCI2400
Analytical Methods in Management
Dr LAZO ROLJIC
Fulbright Fellow
DuPree College of Management
Faculty of Economics
University of Banja Luka
Bosnia and Herzegovina
Matrix algebra...
Week 2-2
Multiplying a matrix by a scalar...
Definition:
Given matrix A=[aij](m,n) and scalar k,
then
kA = [k aij](m,n)
In other words, a matrix may be
multiplied by a scalar by multiplying every
entry of the matrix by the scalar.
Examples:
3 2 4
A
1 0 2
and k=2
2 3 2 2 2 4 6 4 8
kA
2 1 2 0 2 ( 2) 2 0 4
5 2 6
B
1 0 1
and k=-1
5
kB ( 1) B B
1
2
0
6
1
Is there any restriction on the
multiplication of a matrix by scalar?
No.
The product of a scalar and matrix is
another matrix.
We are now in position to handle matrix
subtraction similarly to the way in which
we perform scalar subtraction.
Remember that the rule in real number
algebra is:
a-b = a + (-b) or 6-4=6+(-4)
Likewise, for matrices, A-B=A+(-B).
Matrix addition is
a) Associative:
b) Distributive:
c) Commutative:
(A+B)+C=A+(B+C)
k(A+B)=kA+kB
(c+k)A=cA+kA
A+B=B+A
A+0=A
Multiplication of Matrices..
The product of two matrices..
We now define a second kind of product the product of two matrices.
Before giving a general definition,
however, we consider the method of
multiplying a row matrix (row-vector) by a
column matrix (column vector).
(Here the row matrix precedes the column
matrix and the number of columns in A
equal number of rows in B)!
Definition
Let A be a 1 by p matrix and B be a p by
1 matrix. The product C=AB is a 1 by 1
matrix given by
b11
b
21
.
a11 a12 ... a1 p a11b11 a12b21 ...a1 pbp1
.
.
bp1
For example,
0
2 1 3 4 (2 0) (1 4) (3 2) 10 !!!!
2
Product of row matrix and column matrix is 1 by 1
matrix, that is a SCALAR!
Matrix multiplication
In order to present some logic to the
definition of the product of two matrices,
we find it convenient first to define the
product of two vectors.
The special matrices form consisting of
either a single row or a single column are
referred to as vectors.
Matrix multiplication
A vector, whether it be a row vector or a
column vector, is a special case of the
matrix; in the first case it has one row and
in the second case it has one column.
In either case it can be considered to be a
point in n-dimensional space, where the
components are the coordinates.
1
3
The examples of two vectors:
3.5
3
2.5
2
1.5
1
0.5
0
and
2 2
(1,3)
(2,2)
Series1
0
1
2
3
The examples of two vectors
3.5
3
2.5
2
1.5
1
0.5
0
1
3
and
2
2
(1,3)
(2,2)
Series1
0
1
2
3
Therefore the row vector [a1 a2 a3] or the
column vector
a1
a
2
a3
can be considered to be a point in threedimensional space. There is no
geometrical distinction between these two
vectors.
The decision to write a vector as a row or
a column vector is therefore a matter of
convenience.
Matrix multiplication
The operation of addition or subtraction
of two vectors or multiplication by a scalar
(as we will se later) follows the rules for
matrices.
Specific for vectors are inner product and
vector length or norm of vector.
Matrix multiplication
Notice that the number of columns of A
must equal the number of rows of B.
(Conformable for multiplication or
susceptible to multiplication)
One use of this operation may be forecast, if we
observe that a linear equation may be expressed
using a product of two matrices, that is,
x
3 3
y
2
Means [2x+3y]=[3] and therefore
2x + 3y = 3
Now in order to express a system of
equations such as
2x+3y = 3,
x + 4y = 1,
using matrix notation, we will need the
following definition.
Here we are not restricted to a row
matrix times a column matrix, although
we will see that the multiplication simply
requires a succession of the manipulation
previously described.
Definition..
Let A be an m by p matrix and B be a p
by n matrix.
The product C=AB is an m by n matrix
where each entry cij of C is obtained by
multiplying corresponding entries of the
ith row of A by those of the jth column of
B and the adding the results.
Matrix multiplication
The operation defined above can be
illustrated in general by the following
diagrams.
a11
a21
am1
a12
a22
. .
am 2
... a1 p b11 b12
... a2 p b21 b22
. .
. .
... amp bp1 bp 2
... b1n c11 c12
b
... 2 n c21 c22
. . . .
... bpn cm1 cm2
... c1n
... c2 n
. .
... cmn
Matrix multiplication
Where
c11=a11b11+a12b21+…+a1pbp1
or, generally speaking...
Matrix multiplication
a
11
.
ai1
.
am1
...
.
...
.
...
a1 p b11
.
aip
.
amp bp1
... bij
. . .
. . .
. . .
... bpj
... b1n c11 ... c1n
. .
.
.
.
. . . cij .
. . . . .
... bpn cm1 ... cmn
Matrix multiplication
Where
cij = ai1b1j + ai2b2j +…+aipbpj
One very handy rule..
If you multiply matrix A of dimension
(m,n) and matrix B of dimension (n,k),
then result matrix will be matrix C of
dimension (m,k).
You can see that (m,k) are the outer
numbers of matrices A and B dimensions.
Example:
1 2
A
1 0
3 0 1
B
0 1 1
1 2 3 0 1
AB
1 0 0 1 1
(1 3 2 0) (1 0 2 1) (1 1 2 1) 3 2 3
AB
(1 3 0 0) (1 0 0 1) (1 1 0 1) 3 0 1
Find result BA, if possible ?!
Why is this impossible?
This is because the number of columns of
the left matrix does not equal the number
of rows of the right matrix.
In order for multiplication of matrices to
be performed, the number of columns of
the left matrix must equal the number of
rows of the right matrix. We than say that
the left matrix is conformable or
susceptible for multiplication to the right
matrix.
Matrix multiplication
Prior to our definition of matrix
multiplication we implied that it could be
used to express the system of equations
2x + 3y =3
x + 4y =1 Consider the following matrix
equation.
2 3 x
3
1
4 y
1
2x + 3y =3
x + 4y =1
2
1
3 x
3
4 y
1
Perform the indicated matrix
multiplication on the left side;there results
2 x 3 y
3
x 4 y 1
By the definition of the equality of matrices we
obtain our original system.
Example
2
AB
3
1 0
2 1
0 4
2 1
B
A
1
3
3
2
4 (2 0 11) (2 4 1 3) 1 11
3 (3 0 2 1) (3 4 2 3) 2 18
To form A, B was premultiplied by A;To form BA,
B was postmultiplied by A.
0
BA
1
4 2
3 3
1 (0 2 4 3) (0 1 4 2) 12
2 (1 2 3 3) (11 3 2) 11
Note: BAAB. This is quite different from scalar
algebra where ab=ba (that is 23=32).
8
7
Matrix Multiplication
When we say matrix B is postmultiplied
by matrix A, we mean BA.
When we say matrix B is premultiplied by
matrix A, we mean AB.
1 2
A
Using:
3 4
2
B
1
1
3
Proof that the transpose of a product two
matrices is the product of the transposes
in reverse order,e.g.
(AB)T=BTAT
Positive integral powers of square matrices..
we define them as we did for scalars
A2 = AA
A3 = AAA
etc.
Could you realize why A has to be square
for An (for n2) ?
Only then does A have the same number of
columns as the number of rows, necessary
for matrix multiplication.
One characteristic of the identity matrix..
If I is the unit matrix, and A is a square
matrix of the same order, then
I A = A I
Could you realize why A has to be
square matrix in this case?
One definition..
A diagonal matrix is a square matrix
whose off-diagonal elements, aij for ij,
are all equal to zero.
Example:
An identity matrix is a diagonal matrix.
Example...
One illustration of how matrix
multiplication my be used. A simple
problem from the field of decision
making.
Example..
A certain fruit grower in Florida has a
boxcar loaded with fruit ready to the
shipped north. The load consists of 900
boxes of oranges, 700 boxes of grapefruit,
and 400 boxes of tangerines. The market
prices, per box, of the different types of
fruit in various cities are given by the
following chart.
Example..
New York
Cleveland
St. Louis
oranges
$4 per box
$5 per box
$4 per box
grapefruit
$2 per box
$1 per box
$3 per box
tangerines
$3 per box
$2 per box
$2 per box
Oklahoma City $3 per box $2 per box $5 per box
To which city should the carload of fruit be sent in
order for the grower to get maximum gross
receipts for this fruit?
Solution...
Consider the chart..
oranges
New York
$4 per box
Cleveland
$5 per box
St. Louis
$4 per box
Oklahoma City $3 per box
grapefruit
$2 per box
$1 per box
$3 per box
$2 per box
tangerines
$3 per box
$2 per box
$2 per box
$5 per box
as the “price matrix”, and form the quantity matrix
900boxes
700boxes
400boxes
Example..
The product of these matrices, as shown
below, yields an “income matrix” where
each entry represents the total income
from all the fruit at the respective cities.
4 2 3
3600 1400 1200 6200
5 1 2 900 4500 700 800 6000
700
4 3 2 3600 2100 800 6500
400
3 2 5
2700 1400 2000 6100
Example..
4
5
4
3
2 3
3600 1400 1200 6200
900
1 2 4500 700 800
6000
700
3 2 3600 2100 800 6500
400
2 5
2700 1400 2000 6100
The largest entry in the income matrix is 6500,
and therefore the greatest income will come
from St. Louis.
Exercises..
Given V1 and V2.
Find V1 V2.
V1 3 0 6 2
V2
1
2
3
7
V1V2=3(-1)+02+6 3+2 7=29
Multiply...
2
A
4
0
3
and
1
2
3 0 6 4
B
1 2 5 3
9 6 27 1
A B 11 2 19 20
2 4 10 6
Matrix multiplication laws..
The associative law for multiplication is
ABC=(AB)C
which means that if we wish to find the
product of three matrices, we can either
multiply the first two matrices and then
postmultiply it by the third matrix, or we
can multiply the second and third matrices
and then premultiply it by the first matrix.
Matrix Multiplication
The distributive law for multiplication with
respect to addition requires that identical
results be obtained whether you add the
products AB and AC or multiply A by the
sum of B and C:
A(B+C)=AB+BC
MSCI2400
Analytical Methods in Management
Dr LAZO ROLJIC
Fulbright Fellow
DuPree College of Management
Faculty of Economics
University of Banja Luka
Bosnia and Herzegovina
...
-Sigma notation
-Elementary matrix transformation
-Determinants
-Inverse matrix
-Gauss-Jordan operations
-Solution of simultaneous system of
equations
- Cramer’s rule
Sigma notation
When matrix multiplication is discussed in
general, the co called “ notation” (read
sigma notation) is very helpful. is letter
from Greek alphabet and in mathematics
usually stands for “sum of”.
5
For example, the sum 12 2 2 32 4 2 52 k 2
k 1
The expression is read “the sum of k2 where k ranges
from 1 through 5”. k is called the index of summation.
Examples:
50
2+4+6+8+10+…+98+100=
2k
k 1
100
x1+x2+x3+…+x100=
x
k 1
k
3
ai1+ai2+ai3=
a
k 1
ik
3
a11b11+a12b21+a13b31= a1k bk 1
k 1
a11b11+a12b21+a13b31=
3
a
k 1
b
1k k 1
This example my be recognized as the
entry in the first row and first column of
the product of the two matrices.
a11
a21
am1
a12
a22
. .
am 2
... a1 p b11 b12
... a2 p b21 b22
. .
. .
... amp bp1 bp 2
... b1n c11 c12
b
... 2 n c21 c22
. . . .
... bpn cm1 cm2
... c1n
... c2 n
. .
... cmn
Elementary matrix transformation..
Definition: The three operations:
1) interchange any two rows, (this is
equivalent to writing the equation in a
different order and obviously this does not
effect the solutions of the system),
2) multiply any row by a nonzero scalar,
3) add to any row a scalar multiple of
another row,
are called elementary row operations.
Elementary Operations
Elementary column operations are defined
by replacing the word “row” by “column”
throughout the preceding definition.
An elementary operation is any operation
that is either an elementary row operation
or an elementary column operation.
Equivalent matrices
If a matrix A can be transformed into a
matrix B by means of one or more
elementary operation, we write
A B
and say that A is equivalent to B.
1
2
Example.. The matrix
3
3
4
1
Can be transformed to 1 3 4
0 9 9
by elementary row
operation 3) - multiply the first row by 2 and
add to second row (R2=2R1+R2). This then can be
transformed to 1 3 4
0
1
1
by elementary operation 2) -multiply the
second row by 1/9 (R2=R2/9).
Exercises..
2
4
1
5
,
2
0
1
3
R2=(-2R1+R2)
Which elementary row operation (if
any) transforms the first matrix into
the second?
2
4
1
5
-2R1
2
4
1
5
+R2
-4
-2
Which elementary row operation (if any)
transforms the first matrix into the second?
2
1
4
2
6
1
1
4
2
2
3
4
Determinants..
A matrix has no numerical value.
However, every square matrix of scalars
has what is called determinant.
Determinants..
The Determinant is a number
associated with every square matrix.
The determinant of A, denoted by
|A|, is obtained as the sum of all
possible products in each of which
there appears one and only one
element from each row and each
column of A.
The determinant of A is..
a11 a12 ... a1n
A
am1
. . ... .
. . ... .
am2 ... amn
Finding the determinant of a 2 by 2 matrix is
straightforward..
11
12
a a
A
a21 a22
+
-
a11 a12
A
a11a22 a21a12
a21 a22
Determinants..
For a larger-order determinants, define Dij
as the determinant of the [(n-1)x(n-1)]
matrix formed by striking out (or deleting)
the ith row and jth column of A.
Dij is called the (i,j) “minor” of A.
For example: minor D11 of |A|...
a11 a12 a13
A a21 a22 a23
a31 a32 a33
a22 a23
D11
a32 a33
Next, we define the (i,j) cofactor of A to
be
ij=(-1)i+j Dij
that is, the (i,j) minor ( Dij ) with a
negative sign attached if the sum of
subscripts is odd, and a positive sign if the
sum is even.
Examples: 11= (-1)2D11, 12=(-1)3D12,
13=14D13, etc.
Determinants..
The minor Dij of the element aij is the
determinant obtained from the square
matrix A by striking out (or deleting) the
ith row and jth column.
So,
a11
a12
a13
A a21
a22
a23
a31
a32
a33
+
+
a11 a12
A a 21 a 22
a31 a32
a13
a 22
a 23 a11
a32
a33
a 23
a 21
a12
a33
a31
a 23
a 21
a13
a33
a31
a 22
a32
Example..
11 4 6
A11 (1)
3 2
3
A
2
1
5
4
3
2 6
A12 (1)
1 2
1 2
7
6
2
A13 (1)
1 3
2 4
1 3
4 6 2 6 2 4
A 3
5
7
3(10) 5(10) 7(10) 10
3 2 1 2 1 3
Properties of determinants
1) If a matrix B is formed from a matrix A
by the interchange of two parallel lines
(rows or columns) then |A|=-|B|.
2) The determinants of a matrix and its
transpose are equal; that is, |A|=|AT|.
3) If all of the entries of any row or
column of matrix A are zero, then |A|=0.
4) The determinant of a matrix with two
identical parallel rows or columns is zero.
Example for properties of 3) and 4)
0 1 4
2 2 1
A 2 1 6 0
A 3 3 1 0
0 0 0
4 4 0
Inverse matrices...
Inverse matrix..
The inverse of a matrix A of order (n x n) is the
matrix A-1 such that AA-1=I, or A-1A=I.
In other words, the matrix which when
multiplied by the matrix A produces the identity
matrix is said to be inverse of A and is denoted
by A-1.
Since A conforms to A-1 and A-1 conforms to A,
A must be square. Therefore, we conclude that
only square matrices (but not all, f.e. singular)
have inverses.
The singular matrix
The singular matrix is matrix which
determinant is equal zero.
Inverse Matrices
Division is not defined in matrix algebra.
The matrix algebra counterpart of division
in scalar algebra is achieved through
matrix inversion.
In algebra of real numbers, the inverse of
of X is 1/X, is a quantity which when
multiplied by X yields 1.
Inverse Matrix
The inverse of a square matrix A, which
we designate A-1, is a matrix which when
postmultiplied or premultiplied by A yields
the unit or identity matrix.
AA-1=I, A-1A=I.
Or, we can say, if two square matrices A
and B, each of degree p, satisfy the
equation AB=Ip we call B the inverse of
A, written B=A-1.
Proof..
This is valid AA-1=I, A-1A=I.
Suppose is given a matrix B which satisfies
BA=I.
If we now multiply each side of the last
equation by A-1 on the right, we have
BAA-1=IA-1
which reduces to B=A-1.
Matrix Inverses
Thus, the inverse of matrix A is..
1
2 3 1 1 / 3 1 / 9 5 / 9
1
A 0 1 2 2 / 3 1 / 9 4 / 9
3 2 1 1 / 3 5 / 9 2 / 9
How we calculate A-1?
a11 a12
A
a21 a22
The inverse of any square matrix A
consisting of two rows and two columns is
computed as follows:
a
/
d
a
/
d
22
12
1
A
a21 / d a11 / d
Where d=a11a22-a21a12 is determinant of the 2x2 matrix
A.
Example..
0.7 0.3
A
0.3 0.9
Then d=0.70.9-(-0.3)(0.3)=0.54 and
0
.
9
/
054
.
0
.
3
/
054
.
167
.
056
.
1
A
. 0.7 / 054
. 056
. 130
.
0.3 / 054
Gauss-Jordan operations..
One way to form the inverse of a square
matrix is to perform simultaneously on a
unit matrix, of the same order, necessary
row operations to convert the left matrix
to I. This is known as Gauss-Jordan
operations. Thus, given
2 4
A
3 2
Gauss-Jordan operations..
Arrange alongside A a unit matrix I:
2 4
1 0
3 2 0 1
2 4
1 0
3 2 0 1
Now perform on A the row-column operations via
which the Gauss-Jordan procedure is employed to
convert A to a unit matrix-performing these
operations simultaneously on I.
Thus, when the first row is divided by 2 to yield a
1 in the first row, first column of A, divide the first
row of I by 2 also (R1=R1/2). When the second row
of A is replaced by the sum of itself and the new
first row multiplied by -3, replace the second row
of I similarly (R2=R2+(-3)R1).
January 21, 1999
Top Ten Ways to Succeed in MSCI 2400
.Understand –Don’t Memorize
. Ask when Something don’t Understand
.Don’t Miss Class
.Don’t Fall Behind
.Complete all Homework Individually
.Read the Text
.Study the Homework
.Study the Handouts
. Study the old Exams
.Participate and Thoroughly Understand
Assignments
.Come to Office Hours for Help
Gauss-Jordan operations..
The final result is
1
0
IA
1
0
1 / 4 1 / 2
1
3 / 8 1 / 4
Thus, as A is transformed into I, I is transformed
into A-1.
Why is the inverse matrix so important?
To get some appreciation and
understanding of the utility of the matrix
inverse, consider the following linear
system of equations. Let
15
.
1 2.4
A 1 5 1
.
3 3.5
15
x1
X x2
x3
Thus if we form AX=b
2000
b 8000
5000
15
.
1 2.4
A 1 5 1
.
3 3.5
15
x1
X x2
x3
2000
b 8000
5000
we really have the following system of
three equations in three unknowns:
1.5x1+ x2+ 2.4x3=2000
x1+5x2+
x3=8000
1.5x1+3x2+3.5x3=5000
To obtain a solution to this system when
written in the matrix form, we start with
the equation AX=b
AX=b
Multiplying both sides of the equation on
the left by A-1, we obtain
A-1AX=A-1b
Evaluating the left-hand side by using the
associative law, we have
A-1AX=(A-1A)X=IX=X
and thus our solution is
X=A-1b
According to X=A-1b, then, to solve m
equations in m unknowns, we should find
the inverse of the matrix of coefficients
and multiply this by the column vector of
constants b.This result will be a columnvector X.
Thus, if we are able to find the inverse of
the matrix of coefficients, it is easy to find
the solution of the system of equations.
15
x1
.
1 2.4
A 1 5 1 X x2
.
3 3.5
15
x3
2000
b 8000
5000
AX=b, according to X=A-1b, we should
find the inverse of the matrix A and
multiply this by the column vector b. The
result will be a column vector X.
15
.
1 2.4 1
1
5
1
0
.
3 3.5
15
0
0
1
0
0
0
1
Now we should to perform next
elementary row-column operations to get
A-1:
15
. 1 2.4 1 0 0
1 5 1 0 1 0
15
. 3 35
. 0 0 1
R1=R1/1.5
R2=R2-R1
16201
.
0.4134 12291
.
1
R3=R3-1.5R1
A 0.2235 01844
.
01006
.
R2= R2/4.333
05028
.
0.3352 0.7263
R3= R3/1.37692
R2=0.13846R3+ R2
R1=-1.69231R3+ R1
After that, using X=A-1b we will calculate
solution vector X.
16201
.
0.4134 12291
. 2000 4019
.
1
X A b 0.2235 01844
.
01006
.
.
8000 15319
05028
.
0.3352 0.7263 5000 557
.
The best computational scheme for
calculating of a solution of n equations
with n variables (vector Xp) is to follow a
procedure similar to this described earlier
for finding the inverse matrix. But, instead
of computing the inverse matrix, we may
set up together A and b and then apply
the necessary row transformations to
reduce A to its identity form.
A
b
I
A-1b
In other words, by applying the same
transformations to b that we did to A, we
have converted b into A-1b which is
solution vector.
In this manner we compute A-1b without
actually finding A-1 and without
performing the multiplication of A-1 by b.
If for any reason we should want the
inverse of A, we can get it by setting up I
behind A on this manner:
A
I
b
After the proper row operations, we will
have
I
A-1
A-1b
Inverse matrix..
Note that all matrices do not have
inverses, yet whenever the inverse to a
matrix can be found, it is unique.
But, the existence of a solution is not
dependent on the existence of the inverse
matrix. Reasons for that almost are:
redundancy, inconsistency or singularity
of the set of equations.
Redundancy
Two or more equations of the set may be
linearly dependent (that is, a combination
of sums or differences of multiples of other
equations).
The dependent equations are redundant
and can be omitted from the system. We
then have a system of fewer than m
equations in m variables. (Many solutions).
Example of one redundant system..
2x1 -4x2 + x3=7
-x1+7x2 -3x3=12
4x1 -8x2+2x3=14
Inconsistency
On the other hand, system can be
inconsistent and then A-1 does not exist.
For example, consider:
3x1+2x2+ x3=14
2x1 -x2+3x3=10
5x1+ x2 +4x3=5
Here the third equation is inconsistent
with the first two and no solution exist.
Singularity
Finally, a matrix could be singular and its
inverse does not exist.
3x1+3x2+ x3=14
2x1+2x2+2x3=10
5x1+5x2 -2x3 =7
x1 and x2 have equal coefficients in each
equation and, hence, are dependent on
each other. The matrix of coefficients is
then singular and its inverse does not
exist.
Note!
Every nonsquare matrix is singular.
Exercise..
Compute the inverse matrix of A:
4 8
A
6 4
R1/4; (-6R1+R2); R2/8; (-2R2+R1)
4 8
A
6 4
First set the problem in the following form:
4
6
1
6
A
I
8
4
1 0
0 1
2
4
1 / 4 0
0 1
1 2 1/ 4 0
0 8 3 / 2 1
Now perform the G-J steps
on both of these matrices
simultaneously. (First R1/4)
Now multiply R1 by -6 and
add result to the second
row. (-6R1+R2)
Next divide R2 by -8. (R2/-8)
1 2 1/ 4 0
0 8 3 / 2 1
1 2 1 / 4 0
0 1 3 / 16 1 / 8
I
A-1
1 0 1 / 8 1 / 4
0 1 3 / 16 1 / 8
Finally, (-2R2+R1)
Solution of a set of simultaneous linear
equations
Any set of simultaneous linear equations
has a convenient representation using
matrix notation. The system
a11x1+a12x2+…+a1nxn = b1
a21x1+a22x2+…+a2nxn = b2
… … … … … …
am1x1+am2x2+…+amnxn = bm
can be written as AX=b
where..
A=[aij](m,n)
x1
.
X .
.
x
n
b1
.
b .
.
b
m
If A is square (m=n) and nonsingular,
the solution vector is given:
1) by X=A-1b (using matrix inverse
notation) or
2) using Cramer’s rule for nonsingular
determinants
i
det( A)
xj
, j 1,2,..., n
det A
where (iA) denote the matrix obtained
from A by replacing the jth column of A
by the vector b.
Example of Cramer’s rule application..
2x1+x2+ x3=0
x1 -x2+5x3=0
x2 - x3=4
x2
x1
0
1
1
0
1
5
4
1
1
2
1
1
1
1
5
0
1
1
2
0
1
2
1
0
1
0
5
1
1
0
0
4
1
0
1
4
2
1
1
2
1
1
1
1
5
1
1
5
0
1
1
0
1
1
x3
Homework 1
January 19,1999
1) Express the product of 2 by 2 matrices
using notation.
2) Write the following without notation:
5
k
k 1
7
( k 2)
k 3
4
a
k 1
k
3
a
k 1
2k
ak 3
3) Express the sums in sigma notation:
a11 a12 b11 b12
a
21 a22 b21 b22
b13
b23
4) Find by definition determinant of the
matrix:
2
A 4
0
1
8
7
3
6
5
5) Using matrix A given below proof that the
determinants of a matrix and its transpose are
equal.
1
0
0
2
2
0
3
1
4
6) Using elementary matrix operation suggested
below (or self selected), find the solution
(vector X) of the next system:
15
.
1
15
.
1
5
3
2.4 x1 2000
1 x 2 8000
3.5 x 3 5000
R1=R1/1.5
R2=R2-R1
R3=R3-1.5R1
R2= R2/4.333
R3= R3/1.37692
R2=0.13846R3+ R2
R1=-1.69231R3+ R1
7) Using Cramer’s rule find solution of
next system of simultaneous equations:
2x1+x2+ x3=0
x1 -x2+5x3=0
x2 - x3=4