Вы находитесь на странице: 1из 26

MATRIKS

eng: matrices, matrix


Dedy Wirawan Soedibyo
a Matrix is an array of numbers:

A= (Matrix name is A, This one has 2 Rows and 3 Columns)

(Array adalah sekumpulan variabel yang memiliki tipe data yang sama dan dinyatakan
dengan nama yang sama.

Tambahan: Array merupakan konsep yang penting dalam pemrograman, karena array
memungkinkan untuk menyimpan data maupun referensi objek dalam jumlah banyak dan
terindeks.)

http://www.mathsisfun
Other Definition
A matrix is a concise and useful way of uniquely representing and working with
linear transformations. In particular, every linear transformation can be
represented by a matrix, and every matrix corresponds to a unique linear
transformation. The matrix, and its close relative the determinant, are extremely
important concepts in linear algebra, and were first formulated by Sylvester (1851)
and Cayley.

http://mathworld.wolfram.com/Matrix.html
Notation
A matrix is usually shown by a capital letter (such as A, or B)
Each entry (or "element") is shown by a lower case letter with a
"subscript" of row,column:

A = 2 × 3 matrix  SIZE of The Matrix


Matrices Operation: Adding

The two matrices must be the same size, i.e. the rows must
match in size, and the columns must match in size.

Example: a matrix with 3 rows and 5 columns can be added to


another matrix of 3 rows and 5 columns.
But it could not be added to a matrix with 3 rows and 4 columns
(the columns don't match in size)
Matrices Operation: Negative
Matrices Operation: Subtracting

Note: subtracting is actually defined as the


addition of a negative matrix: A + (-B)
Matrices Operation: Multiply by a Constant

We call the constant a scalar, so officially this


is called "scalar multiplication".
Matrices Operation: Multiplying by Another Matrix
To multiply a matrix by another matrix we need to do the "dot product"
of rows and columns
example:
To work out the answer for the 1st row and 1st column:

(1, 2, 3) • (7, 9, 11) = 1×7 + 2×9 + 3×11 = 58


Matrices Operation: Multiplying by Another Matrix
for the 1st row and 2nd column:

(1, 2, 3) • (8, 10, 12) = 1×8 + 2×10 + 3×12 = 64

for the 2nd row and 1st column: (4, 5, 6) • (7, 9, 11) = 4×7 + 5×9 + 6×11 = 139

for the 2nd row and 2nd column: (4, 5, 6) • (8, 10, 12) = 4×8 + 5×10 + 6×12 = 154
Matrices Operation: Multiplying by Another Matrix

Why Do It This Way? (matrix.xlsx)


Matrices Operation: Multiplying by Another Matrix

• The number of columns of the 1st matrix must equal the number of
rows of the 2nd matrix.
• And the result will have the same number of rows as the 1st matrix,
and the same number of columns as the 2nd matrix.
Matrices Operation: Multiplying by Another Matrix
Matrix multiplication is not commutative:

AB ≠ BA

Identity Matrix is the matrix equivalent of the number "1":

I is special matrix, because when we multiply by it,


the original is unchanged:
A×I=A

A 3x3 Identity Matrix I×A=A


Matrices Operation: Dividing by Another Matrix -
Inverse
A/B = A × (1/B) = A × B-1
multiply by an inverse
where B-1 means the "inverse" of B.

8 × (1/8) = 1

A × A-1 = I

(1/8) × 8 = 1

A-1 × A = I
Matrices Operation: Inverse

2x2 Matrix Multiple a Matrix with it’s Inverse

(matrix.xlsx)
Matrices Operation: Inverse

Say that you know Matrix A and B, and want to find Matrix X:
XA = B
It would be nice to divide both sides by A (to get X=B/A), but
remember we can't divide.

But what if we multiply both sides by A-1 ?


XAA-1 = BA-1
And we know that AA-1 = I, so:
XI = BA-1
We can remove I (for the same reason we could remove "1" from 1x
= ab for numbers):
X = BA-1
And we have our answer (assuming we can calculate A-1)
Matrices Operation: Inverse

 Why needs INVERSE MATRICES?

Imagine you couldn't divide by numbers, and someone asked


"How do I share 10 apples with 2 people?"
1
But you could take the reciprocal of 2 (which is 0,5 or ), so
2
you could answer:
1
10 × 0,5 = 5 or 10 x =5
2
They get 5 apples each
Matrices Operation: Inverse

 Why needs INVERSE MATRICES?


 A group took a trip on a bus, at $3 per child and $3,20 per
adult for a total of $118,40.
 They took the train back at $3,50 per child and $3,60 per
adult for a total of $135,20.
 How many children, and how many adults?
Matrices Operation: Inverse

 A group took a
trip on a bus, at
$3 per child and
$3,20 per adult
for a total of
$118,40.
 They took the
train back at
$3,50 per child XA = B
and $3,60 per
adult for a total
of $135,20.
 How many
children, and
how many adults?
Matrices Operation: Inverse

A group took a

trip on a bus, at X = BA-1
$3 per child and
$3,20 per adult
for a total of
$118,40.
 They took the
train back at
$3,50 per child
and $3,60 per
adult for a total
of $135,20.
 How many
children, and
how many adults?
Matrices Operation: Inverse

 A group took a AX = B
trip on a bus, at
$3 per child and
$3,20 per adult
for a total of This is different to the example above! X
$118,40. is now after A.
 They took the
train back at
$3,50 per child A-1AX = A-1B
and $3,60 per
adult for a total
of $135,20. IX = A-1B
 How many
children, and X = A-1B
how many adults?

Task: Find the solution using this form


Matrices Operation: Inverse

 A group took a
trip on a bus, at
$3 per child and
$3,20 per adult
for a total of
$118,40.
 They took the
train back at
$3,50 per child
and $3,60 per
adult for a total
of $135,20.
 How many
children, and
how many adults?
Matrices Operation: Inverse

 Such a Matrix is called "Singular", which only happens when


the determinant is zero. (No. INVERSE)

Bigger than 2x2 Matrix?


Matrices Operation: Inverse of a Matrix
using Elementary Row Operations
Also called the Gauss-Jordan method.

(This is called the "Augmented Matrix")


RULES
 swap rows
Matrices Operation: Inverse of a Matrix  multiply or divide each element
using Elementary Row Operations in a a row by a constant
 replace a row by adding or
Also called the Gauss-Jordan method. subtracting a multiple of another
row to it
Determinan of a Matrices
For a 4 ×4 Matrix
For a 3×3 Matrix

|A| = a(ei - fh) - b(di - fg) + c(dh - eg)

Вам также может понравиться