How to organize, add and multiply matrices - Bill Shillito

541,375 views ・ 2013-03-04

TED-Ed


Please double-click on the English subtitles below to play the video.

00:00
Translator: Andrea McDonough Reviewer: Bedirhan Cinar
0
0
7000
00:14
By now, I'm sure you know
1
14020
1548
00:15
that in just about anything you do in life,
2
15568
1972
00:17
you need numbers.
3
17540
1706
00:19
In particular, though,
4
19246
1027
00:20
some fields don't just need a few numbers,
5
20273
2229
00:22
they need lots of them.
6
22502
1720
00:24
How do you keep track of all those numbers?
7
24222
2026
00:26
Well, mathematicians dating back
8
26248
1916
00:28
as early as ancient China
9
28164
1965
00:30
came up with a way to represent
10
30129
1442
00:31
arrays of many numbers at once.
11
31571
2577
00:34
Nowadays we call such an array a "matrix,"
12
34148
3174
00:37
and many of them hanging out together, "matrices".
13
37322
2737
00:40
Matrices are everywhere.
14
40059
2561
00:42
They are all around us,
15
42620
1935
00:44
even now in this very room.
16
44555
3336
00:47
Sorry, let's get back on track.
17
47891
1893
00:49
Matrices really are everywhere, though.
18
49784
1978
00:51
They are used in business,
19
51762
1311
00:53
economics,
20
53073
1125
00:54
cryptography,
21
54198
790
00:54
physics,
22
54988
1210
00:56
electronics,
23
56198
1103
00:57
and computer graphics.
24
57301
1968
00:59
One reason matrices are so cool
25
59269
2268
01:01
is that we can pack so much information into them
26
61537
2777
01:04
and then turn a huge series of different problems
27
64314
2274
01:06
into one single problem.
28
66588
2963
01:09
So, to use matrices, we need to learn how they work.
29
69551
3711
01:13
It turns out, you can treat matrices
30
73262
1910
01:15
just like regular numbers.
31
75172
1510
01:16
You can add them,
32
76682
627
01:17
subtract them,
33
77309
729
01:18
even multiply them.
34
78038
1660
01:19
You can't divide them,
35
79698
1217
01:20
but that's a rabbit hole of its own.
36
80915
1975
01:22
Adding matrices is pretty simple.
37
82890
2082
01:24
All you have to do is add the corresponding entries
38
84972
2223
01:27
in the order they come.
39
87195
1402
01:28
So the first entries get added together,
40
88597
1860
01:30
the second entries,
41
90457
819
01:31
the third,
42
91276
687
01:31
all the way down.
43
91963
1531
01:33
Of course, your matrices have to be the same size,
44
93494
2246
01:35
but that's pretty intuitive anyway.
45
95740
2077
01:37
You can also multiply the whole matrix
46
97817
2044
01:39
by a number, called a scalar.
47
99861
2346
01:42
Just multiply every entry by that number.
48
102207
2976
01:45
But wait, there's more!
49
105183
1990
01:47
You can actually multiply one matrix by another matrix.
50
107173
4200
01:51
It's not like adding them, though,
51
111373
1224
01:52
where you do it entry by entry.
52
112597
1589
01:54
It's more unique
53
114186
1210
01:55
and pretty cool once you get the hang of it.
54
115396
2070
01:57
Here's how it works.
55
117466
1150
01:58
Let's say you have two matrices.
56
118616
2437
02:01
Let's make them both two by two,
57
121053
1788
02:02
meaning two rows by two columns.
58
122841
2544
02:05
Write the first matrix to the left
59
125385
2205
02:07
and the second matrix goes next to it
60
127590
1885
02:09
and translated up a bit,
61
129475
1310
02:10
kind of like we are making a table.
62
130785
1791
02:12
The product we get when we multiply the matrices together
63
132576
2825
02:15
will go right between them.
64
135401
1496
02:16
We'll also draw some gridlines to help us along.
65
136897
3744
02:20
Now, look at the first row of the first matrix
66
140641
3562
02:24
and the first column of the second matrix.
67
144203
2748
02:26
See how there's two numbers in each?
68
146951
2011
02:28
Multiply the first number in the row
69
148962
2457
02:31
by the first number in the column:
70
151419
2331
02:33
1 times 2 is 2.
71
153750
2180
02:35
Now do the next ones:
72
155930
1617
02:37
3 times 3 is 9.
73
157547
1922
02:39
Now add them up:
74
159469
1571
02:41
2 plus 9 is 11.
75
161040
2411
02:43
Let's put that number in the top-left position
76
163451
2587
02:46
so that it matches up with the rows and columns
77
166038
2015
02:48
we used to get it.
78
168053
1255
02:49
See how that works?
79
169308
1417
02:50
You can do the same thing to get the other entries.
80
170725
2844
02:53
-4 plus 0 is -4.
81
173569
4009
02:57
4 plus -3 is 1.
82
177578
3961
03:01
-8 plus 0 is -8.
83
181539
3608
03:05
So, here's your answer.
84
185147
2236
03:07
Not all that bad, is it?
85
187383
1835
03:09
There's one catch, though.
86
189218
1699
03:10
Just like with addition,
87
190917
1588
03:12
your matrices have to be the right size.
88
192505
2760
03:15
Look at these two matrices.
89
195265
2662
03:17
2 times 8 is 16.
90
197927
2761
03:20
3 times 4 is 12.
91
200688
2746
03:23
3 times
92
203434
1675
03:25
wait a minute,
93
205109
1698
03:26
there are no more rows in the second matrix.
94
206807
2069
03:28
We ran out of room.
95
208876
1452
03:30
So, these matrices can't be multiplied.
96
210328
2908
03:33
The number of columns in the first matrix
97
213236
2721
03:35
has to be the same as the number of rows in the second matrix.
98
215957
3552
03:39
As long as you're careful
99
219509
1013
03:40
to match up your dimensions right, though,
100
220538
1847
03:42
it's pretty easy.
101
222385
1302
03:43
Understanding matrix multiplication
102
223687
1812
03:45
is just the beginning, by the way.
103
225499
1491
03:46
There's so much you can do with them.
104
226990
1707
03:48
For example, let's say you want
105
228697
1802
03:50
to encrypt a secret message.
106
230499
1922
03:52
Let's say it's "Math rules".
107
232421
2167
03:54
Though, why anybody would want to keep this a secret
108
234588
2329
03:56
is beyond me.
109
236917
1366
03:58
Letting numbers stand for letters,
110
238283
1358
03:59
you can put the numbers in a matrix
111
239641
1719
04:01
and then an encryption key in another.
112
241360
2544
04:03
Multiply them together
113
243904
881
04:04
and you've got a new encoded matrix.
114
244785
2333
04:07
The only way to decode the new matrix
115
247118
2229
04:09
and read the message
116
249347
1173
04:10
is to have the key,
117
250520
1608
04:12
that second matrix.
118
252128
1808
04:13
There's even a branch of mathematics
119
253936
1436
04:15
that uses matrices constantly,
120
255372
1858
04:17
called Linear Algebra.
121
257230
1646
04:18
If you ever get a chance to study Linear Algebra,
122
258876
2254
04:21
do it, it's pretty awesome.
123
261130
1836
04:22
But just remember,
124
262966
1386
04:24
once you know how to use matrices,
125
264352
2087
04:26
you can do pretty much anything.
126
266439
2454
About this website

This site will introduce you to YouTube videos that are useful for learning English. You will see English lessons taught by top-notch teachers from around the world. Double-click on the English subtitles displayed on each video page to play the video from there. The subtitles scroll in sync with the video playback. If you have any comments or requests, please contact us using this contact form.

https://forms.gle/WvT1wiN1qDtmnspy7