-
Notifications
You must be signed in to change notification settings - Fork 51
/
L07LinearTransformations.html~
767 lines (613 loc) · 43 KB
/
L07LinearTransformations.html~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
<!DOCTYPE html>
<html lang="en" data-content_root="" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>Linear Transformations — Linear Algebra, Geometry, and Computation</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "light";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=5b4479735964841361fd" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=5b4479735964841361fd" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=5b4479735964841361fd" rel="stylesheet" />
<link href="_static/vendor/fontawesome/6.1.2/css/all.min.css?digest=5b4479735964841361fd" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.1.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=14f4ca6b54d191a8c7657f6c759bf11a5fb86285" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
<link rel="stylesheet" type="text/css" href="_static/design-style.4045f2051d55cab465a707391d5b2007.min.css" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=5b4479735964841361fd" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=5b4479735964841361fd" />
<script src="_static/vendor/fontawesome/6.1.2/js/all.min.js?digest=5b4479735964841361fd"></script>
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/scripts/sphinx-book-theme.js?digest=5a5c038af52cf7bc1a1ec88eea08e6366ee68824"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="_static/togglebutton.js"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="_static/design-tabs.js"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"
const thebe_selector = ".thebe,.cell"
const thebe_selector_input = "pre"
const thebe_selector_output = ".output, .cell_output"
</script>
<script async="async" src="_static/sphinx-thebe.js"></script>
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'L07LinearTransformations';</script>
<link rel="shortcut icon" href="_static/DiagramAR-icon.png"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="The Matrix of a Linear Transformation" href="L08MatrixofLinearTranformation.html" />
<link rel="prev" title="Linear Independence" href="L06LinearIndependence.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<a class="skip-link" href="#main-content">Skip to main content</a>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>
Back to top
</button>
<input type="checkbox"
class="sidebar-toggle"
name="__primary"
id="__primary"/>
<label class="overlay overlay-primary" for="__primary"></label>
<input type="checkbox"
class="sidebar-toggle"
name="__secondary"
id="__secondary"/>
<label class="overlay overlay-secondary" for="__secondary"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search this book..."
aria-label="Search this book..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<nav class="bd-header navbar navbar-expand-lg bd-navbar">
</nav>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="landing-page.html">
<img src="_static/DiagramAR-icon.png" class="logo__image only-light" alt="Linear Algebra, Geometry, and Computation - Home"/>
<script>document.write(`<img src="_static/DiagramAR-icon.png" class="logo__image only-dark" alt="Linear Algebra, Geometry, and Computation - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item"><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="landing-page.html">
Preface
</a>
</li>
</ul>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="L01LinearEquations.html">Linear Equations</a></li>
<li class="toctree-l1"><a class="reference internal" href="L02Numerics.html">(Getting Serious About) Numbers</a></li>
<li class="toctree-l1"><a class="reference internal" href="L03RowReductions.html">Gaussian Elimination</a></li>
<li class="toctree-l1"><a class="reference internal" href="L04VectorEquations.html">Vector Equations</a></li>
<li class="toctree-l1"><a class="reference internal" href="L05Axb.html"><span class="math notranslate nohighlight">\(A{\bf x} = {\bf b}\)</span></a></li>
<li class="toctree-l1"><a class="reference internal" href="L06LinearIndependence.html">Linear Independence</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Linear Transformations</a></li>
<li class="toctree-l1"><a class="reference internal" href="L08MatrixofLinearTranformation.html">The Matrix of a Linear Transformation</a></li>
<li class="toctree-l1"><a class="reference internal" href="L09MatrixOperations.html">Matrix Algebra</a></li>
<li class="toctree-l1"><a class="reference internal" href="L10MatrixInverse.html">The Inverse of a Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="L11MarkovChains.html">Markov Chains</a></li>
<li class="toctree-l1"><a class="reference internal" href="L12MatrixFactorizations.html">Matrix Factorizations</a></li>
<li class="toctree-l1"><a class="reference internal" href="L13ComputerGraphics.html">Computer Graphics</a></li>
<li class="toctree-l1"><a class="reference internal" href="L14Subspaces.html">Subspaces</a></li>
<li class="toctree-l1"><a class="reference internal" href="L15DimensionRank.html">Dimension and Rank</a></li>
<li class="toctree-l1"><a class="reference internal" href="L16Eigenvectors.html">Eigenvectors and Eigenvalues</a></li>
<li class="toctree-l1"><a class="reference internal" href="L17CharacteristicEqn.html">The Characteristic Equation</a></li>
<li class="toctree-l1"><a class="reference internal" href="L18Diagonalization.html">Diagonalization</a></li>
<li class="toctree-l1"><a class="reference internal" href="L19PageRank.html">PageRank</a></li>
<li class="toctree-l1"><a class="reference internal" href="L20Orthogonality.html">Analytic Geometry in <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span></a></li>
<li class="toctree-l1"><a class="reference internal" href="L21OrthogonalSets.html">Orthogonal Sets and Projection</a></li>
<li class="toctree-l1"><a class="reference internal" href="L22LeastSquares.html">Least Squares</a></li>
<li class="toctree-l1"><a class="reference internal" href="L23LinearModels.html">Linear Models</a></li>
<li class="toctree-l1"><a class="reference internal" href="L24SymmetricMatrices.html">Symmetric Matrices</a></li>
<li class="toctree-l1"><a class="reference internal" href="L25SVD.html">The Singular Value Decomposition</a></li>
<li class="toctree-l1"><a class="reference internal" href="L26ApplicationsOfSVD.html">Applications of the SVD</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><label class="sidebar-toggle primary-toggle btn btn-sm" for="__primary" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</label></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<a href="https://github.com/mcrovella/CS132-Geometric-Algorithms" target="_blank"
class="btn btn-sm btn-source-repository-button"
title="Source repository"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fab fa-github"></i>
</span>
</a>
<div class="dropdown dropdown-download-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<ul class="dropdown-menu">
<li><a href="_sources/L07LinearTransformations.ipynb" target="_blank"
class="btn btn-sm btn-download-source-button dropdown-item"
title="Download source file"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="btn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="window.print()"
class="btn btn-sm btn-download-pdf-button dropdown-item"
title="Print to PDF"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm navbar-btn theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="theme-switch nav-link" data-mode="light"><i class="fa-solid fa-sun fa-lg"></i></span>
<span class="theme-switch nav-link" data-mode="dark"><i class="fa-solid fa-moon fa-lg"></i></span>
<span class="theme-switch nav-link" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg"></i></span>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm navbar-btn search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
<label class="sidebar-toggle secondary-toggle btn btn-sm" for="__secondary"title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</label>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1>Linear Transformations</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> Contents </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#transformations">Transformations</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">Linear Transformations</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#properties-of-linear-transformations">Properties of Linear Transformations</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#a-non-geometric-example-manufacturing">A Non-Geometric Example: Manufacturing</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article" role="main">
<section class="tex2jax_ignore mathjax_ignore" id="linear-transformations">
<h1>Linear Transformations<a class="headerlink" href="#linear-transformations" title="Permalink to this heading">#</a></h1>
<p>So far we’ve been treating the matrix equation</p>
<div class="math notranslate nohighlight">
\[ A{\bf x} = {\bf b}\]</div>
<p>as simply another way of writing the vector equation</p>
<div class="math notranslate nohighlight">
\[ x_1{\bf a_1} + \dots + x_n{\bf a_n} = {\bf b}.\]</div>
<p>However, we’ll now think of the matrix equation in a new way:</p>
<p>We will think of <span class="math notranslate nohighlight">\(A\)</span> as <font color=blue>”acting on” the vector <span class="math notranslate nohighlight">\({\bf x}\)</span></font> to create a <font color=blue>new vector <span class="math notranslate nohighlight">\({\bf b}\)</span>.</font></p>
<p>For example, let’s let <span class="math notranslate nohighlight">\(A = \left[\begin{array}{rrr}2&1&1\\3&1&-1\end{array}\right].\)</span> Then we find:</p>
<div class="math notranslate nohighlight">
\[\begin{split} A \left[\begin{array}{r}1\\-4\\-3\end{array}\right] = \left[\begin{array}{r}-5\\2\end{array}\right] \end{split}\]</div>
<p>In other words, if <span class="math notranslate nohighlight">\({\bf x} = \left[\begin{array}{r}1\\-4\\-3\end{array}\right]\)</span> and <span class="math notranslate nohighlight">\({\bf b} = \left[\begin{array}{r}-5\\2\end{array}\right]\)</span>, then <span class="math notranslate nohighlight">\(A\)</span> <em>transforms</em> <span class="math notranslate nohighlight">\({\bf x}\)</span> into <span class="math notranslate nohighlight">\({\bf b}\)</span>.</p>
<div class="cell tag_remove-input docutils container">
<div class="cell_output docutils container">
<img alt="_images/c336897a1dcad813a279fdb1769e97288d9c756e94a2b59b37ca464a624afeeb.jpg" src="_images/c336897a1dcad813a279fdb1769e97288d9c756e94a2b59b37ca464a624afeeb.jpg" />
</div>
</div>
<p>Notice what <span class="math notranslate nohighlight">\(A\)</span> has done: it took a vector in <span class="math notranslate nohighlight">\(\mathbb{R}^3\)</span> and transformed it into a vector in <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span>.</p>
<p>How does this fact relate to the shape of <span class="math notranslate nohighlight">\(A\)</span>?</p>
<p><span class="math notranslate nohighlight">\(A\)</span> is <span class="math notranslate nohighlight">\(2 \times 3\)</span> — that is, <span class="math notranslate nohighlight">\(A \in \mathbb{R}^{2\times 3}\)</span>.</p>
<p>This gives a <strong>new</strong> way of thinking about solving <span class="math notranslate nohighlight">\(A{\bf x} = {\bf b}\)</span>.</p>
<p>To solve <span class="math notranslate nohighlight">\(A{\bf x} = {\bf b}\)</span>, we much “search for” the vector(s) <span class="math notranslate nohighlight">\({\bf x}\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^3\)</span> that are transformed into <span class="math notranslate nohighlight">\({\bf b}\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span> under the “action” of <span class="math notranslate nohighlight">\(A\)</span>.</p>
<p>For a different <span class="math notranslate nohighlight">\(A\)</span>, the mapping might be from <span class="math notranslate nohighlight">\(\mathbb{R}^1\)</span> to <span class="math notranslate nohighlight">\(\mathbb{R}^3\)</span>:</p>
<div class="cell tag_remove-input docutils container">
<div class="cell_output docutils container">
<img alt="_images/5cfef36ce6f07c000b74bbfa1743ed807e7c38b404c1053fe75ac75e9384021c.jpg" src="_images/5cfef36ce6f07c000b74bbfa1743ed807e7c38b404c1053fe75ac75e9384021c.jpg" />
</div>
</div>
<p>What would the shape of <span class="math notranslate nohighlight">\(A\)</span> be in the above case?</p>
<p>Since <span class="math notranslate nohighlight">\(A\)</span> maps from <span class="math notranslate nohighlight">\(\mathbb{R}^1\)</span> to <span class="math notranslate nohighlight">\(\mathbb{R}^3\)</span>, <span class="math notranslate nohighlight">\(A \in \mathbb{R}^{3\times 1}\)</span>.</p>
<p>That is, <span class="math notranslate nohighlight">\(A\)</span> has 3 rows and 1 column.</p>
<p>In another case, <span class="math notranslate nohighlight">\(A\)</span> could be a square <span class="math notranslate nohighlight">\(2\times 2\)</span> matrix.</p>
<p>Then, it would map from <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span> to <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span>:</p>
<div class="cell tag_remove-input docutils container">
<div class="cell_output docutils container">
<img alt="_images/f974c236358b705c5ec8c0c77ac6559e844b38534fd2781cf8a71e0d999e60c7.jpg" src="_images/f974c236358b705c5ec8c0c77ac6559e844b38534fd2781cf8a71e0d999e60c7.jpg" />
</div>
</div>
<p>We have moved out of the familiar world of functions of one variable: we are now thinking about <font color = blue>functions that transform a vector into a vector.</font></p>
<p>Or, put another way, functions that transform multiple variables into multiple variables.</p>
<section id="transformations">
<h2>Transformations<a class="headerlink" href="#transformations" title="Permalink to this heading">#</a></h2>
<p>Some terminology:</p>
<p>A <strong>transformation</strong> (or <strong>function</strong> or <strong>mapping</strong>) <span class="math notranslate nohighlight">\(T\)</span> from <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span> to <span class="math notranslate nohighlight">\(\mathbb{R}^m\)</span> is a rule that assigns to each vector <span class="math notranslate nohighlight">\({\bf x}\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span> a vector <span class="math notranslate nohighlight">\(T({\bf x})\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^m\)</span>.</p>
<p>The set <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span> is called the <strong>domain</strong> of <span class="math notranslate nohighlight">\(T\)</span>, and <span class="math notranslate nohighlight">\(\mathbb{R}^m\)</span> is called the <strong>codomain</strong> of <span class="math notranslate nohighlight">\(T\)</span>.</p>
<p>The notation:</p>
<div class="math notranslate nohighlight">
\[ T: \mathbb{R}^n \rightarrow \mathbb{R}^m\]</div>
<p>indicates that the domain of <span class="math notranslate nohighlight">\(T\)</span> is <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span> and the codomain is <span class="math notranslate nohighlight">\(\mathbb{R}^m\)</span>.</p>
<p>For <span class="math notranslate nohighlight">\(\bf x\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^n,\)</span> the vector <span class="math notranslate nohighlight">\(T({\bf x})\)</span> is called the <strong>image</strong> of <span class="math notranslate nohighlight">\(\bf x\)</span> (under <span class="math notranslate nohighlight">\(T\)</span>).</p>
<p>The set of all images <span class="math notranslate nohighlight">\(T({\bf x})\)</span> is called the <strong>range</strong> of <span class="math notranslate nohighlight">\(T\)</span>.</p>
<div class="cell tag_remove-input docutils container">
<div class="cell_output docutils container">
<img alt="_images/6cc84d7076ff2ad84485b62de3da2a4016f1743faf03d7219e5a91c109682608.jpg" src="_images/6cc84d7076ff2ad84485b62de3da2a4016f1743faf03d7219e5a91c109682608.jpg" />
</div>
</div>
<p>Here, the green plane is the set of all points that are possible outputs of <span class="math notranslate nohighlight">\(T\)</span> for some input <span class="math notranslate nohighlight">\(\mathbf{x}\)</span>.</p>
<p>So in this example:</p>
<ul class="simple">
<li><p>The <strong>domain</strong> of <span class="math notranslate nohighlight">\(T\)</span> is <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span></p></li>
<li><p>The <strong>codomain</strong> of <span class="math notranslate nohighlight">\(T\)</span> is <span class="math notranslate nohighlight">\(\mathbb{R}^3\)</span></p></li>
<li><p>The <strong>range</strong> of <span class="math notranslate nohighlight">\(T\)</span> is the green plane.</p></li>
</ul>
<p>Let’s do an example. Let’s say I have these points in <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span>:</p>
<div class="math notranslate nohighlight">
\[\begin{split} \left[\begin{array}{r}0\\1\end{array}\right],\left[\begin{array}{r}1\\1\end{array}\right],\left[\begin{array}{r}1\\0\end{array}\right],\left[\begin{array}{r}0\\0\end{array}\right]\end{split}\]</div>
<p>Where are these points located?</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">square</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span>
<span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]])</span>
<span class="n">dm</span><span class="o">.</span><span class="n">plotSetup</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="n">square</span><span class="p">)</span>
<span class="n">dm</span><span class="o">.</span><span class="n">plotSquare</span><span class="p">(</span><span class="n">square</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>[[0 1 1 0]
[1 1 0 0]]
</pre></div>
</div>
<img alt="_images/0cdbd56e9a4e244999340d018e3dd8de777322b9ad73085e630f8aa8a150a0c8.png" src="_images/0cdbd56e9a4e244999340d018e3dd8de777322b9ad73085e630f8aa8a150a0c8.png" />
</div>
</div>
<p>Now let’s transform each of these points according to the following rule. Let</p>
<div class="math notranslate nohighlight">
\[\begin{split} A = \left[\begin{array}{rr}1&1.5\\0&1\end{array}\right]. \end{split}\]</div>
<p>We define <span class="math notranslate nohighlight">\(T({\bf x}) = A{\bf x}\)</span>. Then we have</p>
<div class="math notranslate nohighlight">
\[ T: \mathbb{R}^2 \rightarrow \mathbb{R}^2.\]</div>
<p>What is the image of each of these points under <span class="math notranslate nohighlight">\(T\)</span>?</p>
<div class="math notranslate nohighlight">
\[\begin{split} A\left[\begin{array}{r}0\\1\end{array}\right] = \left[\begin{array}{r}1.5\\1\end{array}\right]\end{split}\]</div>
<div class="math notranslate nohighlight">
\[\begin{split} A\left[\begin{array}{r}1\\1\end{array}\right] = \left[\begin{array}{r}2.5\\1\end{array}\right]\end{split}\]</div>
<div class="math notranslate nohighlight">
\[\begin{split} A\left[\begin{array}{r}1\\0\end{array}\right] = \left[\begin{array}{r}1\\0\end{array}\right]\end{split}\]</div>
<div class="math notranslate nohighlight">
\[\begin{split} A\left[\begin{array}{r}0\\0\end{array}\right] = \left[\begin{array}{r}0\\0\end{array}\right]\end{split}\]</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="n">ax</span> <span class="o">=</span> <span class="n">dm</span><span class="o">.</span><span class="n">plotSetup</span><span class="p">()</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"square = "</span><span class="p">);</span> <span class="nb">print</span><span class="p">(</span><span class="n">square</span><span class="p">)</span>
<span class="n">dm</span><span class="o">.</span><span class="n">plotSquare</span><span class="p">(</span><span class="n">square</span><span class="p">)</span>
<span class="c1">#</span>
<span class="c1"># create the A matrix</span>
<span class="n">A</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mf">1.0</span><span class="p">,</span> <span class="mf">1.5</span><span class="p">],[</span><span class="mf">0.0</span><span class="p">,</span><span class="mf">1.0</span><span class="p">]])</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"A matrix = "</span><span class="p">);</span> <span class="nb">print</span><span class="p">(</span><span class="n">A</span><span class="p">)</span>
<span class="c1">#</span>
<span class="c1"># apply the shear matrix to the square</span>
<span class="n">ssquare</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">shape</span><span class="p">(</span><span class="n">square</span><span class="p">))</span>
<span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">4</span><span class="p">):</span>
<span class="n">ssquare</span><span class="p">[:,</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">dm</span><span class="o">.</span><span class="n">AxVS</span><span class="p">(</span><span class="n">A</span><span class="p">,</span><span class="n">square</span><span class="p">[:,</span><span class="n">i</span><span class="p">])</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">"transformed square = "</span><span class="p">);</span> <span class="nb">print</span><span class="p">(</span><span class="n">ssquare</span><span class="p">)</span>
<span class="n">dm</span><span class="o">.</span><span class="n">plotSquare</span><span class="p">(</span><span class="n">ssquare</span><span class="p">,</span><span class="s1">'r'</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>square =
[[0 1 1 0]
[1 1 0 0]]
A matrix =
[[1. 1.5]
[0. 1. ]]
transformed square =
[[1.5 2.5 1. 0. ]
[1. 1. 0. 0. ]]
</pre></div>
</div>
<img alt="_images/471f09529da14265f4b2abb54d6d36183f29b122ac2a5a3f9d5ae376ee3dadf6.png" src="_images/471f09529da14265f4b2abb54d6d36183f29b122ac2a5a3f9d5ae376ee3dadf6.png" />
</div>
</div>
<p>This sort of transformation, where points are successively slid sideways, is called a <strong>shear</strong> transformation.</p>
</section>
<section id="id1">
<h2>Linear Transformations<a class="headerlink" href="#id1" title="Permalink to this heading">#</a></h2>
<p>By the properties of matrix-vector multiplication, we know that the transformation <span class="math notranslate nohighlight">\({\bf x} \mapsto A{\bf x}\)</span> has the properties that</p>
<div class="math notranslate nohighlight">
\[ A({\bf u} + {\bf v}) = A{\bf u} + A{\bf v} \;\;\;\mbox{and}\;\;\; A(c{\bf u}) = cA{\bf u}\]</div>
<p>for all <span class="math notranslate nohighlight">\(\bf u, v\)</span> in <span class="math notranslate nohighlight">\(\mathbb{R}^n\)</span> and all scalars <span class="math notranslate nohighlight">\(c\)</span>.</p>
<p>We are now ready to define one of the most fundamental concepts in the course:
the concept of a
<font color=blue><strong>linear transformation.</strong></font></p>
<p>(You are now finding out why the subject is called linear algebra!)</p>
<p><strong>Definition.</strong> A transformation <span class="math notranslate nohighlight">\(T\)</span> is <strong>linear</strong> if:</p>
<ol class="arabic simple">
<li><p><span class="math notranslate nohighlight">\(T({\bf u} + {\bf v}) = T({\bf u}) + T({\bf v}) \;\;\;\)</span> for all <span class="math notranslate nohighlight">\(\bf u, v\)</span> in the domain of <span class="math notranslate nohighlight">\(T\)</span>; and</p></li>
<li><p><span class="math notranslate nohighlight">\(T(c{\bf u}) = cT({\bf u}) \;\;\;\)</span> for all scalars <span class="math notranslate nohighlight">\(c\)</span> and all <span class="math notranslate nohighlight">\(\bf u\)</span> in the domain of <span class="math notranslate nohighlight">\(T\)</span>.</p></li>
</ol>
<p>To fully grasp the significance of what a linear transformation is, don’t think of just matrix-vector multiplication. Think of <span class="math notranslate nohighlight">\(T\)</span> as a function in more general terms.</p>
<p>The definition above captures a <em>lot</em> of transformations that are not matrix-vector multiplication. For example, think of:</p>
<div class="math notranslate nohighlight">
\[ T(f) = \int_0^1 f(t) \,dt \]</div>
<p>Is <span class="math notranslate nohighlight">\(T\)</span> a linear transformation?</p>
<p>Checking the conditions of our definition:</p>
<div class="math notranslate nohighlight">
\[ T(f + g) = T(f) + T(g) \]</div>
<p>in other words:</p>
<div class="math notranslate nohighlight">
\[ \int_0^1 f(t) + g(t) \,dt = \int_0^1 f(t) \,dt + \int_0^1 g(t) \,dt\]</div>
<p>and also:</p>
<div class="math notranslate nohighlight">
\[ T(c \cdot f) = c \cdot T(f) \]</div>
<p>(check that yourself)</p>
<p>What about:</p>
<div class="math notranslate nohighlight">
\[ T(f) = \frac{d f(t)}{dt} \]</div>
<p>Is <span class="math notranslate nohighlight">\(T\)</span> a linear transformation?</p>
<p>What about:</p>
<div class="math notranslate nohighlight">
\[ T(x) = e^x \]</div>
<p>Is <span class="math notranslate nohighlight">\(T\)</span> a linear transformation?</p>
</section>
<section id="properties-of-linear-transformations">
<h2>Properties of Linear Transformations<a class="headerlink" href="#properties-of-linear-transformations" title="Permalink to this heading">#</a></h2>
<p>A key aspect of a linear transformation is that it <strong>preserves the operations of vector addition and scalar multiplication.</strong></p>
<p>For example: for vectors <span class="math notranslate nohighlight">\(\mathbf{u}\)</span> and <span class="math notranslate nohighlight">\(\mathbf{v}\)</span>, one can either:</p>
<ol class="arabic simple">
<li><p>Transform them both according to <span class="math notranslate nohighlight">\(T()\)</span>, then add them, or:</p></li>
<li><p>Add them, and then transform the result according to <span class="math notranslate nohighlight">\(T()\)</span>.</p></li>
</ol>
<p>One gets the same result either way. The transformation does not affect the addition.</p>
<p>This leads to two important facts.</p>
<p>If <span class="math notranslate nohighlight">\(T\)</span> is a linear transformation, then</p>
<div class="math notranslate nohighlight">
\[ T({\mathbf 0}) = {\mathbf 0} \]</div>
<p>and</p>
<div class="math notranslate nohighlight">
\[ T(c\mathbf{u} + d\mathbf{v}) = cT(\mathbf{u}) + dT(\mathbf{v}) \]</div>
<p>In fact, if a transformation satisfies the second equation for all <span class="math notranslate nohighlight">\(\mathbf{u}, \mathbf{v}\)</span> and <span class="math notranslate nohighlight">\(c, d,\)</span> then it must be a linear transformation.</p>
<p>Both of the rules defining a linear transformation derive from this single equation.</p>
<p><strong>Example.</strong></p>
<p>Given a scalar <span class="math notranslate nohighlight">\(r\)</span>, define <span class="math notranslate nohighlight">\(T: \mathbb{R}^2 \rightarrow \mathbb{R}^2\)</span> by <span class="math notranslate nohighlight">\(T(\mathbf{x}) = r\mathbf{x}\)</span>.</p>
<p>(<span class="math notranslate nohighlight">\(T\)</span> is called a <strong>contraction</strong> when <span class="math notranslate nohighlight">\(0\leq r \leq 1\)</span> and a <strong>dilation</strong> when <span class="math notranslate nohighlight">\(r > 1\)</span>.)</p>
<p>Let <span class="math notranslate nohighlight">\(r = 3\)</span>, and show that <span class="math notranslate nohighlight">\(T\)</span> is a linear transformation.</p>
<p><strong>Solution.</strong></p>
<p>Let <span class="math notranslate nohighlight">\(\mathbf{u}, \mathbf{v}\)</span> be in <span class="math notranslate nohighlight">\(\mathbb{R}^2\)</span> and let <span class="math notranslate nohighlight">\(c, d\)</span> be scalars. Then</p>
<div class="math notranslate nohighlight">
\[
T(c\mathbf{u} + d\mathbf{v}) = 3(c\mathbf{u} + d\mathbf{v})
\]</div>
<div class="math notranslate nohighlight">
\[ = 3c\mathbf{u} + 3d\mathbf{v} \]</div>
<div class="math notranslate nohighlight">
\[ = c(3\mathbf{u}) + d(3\mathbf{v}) \]</div>
<div class="math notranslate nohighlight">
\[ = cT(\mathbf{u}) + dT(\mathbf{v}) \]</div>
<p>Thus <span class="math notranslate nohighlight">\(T\)</span> is a linear transformation because it satisfies the rule <span class="math notranslate nohighlight">\(T(c\mathbf{u} + d\mathbf{v}) = cT(\mathbf{u}) + dT(\mathbf{v})\)</span>.</p>
<p><strong>Example.</strong></p>
<p>Let <span class="math notranslate nohighlight">\(T(\mathbf{x}) = \mathbf{x} + \mathbf{b}\)</span> for some <span class="math notranslate nohighlight">\(\mathbf{b} \neq 0\)</span>.</p>
<p>What sort of operation does <span class="math notranslate nohighlight">\(T\)</span> implement?</p>
<p>Answer: <strong>translation.</strong></p>
<p>Is <span class="math notranslate nohighlight">\(T\)</span> a linear transformation?</p>
<p><strong>Solution.</strong></p>
<p>We only need to compare</p>
<div class="math notranslate nohighlight">
\[T(\mathbf{u} + \mathbf{v})\]</div>
<p>to</p>
<div class="math notranslate nohighlight">
\[T(\mathbf{u}) + T(\mathbf{v}).\]</div>
<p>So:</p>
<div class="math notranslate nohighlight">
\[T(\mathbf{u} + \mathbf{v}) = \mathbf{u} + \mathbf{v} + \mathbf{b}\]</div>
<p>and</p>
<div class="math notranslate nohighlight">
\[T(\mathbf{u}) + T(\mathbf{v}) = (\mathbf{u} + \mathbf{b}) + (\mathbf{v} + \mathbf{b})\]</div>
<p>If <span class="math notranslate nohighlight">\(\mathbf{b} \neq 0\)</span>, then the above two expressions are not equal.</p>
<p>So <span class="math notranslate nohighlight">\(T\)</span> is <strong>not</strong> a linear transformation.</p>
<section id="a-non-geometric-example-manufacturing">
<h3>A Non-Geometric Example: Manufacturing<a class="headerlink" href="#a-non-geometric-example-manufacturing" title="Permalink to this heading">#</a></h3>
<p>A company manufactures two products, B and C. To do so, it requires materials, labor, and overhead.</p>
<p>For one dollar’s worth of product B, it spends 45 cents on materials, 25 cents on labor, and 15 cents on overhead.</p>
<p>For one dollar’s worth of product C, it spends 40 cents on materials, 30 cents on labor, and 15 cents on overhead.</p>
<p>Let us construct a “unit cost” matrix:</p>
<div class="math notranslate nohighlight">
\[\begin{split}U = \begin{array}{r}
\begin{array}{rrr}\mbox{B}&\;\;\;\;\mbox{C}\;&\;\;\;\;\;\;\;\;\;\;\;\end{array}\\
\left[\begin{array}{rr}.45&.40\\.25&.30\\.15&.15\end{array}\right]
\begin{array}{r}\mbox{Materials}\\\mbox{Labor}\\\mbox{Overhead}\end{array}\\
\end{array}\end{split}\]</div>
<p>Let <span class="math notranslate nohighlight">\(\mathbf{x} = \left[\begin{array}{r}x_1\\x_2\end{array}\right]\)</span> be a production vector, corresponding to <span class="math notranslate nohighlight">\(x_1\)</span> dollars of product B and <span class="math notranslate nohighlight">\(x_2\)</span> dollars of product C.</p>
<p>Then define <span class="math notranslate nohighlight">\(T: \mathbb{R}^2 \rightarrow \mathbb{R}^3\)</span> by</p>
<div class="math notranslate nohighlight">
\[T(\mathbf{x}) = U\mathbf{x} \]</div>
<div class="math notranslate nohighlight">
\[\begin{split} = x_1 \left[\begin{array}{r}.45\\.25\\.15\end{array}\right] + x_2 \left[\begin{array}{r}.40\\.30\\.15\end{array}\right]\end{split}\]</div>
<div class="math notranslate nohighlight">
\[\begin{split} = \left[\begin{array}{r}\mbox{Total cost of materials}\\\mbox{Total cost of labor}\\\mbox{Total cost of overhead}\end{array}\right]
\end{split}\]</div>
<p>The mapping <span class="math notranslate nohighlight">\(T\)</span> transforms a list of production quantities into a list of total costs.</p>
<p>The linearity of this mapping is reflected in two ways:</p>
<ol class="arabic simple">
<li><p>If production is increased by a factor of, say, 4, ie, from <span class="math notranslate nohighlight">\(\mathbf{x}\)</span> to <span class="math notranslate nohighlight">\(4\mathbf{x}\)</span>, then the costs increase by the same factor, from <span class="math notranslate nohighlight">\(T(\mathbf{x})\)</span> to <span class="math notranslate nohighlight">\(4T(\mathbf{x})\)</span>.</p></li>
<li><p>If <span class="math notranslate nohighlight">\(\mathbf{x}\)</span> and <span class="math notranslate nohighlight">\(\mathbf{y}\)</span> are production vectors, then the total cost vector associated with combined production of <span class="math notranslate nohighlight">\(\mathbf{x} + \mathbf{y}\)</span> is precisely the sum of the cost vectors <span class="math notranslate nohighlight">\(T(\mathbf{x})\)</span> and <span class="math notranslate nohighlight">\(T(\mathbf{y})\)</span>.</p></li>
</ol>
</section>
</section>
</section>
<script type="text/x-thebe-config">
{
requestKernel: true,
binderOptions: {
repo: "binder-examples/jupyter-stacks-datascience",
ref: "master",
},
codeMirrorConfig: {
theme: "abcdef",
mode: "python"
},
kernelOptions: {
name: "python3",
path: "./."
},
predefinedOutput: true
}
</script>
<script>kernelName = 'python3'</script>
</article>
<footer class="prev-next-footer">
<div class="prev-next-area">
<a class="left-prev"
href="L06LinearIndependence.html"
title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Linear Independence</p>
</div>
</a>
<a class="right-next"
href="L08MatrixofLinearTranformation.html"
title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">The Matrix of a Linear Transformation</p>
</div>
<i class="fa-solid fa-angle-right"></i>
</a>
</div>
</footer>
</div>
<div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage">
<i class="fa-solid fa-list"></i> Contents
</div>
<nav class="bd-toc-nav page-toc">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#transformations">Transformations</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#id1">Linear Transformations</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#properties-of-linear-transformations">Properties of Linear Transformations</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#a-non-geometric-example-manufacturing">A Non-Geometric Example: Manufacturing</a></li>
</ul>
</li>
</ul>
</nav></div>
</div></div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By Mark Crovella
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2020-2024.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="_static/scripts/bootstrap.js?digest=5b4479735964841361fd"></script>
<script src="_static/scripts/pydata-sphinx-theme.js?digest=5b4479735964841361fd"></script>
<footer class="bd-footer">
</footer>
</body>
</html>