# Lekcja 6. Matrices

12 lutego 2016

Obejrzyj poniższy film. Nie przejmuj się, jeśli nie wszystko w nim zrozumiesz. Najważniejsze jest to, aby obejrzeć go przed przeczytaniem tekstu.

Odpowiedz na poniższe pytania.

1. What is the subject of the video?
2. What is a matrix?
3. What do you use if you need a variable to represent a matrix?
4. How many rows and columns does the matrix from the first example have?
5. What transcendental number did the author use in the matrix B?
6. What does the notation A[2,2]=0 mean?
7. What type of equations are matrices used to represent?
8. What can elements of a matrix represent in computer graphics?
9. What four operations on matrices does the author describe?
10. How do you add matrices?
11. Can you add two arbitrary matrices or do they have to satisfy any condition?
12. What is a row vector?

## Matrices

A matrix (plural matrices) is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns that is treated in certain prescribed ways. One such way is to state the order of the matrix. For example, the order of the matrix below is a 2×3 matrix because there are two rows and three columns. The individual items in a matrix are called its elements or entries.

$\left[\begin{array}{ccc}1& 9& 13\\ 20& 5& –6\end{array}\right]$

Matrices are enclosed in [ ] or ( ), and are usually named with capital letters. For example, three matrices named A, B, and C are shown below.

A = $\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]\text{, B =}\left[\begin{array}{ccc}1& 2& 7\\ 0& –5& 6\\ 7& 8& 2\end{array}\right]\text{, C =}\left[\begin{array}{cc}–1& 3\\ 0& 2\\ 3& 1\end{array}\right]$

A matrix is often referred to by its size or dimensions: m × n indicating m rows and n columns. Matrix entries are defined first by row and then by column. For example, to locate the entry in matrix A identified as aij, we look for the entry in row i, column j. In matrix A, shown below, the entry in row 2, column 3 is a23.

$\left[\begin{array}{ccc}{a}_{\mathrm{11}}& {a}_{\mathrm{12}}& {a}_{\mathrm{13}}\\ {a}_{\mathrm{21}}& {a}_{\mathrm{22}}& {a}_{\mathrm{23}}\\ {a}_{\mathrm{31}}& {a}_{\mathrm{32}}& {a}_{\mathrm{33}}\end{array}\right]$

### Types of matrices

A square matrix is a matrix with dimensions n × n, meaning that it has the same number of rows as columns. The 3×3 matrix above is an example of a square matrix.

A row matrix is a matrix consisting of one row with dimensions 1 × n.

$\left[\begin{array}{ccc}{a}_{\mathrm{11}}& {a}_{\mathrm{12}}& {a}_{\mathrm{13}}\end{array}\right]$

A column matrix is a matrix consisting of one column with dimensions m × 1.

$\left[\begin{array}{c}{a}_{\mathrm{11}}\\ {a}_{\mathrm{21}}\\ {a}_{\mathrm{31}}\end{array}\right]$

## Major operations on matrices

Addition and subtraction of matrices is only possible when the matrices have the same dimensions. The sum A+B of two m-by-n matrices A and B is calculated entrywise:

(A + B)i,j = Ai,j + Bi,j, where 1 ≤ i ≤ m and 1 ≤ j ≤ n.

$\left[\begin{array}{ccc}1& 3& 1\\ 1& 0& 0\end{array}\right]\text{+}\left[\begin{array}{ccc}0& 0& 5\\ 7& 5& 0\end{array}\right]\text{=}\left[\begin{array}{ccc}1 + 0& 3 + 0& 1 + 5\\ 1 + 7& 0 + 5& 0 + 0\end{array}\right]\text{=}\left[\begin{array}{ccc}1& 3& 6\\ 8& 5& 0\end{array}\right]$

### Scalar multiplication

The product cA of a number c (also called a scalar in the parlance of abstract algebra) and a matrix A is computed by multiplying every entry of A by c:

(cA)i,j = c · Ai,j

$\left[\begin{array}{ccc}1& 8& –3\\ 4& –2& 5\end{array}\right]\text{=}\left[\begin{array}{ccc}2· 1& 2· 8& 2· –3\\ 2· 4& 2· –2& 2· 5\end{array}\right]\text{=}\left[\begin{array}{ccc}2& 16& -6\\ 8& –4& 10\end{array}\right]$

### Matrix multiplication

Multiplication of two matrices is defined if and only if the number of columns of the left matrix is the same as the number of rows of the right matrix. If A is an m-by-n matrix and B is an n-by-p matrix, then their matrix product AB is the m-by-p matrix whose entries are given by dot product of the corresponding row of A and the corresponding column of B.

For example, the underlined entry 2340 in the product is calculated as (2 × 1000) + (3 × 100) + (4 × 10) = 2340:

$\left[\begin{array}{ccc}2& 3& 4\\ 1& 0& 0\end{array}\right]\text{=}\left[\begin{array}{cc}0& 1000\\ 1& 100\\ 0& 10\end{array}\right]\text{=}\left[\begin{array}{cc}3& 2340\\ 0& 1000\end{array}\right]$

## Applications of matrices

In mathematics matrices are used to represent linear transformations. For example, the rotation of vectors in three-dimensional space is a linear transformation which can be represented by a rotation matrix. The product of two transformation matrices is a matrix that represents the composition of two linear transformations. Another application of matrices is in the solution of systems of linear equations. In computer graphics programming matrices are used to represent and combine common transformations.

## Vocabulary

( ) (bracket)
nawias
[ ] (square bracket)
a value given by
wartość wyznaczona przez
above
powyżej
abstract algebra
algebra abstrakcyjna
arranged in rows and columns
ułożone w wiersze i kolumny
array of numbers
tabela liczb, tablica liczb
capital letter
wielka litera
column
kolumna
column matrix
macierz kolumnowa
composition
kompozycja, złożenie
compute by multiplying
obliczać przez pomnożenie
computer graphics programming
programowanie grafiki komputerowej
corresponding
dimension
wymiar
dot product
iloczyn skalarny
element
element
enclose in
ująć w
entry
pozycja, element
expression
wyrażenie
to identify
identyfikować
if and only if
jeżeli i tylko, jeżeli (wyrażenie logiczne if and only if stanowi połączenie dwóch stwierdzeń za pomocą operatora logicznego i [koniunkcja]; całość oznacza prawdę wtedy, gdy oba zdania mają taką samą prawdziwą wartość — tak jak w bramce XNOR; dobrze ilustruje to przykład z trójkątem równoramiennym: A triangle is isosceles if and only if the triangle has two equal sides. Z tego zdania można wyciągnąć następujące wnioski: If a triangle is isosceles, then the triangle has two equal sides. oraz If a triangle has two equal sides, then the triangle is isosceles. W skrócie if and only if czasami zapisuje się w postaci iff i oznacza symbolem ⇔)
if…then
jeśli…to (część zdania znajdująca się bezpośrednio za if nazywa się hipotezą, a część zdania znajdująca się za then to wniosek — jest to odpowiednik polskich zdań typu: „jeśli zostanie spełniony pewien warunek… to nastąpi taki a nie inny skutek”; symbolicznie if…then oznacza się symbolem logicznym ⇒)
linear transformation
przekształcenie liniowe
matrix (pl. matrices)
macierz
matrix product
iloczyn macierzy
meaning that
co oznacza, że
one such way is to…
jednym ze sposobów jest…
rotation matrix
macierz obrotu
rotation vector
wektor obrotu
row matrix
macierz wierszowa
row
wiersz
scalar
skalar
shown below
pokazany poniżej
solution of systems of linear equations
square matrix
the order of a matrix (matrix order)
stopień macierzy
the same number of rows as columns
taka sama liczba wierszy, co kolumn
three-dimensional space
przestrzeń trójwymiarowa
to be treated in certain prescribed ways
być traktowanym w pewien z góry określony sposób
to calculate entrywise
obliczać wg elementów
to indicate
wskazywać
to look for sth
szukać czegoś
transformation matrix
macierz przekształcenia
underlined
podkreślony

## Exercises

### Exercise 1. Match the words in column A with the ones in column B.

 array of algebra arranged numbers the order linear equations capital in shown of a matrix square letters abstract transformation matrix below linear product system of matrix

### Exercise 2. Answer the following questions.

1. What is a matrix?
2. What do you call individual items of a matrix?
3. How do you denote matrices?
4. What is usually used to name matrices?
5. What are matrices usually referred to by?
6. How do you locate entries in matrices?
7. What is a square matrix?
8. What is a row matrix?
9. What is a column matrix?
10. When is addition and subtraction of matrices possible?
11. How is the sum of two matrices calculated?
12. When is multiplication of two matrices possible?
13. What are matrices used for in mathematics?
14. What are matrices used for in computer graphics programming?

### Exercise 3. Write sentences following the example.

A: 2 × 3; B: 3 × 4 -> If A is a 2-by-3 matrix and B is a 3-by-4 matrix, then their matrix product AB is the 2-by-4 matrix.

1. A: 5 × 4; B: 4 × 7
2. A: 3 × 5; B: 5 × 2
3. A: 9 × 8; B: 8 × 12
4. A: 11 × 17; B: 17 × 13
5. A: 6 × 2; B: 2 × 7

### Exercise 5. Nazwy niektórych firm i marek można tłumaczyć na język polski na różne śmieszne sposoby. Wymyśl absurdalne tłumaczenia lub interpretacje poniższych angielskich nazw. Jak zwykle podziel się owocami swego intelektu w komentarzu.

1. Microsoft
2. General Electric
3. General Motors
5. SAP
6. UPS
7. Ebay
8. Starbucks
9. John Deere

Znasz inne nazwy firm, które można przetłumaczyć lub zinterpretować w podobny sposób?

### Exercise 6. Write sentences replacing "application" with "is used" and "you can use", as in the example.

One of applications of matrices is solving systems of linear equations. -> Matrices are used in the solution of linear equations. You can use matrices to solve linear equations.

1. One of applications of matrices is representing linear transformations.
2. One of applications of matrices is in computer graphics programming is representing and combining common transformations.
3. One of applications of rotation matrices is representing linear transformations.
4. One of applications of the product of two transformation matrices is representing the composition of two linear transformations.
5. The application of matrices is storing numbers, symbols, or expressions.
6. One of applications of [] and () is enclosing matrices.

### Exercise 7. Change the sentences from passive into active as shown in the example.

A matrix is often referred to by its size. -> You can refer to a matrix by its size.

1. A matrix is often referred to by its order.
2. A matrix is often referred to as a n × p matrix.
3. A n × n square matrix with ones on the main diagonal and zeros elsewhere is referred to as an identity matrix.
4. A matrix in which all entries below the main diagonal are zero is called an upper triangular matrix.
5. A matrix in which all entries above the main diagonal are zero is called a lower triangular matrix.
6. A matrix in which all entries outside the main diagonal are zero is called a diagonal matrix.
7. A matrix in which individual values are represented as colors can be referred to as a heat map.
8. A matrix consisting of one row with dimensions 1 × n is referred to as a row matrix.
9. A matrix consisting of one column with dimensions m × 1 is referred to as a column matrix.

### Exercise 8. Use the following information to write sentences using "if and only if", as in the example.

A triangle is equilateral ⇔ its angles all measure 60° -> A triangle is equilateral if and only if all its angles measure 60°.

1. a square matrix has an inverse ⇔ its determinant is not zero.
2. Multiplication of two matrices is defined ⇔ the number of columns of the left matrix is the same as the number of rows of the right matrix.
3. A matrix is invertible ⇔ its determinant is nonzero.
4. A triangle has three equal sides ⇔ it has three equal angles.
5. A number is divisible by 9 ⇔ the sum of its digits is divisible by 9.
6. A real number is rational ⇔ its decimal expansion is terminating or repeating.
7. A natural number is divisible by 2 ⇔ the digit in its unit’s place is either 0, 2, 4, 6, or 8.
8. A natural number is divisible by 3 ⇔ the number obtained by adding its digits is divisible by 3.

### Exercise 9. Translate the following sentences into English.

1. Jeśli trójkąt jest równoboczny, to wszystkie jego kąty mierzą po 60°. Jeśli wszystkie kąty trójkąta mierzą po 60°, to trójkąt ten jest równoboczny.
2. Jeśli mnożenie dwóch macierzy jest zdefiniowane, to liczba kolumn w lewej macierzy jest taka sama, jak liczba wierszy w prawej macierzy. Jeśli liczba kolumn w lewej macierzy jest taka sama, jak liczba wierszy w prawej macierzy, to zdefiniowane jest mnożenie tych macierzy.
3. Jeśli macierz jest odwracalna, to jej wyznacznik jest niezerowy. Jeśli wyznacznik macierzy jest różny od zera, to macierz ta jest odwracalna.
4. Jeśli trójkąt ma trzy równe boki, to ma też trzy równe kąty. Jeśli trójkąt ma trzy równe kąty, to ma też trzy równe boki.
5. Jeśli liczba jest podzielna przez 9, to suma jej cyfr jest podzielna przez 9. Jeśli suma cyfr liczby jest podzielna przez 9, to liczba ta jest podzielna przez 9.
6. Jeśli liczba rzeczywista jest wymierna, to jej rozwinięcie dziesiętne jest skończone lub okresowe. Jeśli rozwinięcie dziesiętne liczby rzeczywistej jest skończone lub okresowe, to jest to liczba rzeczywista. Jeśli liczba jest rzeczywista, to jej rozwinięcie dziesiętne jest skończone lub okresowe.
7. Liczba naturalna jest podzielna przez 2, jeśli na pozycji jednostek zawiera cyfrę 0, 2, 4, 6 lub 8. Jeśli na pozycji jednostek liczba naturalna zawiera cyfrę 0, 2, 4, 6 lub 8, to jest ona podzielna przez 2.
8. Jeśli liczba naturalna jest podzielna przez 3, to suma wartości jej cyfr jest podzielna przez 3. Jeśli suma wartości cyfr liczby naturalnej wynosi 3, to liczba ta jest podzielna przez 3.

### Exercise 10. Look at the matrices below and say some sentences about their multiplication following the example. Can you multiply the matrices?

A = $\left[\begin{array}{cccc}1& 2& 3& 4\\ 5& 6& 7& 8\\ 9& 10& 11& 12\end{array}\right]$,B = $\left[\begin{array}{ccccc}13& 14& 15& 16& 17\\ 18& 19& 20& 21& 22\\ 23& 24& 25& 26& 27\\ 28& 29& 30& 31& 32\end{array}\right]$

Przykład: For multiplication of the matrix A by the matrix B, the element A1,1, having the value 1, corresponds to the element B1,1, having the value 13.

### Exercise 11. Write down several operations from the previous exercise as shown in the example and read them aloud.

1 × 13 + 2 × 18 + 3 × 23 + 4 × 28 = 13 + 36 + 69 + 112 = 230 -> 1 times thirteen plus 2 times eighteen plus 3 times twenty three plus four times twenty eight is equal to thirteen plus thirty six plus sixty nine plus one hundred and twelve is equal to two hundred and thirty

### Exercise 12. Read the following conditional statements aloud following in the example.

x ≥ y ⇒ x + z ≥ y + z -> if x is greater than or equal to y, then x + z is greater than or equal to y + z

1. x ≥ 0, y ≥ 0 ⇒ xy ≥ 0
2. z ≥ 0 ⇒ z + 8 ≥ 0
3. x > 0 ⇒ x + 1 > 0
4. p ≤ 4 ⇒ p − 4 ≠ 4
5. a ≠ 0 ⇒ a × 10 ≠ 0
6. x = 3 ⇒ x + 7 = 10
7. b ≥ 2 ⇒ b × 6 ≥ 12
8. z ≠ 7 ⇒ z + 7 ≠ 14
9. x > 4 ⇒ x + 3 > 7
10. q ≤ 12 ⇒ q − 8 ≠ 5

### Exercise 14. Watch the following video and answer the questions below.

1. What is the subject of the video?
2. What three sample items does the author present at the beginning?
3. What is a matrix?
4. What do you do with the numbers that are in front of xs and ys?
5. What are constants?
6. How are constants represented in a matrix?
7. What is the first step in solving a system of linear equations using a matrix?
8. What is the second step?
9. How did she compute the value of x?
10. How did she compute the value of y?
11. What is the solution of the sample system of linear equations?
12. Use the method described in the video to solve the following system of linear equations:
A = $\left\{\begin{array}{c}2x – 3y = –2\\ 4x + y = 24\end{array}$

## Źródła:

Treść tej strony dostępna jest na zasadach licencji CC BY 3.0

## Zobacz również:

Autor: Łukasz Piwko

Tłumacz angielskiej i francuskiej literatury specjalistycznej, nauczyciel, wykładowca i maniak technologii programistycznych. Interesuje go wszystko, co związane z programowaniem i tłumaczeniem tekstów na ten temat na język polski. W wolnym czasie czyta Balzaka, słucha muzyki i trenuje karate.