-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGramSchmidtProcess.html
More file actions
681 lines (594 loc) · 126 KB
/
GramSchmidtProcess.html
File metadata and controls
681 lines (594 loc) · 126 KB
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
<!DOCTYPE html>
<!-- saved from url=(0102)https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#Matrices-in-Python -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GramSchmidtProcess</title>
<link rel="shortcut icon" type="image/x-icon" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/base/images/favicon.ico?v=97c6417ed01bdc0ae3ef32ae4894fd03">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="./GramSchmidtProcess_files/jquery-ui.min.css" type="text/css">
<link rel="stylesheet" href="./GramSchmidtProcess_files/jquery.typeahead.min.css" type="text/css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="./GramSchmidtProcess_files/MathJax.js.download" charset="utf-8"></script>
<script type="text/javascript">
// MathJax disabled, set as null to distingish from *missing* MathJax,
// where it will be undefined, and should prompt a dialog later.
window.mathjax_url = "/static/components/MathJax/MathJax.js";
</script>
<link rel="stylesheet" href="./GramSchmidtProcess_files/bootstrap-tour.min.css" type="text/css">
<link rel="stylesheet" href="./GramSchmidtProcess_files/codemirror.css">
<link rel="stylesheet" href="./GramSchmidtProcess_files/style.min.css" type="text/css">
<link rel="stylesheet" href="./GramSchmidtProcess_files/override.css" type="text/css">
<link rel="stylesheet" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb" id="kernel-css" type="text/css">
<link rel="stylesheet" href="./GramSchmidtProcess_files/custom.css" type="text/css">
<script src="./GramSchmidtProcess_files/promise.min.js.download" type="text/javascript" charset="utf-8"></script>
<script src="./GramSchmidtProcess_files/index.js.download" type="text/javascript"></script>
<script src="./GramSchmidtProcess_files/index.js(1).download" type="text/javascript"></script>
<script src="./GramSchmidtProcess_files/index.js(2).download" type="text/javascript"></script>
<script src="./GramSchmidtProcess_files/require.js.download" type="text/javascript" charset="utf-8"></script>
<script>
require.config({
urlArgs: "v=20190904115201",
baseUrl: '/static/',
paths: {
'auth/js/main': 'auth/js/main.min',
custom : '/custom',
nbextensions : '/nbextensions',
kernelspecs : '/kernelspecs',
underscore : 'components/underscore/underscore-min',
backbone : 'components/backbone/backbone-min',
jquery: 'components/jquery/jquery.min',
bootstrap: 'components/bootstrap/js/bootstrap.min',
bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
'jquery-ui': 'components/jquery-ui/ui/minified/jquery-ui.min',
moment: 'components/moment/moment',
codemirror: 'components/codemirror',
termjs: 'components/xterm.js/dist/xterm',
typeahead: 'components/jquery-typeahead/dist/jquery.typeahead.min',
},
map: { // for backward compatibility
"*": {
"jqueryui": "jquery-ui",
}
},
shim: {
typeahead: {
deps: ["jquery"],
exports: "typeahead"
},
underscore: {
exports: '_'
},
backbone: {
deps: ["underscore", "jquery"],
exports: "Backbone"
},
bootstrap: {
deps: ["jquery"],
exports: "bootstrap"
},
bootstraptour: {
deps: ["bootstrap"],
exports: "Tour"
},
"jquery-ui": {
deps: ["jquery"],
exports: "$"
}
},
waitSeconds: 30,
});
require.config({
map: {
'*':{
'contents': 'services/contents',
}
}
});
// error-catching custom.js shim.
define("custom", function (require, exports, module) {
try {
var custom = require('custom/custom');
console.debug('loaded custom.js');
return custom;
} catch (e) {
console.error("error loading custom.js", e);
return {};
}
})
</script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="services/contents" src="./GramSchmidtProcess_files/contents.js.download"></script><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="custom/custom" src="./GramSchmidtProcess_files/custom.js.download"></script><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="nbextensions/submit-button/main" src="./GramSchmidtProcess_files/main.js.download"></script><style type="text/css">.MathJax_Hover_Frame {border-radius: .25em; -webkit-border-radius: .25em; -moz-border-radius: .25em; -khtml-border-radius: .25em; box-shadow: 0px 0px 15px #83A; -webkit-box-shadow: 0px 0px 15px #83A; -moz-box-shadow: 0px 0px 15px #83A; -khtml-box-shadow: 0px 0px 15px #83A; border: 1px solid #A6D ! important; display: inline-block; position: absolute}
.MathJax_Menu_Button .MathJax_Hover_Arrow {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; -khtml-border-radius: 4px; font-family: 'Courier New',Courier; font-size: 9px; color: #F0F0F0}
.MathJax_Menu_Button .MathJax_Hover_Arrow span {display: block; background-color: #AAA; border: 1px solid; border-radius: 3px; line-height: 0; padding: 4px}
.MathJax_Hover_Arrow:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_Hover_Arrow:hover span {background-color: #CCC!important}
</style><style type="text/css">#MathJax_About {position: fixed; left: 50%; width: auto; text-align: center; border: 3px outset; padding: 1em 2em; background-color: #DDDDDD; color: black; cursor: default; font-family: message-box; font-size: 120%; font-style: normal; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; border-radius: 15px; -webkit-border-radius: 15px; -moz-border-radius: 15px; -khtml-border-radius: 15px; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_About.MathJax_MousePost {outline: none}
.MathJax_Menu {position: absolute; background-color: white; color: black; width: auto; padding: 2px; border: 1px solid #CCCCCC; margin: 0; cursor: default; font: menu; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; z-index: 201; box-shadow: 0px 10px 20px #808080; -webkit-box-shadow: 0px 10px 20px #808080; -moz-box-shadow: 0px 10px 20px #808080; -khtml-box-shadow: 0px 10px 20px #808080; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
.MathJax_MenuItem {padding: 2px 2em; background: transparent}
.MathJax_MenuArrow {position: absolute; right: .5em; padding-top: .25em; color: #666666; font-size: .75em}
.MathJax_MenuActive .MathJax_MenuArrow {color: white}
.MathJax_MenuArrow.RTL {left: .5em; right: auto}
.MathJax_MenuCheck {position: absolute; left: .7em}
.MathJax_MenuCheck.RTL {right: .7em; left: auto}
.MathJax_MenuRadioCheck {position: absolute; left: 1em}
.MathJax_MenuRadioCheck.RTL {right: 1em; left: auto}
.MathJax_MenuLabel {padding: 2px 2em 4px 1.33em; font-style: italic}
.MathJax_MenuRule {border-top: 1px solid #CCCCCC; margin: 4px 1px 0px}
.MathJax_MenuDisabled {color: GrayText}
.MathJax_MenuActive {background-color: Highlight; color: HighlightText}
.MathJax_MenuDisabled:focus, .MathJax_MenuLabel:focus {background-color: #E8E8E8}
.MathJax_ContextMenu:focus {outline: none}
.MathJax_ContextMenu .MathJax_MenuItem:focus {outline: none}
#MathJax_AboutClose {top: .2em; right: .2em}
.MathJax_Menu .MathJax_MenuClose {top: -10px; left: -10px}
.MathJax_MenuClose {position: absolute; cursor: pointer; display: inline-block; border: 2px solid #AAA; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; font-family: 'Courier New',Courier; font-size: 24px; color: #F0F0F0}
.MathJax_MenuClose span {display: block; background-color: #AAA; border: 1.5px solid; border-radius: 18px; -webkit-border-radius: 18px; -moz-border-radius: 18px; -khtml-border-radius: 18px; line-height: 0; padding: 8px 0 6px}
.MathJax_MenuClose:hover {color: white!important; border: 2px solid #CCC!important}
.MathJax_MenuClose:hover span {background-color: #CCC!important}
.MathJax_MenuClose:hover:focus {outline: none}
</style><style type="text/css">.MathJax_Preview .MJXf-math {color: inherit!important}
</style><style type="text/css">.MJX_Assistive_MathML {position: absolute!important; top: 0; left: 0; clip: rect(1px, 1px, 1px, 1px); padding: 1px 0 0 0!important; border: 0!important; height: 1px!important; width: 1px!important; overflow: hidden!important; display: block!important}
.MJX_Assistive_MathML.MJX_Assistive_MathML_Block {width: 100%!important}
</style><style type="text/css">#MathJax_Zoom {position: absolute; background-color: #F0F0F0; overflow: auto; display: block; z-index: 301; padding: .5em; border: 1px solid black; margin: 0; font-weight: normal; font-style: normal; text-align: left; text-indent: 0; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; box-shadow: 5px 5px 15px #AAAAAA; -webkit-box-shadow: 5px 5px 15px #AAAAAA; -moz-box-shadow: 5px 5px 15px #AAAAAA; -khtml-box-shadow: 5px 5px 15px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true')}
#MathJax_ZoomOverlay {position: absolute; left: 0; top: 0; z-index: 300; display: inline-block; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
#MathJax_ZoomFrame {position: relative; display: inline-block; height: 0; width: 0}
#MathJax_ZoomEventTrap {position: absolute; left: 0; top: 0; z-index: 302; display: inline-block; border: 0; padding: 0; margin: 0; background-color: white; opacity: 0; filter: alpha(opacity=0)}
</style><style type="text/css">.MathJax_Preview {color: #888}
#MathJax_Message {position: fixed; left: 1em; bottom: 1.5em; background-color: #E6E6E6; border: 1px solid #959595; margin: 0px; padding: 2px 8px; z-index: 102; color: black; font-size: 80%; width: auto; white-space: nowrap}
#MathJax_MSIE_Frame {position: absolute; top: 0; left: 0; width: 0px; z-index: 101; border: 0px; margin: 0px; padding: 0px}
.MathJax_Error {color: #CC0000; font-style: italic}
</style><style type="text/css">div.MathJax_MathML {text-align: center; margin: .75em 0px; display: block!important}
.MathJax_MathML {font-style: normal; font-weight: normal; line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0}
span.MathJax_MathML {display: inline!important}
.MathJax_mmlExBox {display: block!important; overflow: hidden; height: 1px; width: 60ex; min-height: 0; max-height: none; padding: 0; border: 0; margin: 0}
[class="MJX-tex-oldstyle"] {font-family: MathJax_Caligraphic, MathJax_Caligraphic-WEB}
[class="MJX-tex-oldstyle-bold"] {font-family: MathJax_Caligraphic, MathJax_Caligraphic-WEB; font-weight: bold}
[class="MJX-tex-caligraphic"] {font-family: MathJax_Caligraphic, MathJax_Caligraphic-WEB}
[class="MJX-tex-caligraphic-bold"] {font-family: MathJax_Caligraphic, MathJax_Caligraphic-WEB; font-weight: bold}
@font-face /*1*/ {font-family: MathJax_Caligraphic-WEB; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Regular.otf')}
@font-face /*2*/ {font-family: MathJax_Caligraphic-WEB; font-weight: bold; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Caligraphic-Bold.otf')}
[mathvariant="double-struck"] {font-family: MathJax_AMS, MathJax_AMS-WEB}
[mathvariant="script"] {font-family: MathJax_Script, MathJax_Script-WEB}
[mathvariant="fraktur"] {font-family: MathJax_Fraktur, MathJax_Fraktur-WEB}
[mathvariant="bold-script"] {font-family: MathJax_Script, MathJax_Caligraphic-WEB; font-weight: bold}
[mathvariant="bold-fraktur"] {font-family: MathJax_Fraktur, MathJax_Fraktur-WEB; font-weight: bold}
[mathvariant="monospace"] {font-family: monospace}
[mathvariant="sans-serif"] {font-family: sans-serif}
[mathvariant="bold-sans-serif"] {font-family: sans-serif; font-weight: bold}
[mathvariant="sans-serif-italic"] {font-family: sans-serif; font-style: italic}
[mathvariant="sans-serif-bold-italic"] {font-family: sans-serif; font-style: italic; font-weight: bold}
@font-face /*3*/ {font-family: MathJax_AMS-WEB; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_AMS-Regular.otf')}
@font-face /*4*/ {font-family: MathJax_Script-WEB; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Script-Regular.otf')}
@font-face /*5*/ {font-family: MathJax_Fraktur-WEB; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Regular.otf')}
@font-face /*6*/ {font-family: MathJax_Fraktur-WEB; font-weight: bold; src: url('https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/components/MathJax/fonts/HTML-CSS/TeX/otf/MathJax_Fraktur-Bold.otf')}
</style><style type="text/css">.MJXp-script {font-size: .8em}
.MJXp-right {-webkit-transform-origin: right; -moz-transform-origin: right; -ms-transform-origin: right; -o-transform-origin: right; transform-origin: right}
.MJXp-bold {font-weight: bold}
.MJXp-italic {font-style: italic}
.MJXp-scr {font-family: MathJax_Script,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-frak {font-family: MathJax_Fraktur,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-sf {font-family: MathJax_SansSerif,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-cal {font-family: MathJax_Caligraphic,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-mono {font-family: MathJax_Typewriter,'Times New Roman',Times,STIXGeneral,serif}
.MJXp-largeop {font-size: 150%}
.MJXp-largeop.MJXp-int {vertical-align: -.2em}
.MJXp-math {display: inline-block; line-height: 1.2; text-indent: 0; font-family: 'Times New Roman',Times,STIXGeneral,serif; white-space: nowrap; border-collapse: collapse}
.MJXp-display {display: block; text-align: center; margin: 1em 0}
.MJXp-math span {display: inline-block}
.MJXp-box {display: block!important; text-align: center}
.MJXp-box:after {content: " "}
.MJXp-rule {display: block!important; margin-top: .1em}
.MJXp-char {display: block!important}
.MJXp-mo {margin: 0 .15em}
.MJXp-mfrac {margin: 0 .125em; vertical-align: .25em}
.MJXp-denom {display: inline-table!important; width: 100%}
.MJXp-denom > * {display: table-row!important}
.MJXp-surd {vertical-align: top}
.MJXp-surd > * {display: block!important}
.MJXp-script-box > * {display: table!important; height: 50%}
.MJXp-script-box > * > * {display: table-cell!important; vertical-align: top}
.MJXp-script-box > *:last-child > * {vertical-align: bottom}
.MJXp-script-box > * > * > * {display: block!important}
.MJXp-mphantom {visibility: hidden}
.MJXp-munderover {display: inline-table!important}
.MJXp-over {display: inline-block!important; text-align: center}
.MJXp-over > * {display: block!important}
.MJXp-munderover > * {display: table-row!important}
.MJXp-mtable {vertical-align: .25em; margin: 0 .125em}
.MJXp-mtable > * {display: inline-table!important; vertical-align: middle}
.MJXp-mtr {display: table-row!important}
.MJXp-mtd {display: table-cell!important; text-align: center; padding: .5em 0 0 .5em}
.MJXp-mtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-mlabeledtr {display: table-row!important}
.MJXp-mlabeledtr > .MJXp-mtd:first-child {padding-left: 0}
.MJXp-mlabeledtr:first-child > .MJXp-mtd {padding-top: 0}
.MJXp-merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MJXp-scale0 {-webkit-transform: scaleX(.0); -moz-transform: scaleX(.0); -ms-transform: scaleX(.0); -o-transform: scaleX(.0); transform: scaleX(.0)}
.MJXp-scale1 {-webkit-transform: scaleX(.1); -moz-transform: scaleX(.1); -ms-transform: scaleX(.1); -o-transform: scaleX(.1); transform: scaleX(.1)}
.MJXp-scale2 {-webkit-transform: scaleX(.2); -moz-transform: scaleX(.2); -ms-transform: scaleX(.2); -o-transform: scaleX(.2); transform: scaleX(.2)}
.MJXp-scale3 {-webkit-transform: scaleX(.3); -moz-transform: scaleX(.3); -ms-transform: scaleX(.3); -o-transform: scaleX(.3); transform: scaleX(.3)}
.MJXp-scale4 {-webkit-transform: scaleX(.4); -moz-transform: scaleX(.4); -ms-transform: scaleX(.4); -o-transform: scaleX(.4); transform: scaleX(.4)}
.MJXp-scale5 {-webkit-transform: scaleX(.5); -moz-transform: scaleX(.5); -ms-transform: scaleX(.5); -o-transform: scaleX(.5); transform: scaleX(.5)}
.MJXp-scale6 {-webkit-transform: scaleX(.6); -moz-transform: scaleX(.6); -ms-transform: scaleX(.6); -o-transform: scaleX(.6); transform: scaleX(.6)}
.MJXp-scale7 {-webkit-transform: scaleX(.7); -moz-transform: scaleX(.7); -ms-transform: scaleX(.7); -o-transform: scaleX(.7); transform: scaleX(.7)}
.MJXp-scale8 {-webkit-transform: scaleX(.8); -moz-transform: scaleX(.8); -ms-transform: scaleX(.8); -o-transform: scaleX(.8); transform: scaleX(.8)}
.MJXp-scale9 {-webkit-transform: scaleX(.9); -moz-transform: scaleX(.9); -ms-transform: scaleX(.9); -o-transform: scaleX(.9); transform: scaleX(.9)}
.MathJax_PHTML .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style><style type="text/css">.MathJax_Display {text-align: center; margin: 0; position: relative; display: block!important; text-indent: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; width: 100%}
.MathJax .merror {background-color: #FFFF88; color: #CC0000; border: 1px solid #CC0000; padding: 1px 3px; font-style: normal; font-size: 90%}
.MathJax .MJX-monospace {font-family: monospace}
.MathJax .MJX-sans-serif {font-family: sans-serif}
#MathJax_Tooltip {background-color: InfoBackground; color: InfoText; border: 1px solid black; box-shadow: 2px 2px 5px #AAAAAA; -webkit-box-shadow: 2px 2px 5px #AAAAAA; -moz-box-shadow: 2px 2px 5px #AAAAAA; -khtml-box-shadow: 2px 2px 5px #AAAAAA; filter: progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color='gray', Positive='true'); padding: 3px 4px; z-index: 401; position: absolute; left: 0; top: 0; width: auto; height: auto; display: none}
.MathJax {display: inline; font-style: normal; font-weight: normal; line-height: normal; font-size: 100%; font-size-adjust: none; text-indent: 0; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0; min-height: 0; border: 0; padding: 0; margin: 0}
.MathJax:focus, body :focus .MathJax {display: inline-table}
.MathJax img, .MathJax nobr, .MathJax a {border: 0; padding: 0; margin: 0; max-width: none; max-height: none; min-width: 0; min-height: 0; vertical-align: 0; line-height: normal; text-decoration: none}
img.MathJax_strut {border: 0!important; padding: 0!important; margin: 0!important; vertical-align: 0!important}
.MathJax span {display: inline; position: static; border: 0; padding: 0; margin: 0; vertical-align: 0; line-height: normal; text-decoration: none}
.MathJax nobr {white-space: nowrap!important}
.MathJax img {display: inline!important; float: none!important}
.MathJax * {transition: none; -webkit-transition: none; -moz-transition: none; -ms-transition: none; -o-transition: none}
.MathJax_Processing {visibility: hidden; position: fixed; width: 0; height: 0; overflow: hidden}
.MathJax_Processed {display: none!important}
.MathJax_ExBox {display: block!important; overflow: hidden; width: 1px; height: 60ex; min-height: 0; max-height: none}
.MathJax .MathJax_EmBox {display: block!important; overflow: hidden; width: 1px; height: 60em; min-height: 0; max-height: none}
.MathJax .MathJax_HitBox {cursor: text; background: white; opacity: 0; filter: alpha(opacity=0)}
.MathJax .MathJax_HitBox * {filter: none; opacity: 1; background: transparent}
#MathJax_Tooltip * {filter: none; opacity: 1; background: transparent}
@font-face {font-family: MathJax_Blank; src: url('about:blank')}
.MathJax .noError {vertical-align: ; font-size: 90%; text-align: left; color: black; padding: 1px 3px; border: 1px solid}
</style><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="nbextensions/widgets/notebook/js/extension" src="./GramSchmidtProcess_files/extension.js.download"></script><link id="favicon" type="image/x-icon" rel="shortcut icon" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/static/base/images/favicon.ico"></head>
<body class="notebook_app command_mode" data-base-url="/" data-ws-url="" data-notebook-name="GramSchmidtProcess.ipynb" data-notebook-path="GramSchmidtProcess.ipynb" dir="ltr" style=""><div style="visibility: hidden; overflow: hidden; position: absolute; top: 0px; height: 1px; width: auto; padding: 0px; border: 0px; margin: 0px; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal;"><div id="MathJax_Hidden"></div></div><div id="MathJax_Message" style="display: none;"></div>
<noscript>
<div id='noscript'>
Jupyter Notebook requires JavaScript.<br>
Please enable it to proceed.
</div>
</noscript>
<div id="header" style="display: block;">
<div id="header-container" class="container">
<div id="ipython_notebook" class="nav navbar-brand pull-left"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/tree" title="dashboard"><img src="./GramSchmidtProcess_files/logo.png" alt="Jupyter Notebook"></a></div>
<span id="login_widget">
</span>
<span id="save_widget" class="pull-left save_widget">
<span id="notebook_name" class="filename">GramSchmidtProcess</span>
<span class="checkpoint_status" title="Wed, May 9, 2018 12:33 AM">Last Checkpoint: 05/09/2018</span>
<span class="autosave_status">(unsaved changes)</span>
</span>
<span id="kernel_logo_widget">
<img class="current_kernel_logo" src="./GramSchmidtProcess_files/logo-64x64.png" title="Python 3" style="display: inline;">
</span>
</div>
<div class="header-bar"></div>
<div id="menubar-container" class="container">
<div id="menubar">
<div id="menus" class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<button type="button" class="btn btn-default navbar-btn navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<i class="fa fa-bars"></i>
<span class="navbar-text">Menu</span>
</button>
<p id="kernel_indicator" class="navbar-text indicator_area">
<span class="kernel_indicator_name">Python 3</span>
<i id="kernel_indicator_icon" class="kernel_idle_icon" title="Kernel Idle"></i>
</p>
<i id="readonly-indicator" class="navbar-text" title="This notebook is read-only" style="display: none;">
<span class="fa-stack">
<i class="fa fa-save fa-stack-1x"></i>
<i class="fa fa-ban fa-stack-2x text-danger"></i>
</span>
</i>
<i id="modal_indicator" class="navbar-text modal_indicator" title="Command Mode"></i>
<span id="notification_area"><div id="notification_kernel" class="notification_widget btn btn-xs navbar-btn undefined info" style="display: none;"><span></span></div><div id="notification_notebook" class="notification_widget btn btn-xs navbar-btn" style="display: none;"><span></span></div><div id="notification_trusted" class="notification_widget btn btn-xs navbar-btn" style="display: inline-block;"><span>Trusted</span></div></span>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">File</a>
<ul id="file_menu" class="dropdown-menu">
<li id="new_notebook" class="dropdown-submenu">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">New Notebook</a>
<ul class="dropdown-menu" id="menu-new-notebook-submenu"><li id="new-notebook-submenu-python3"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Python 3</a></li></ul>
</li>
<li id="open_notebook" title="Opens a new window with the Dashboard view">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Open...</a></li>
<!-- <hr/> -->
<li class="divider"></li>
<li id="copy_notebook" title="Open a copy of this notebook's contents and start a new kernel">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Make a Copy...</a></li>
<li id="rename_notebook"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Rename...</a></li>
<li id="save_checkpoint"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Save and Checkpoint</a></li>
<!-- <hr/> -->
<li class="divider"></li>
<li id="restore_checkpoint" class="dropdown-submenu"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Revert to Checkpoint</a>
<ul class="dropdown-menu"><li><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Wednesday, May 9, 2018 12:33 AM</a></li></ul>
</li>
<li class="divider"></li>
<li id="print_preview"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Print Preview</a></li>
<li class="dropdown-submenu"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Download as</a>
<ul id="download_menu" class="dropdown-menu">
<li id="download_ipynb"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Notebook (.ipynb)</a></li>
<li id="download_script"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Python (.py)</a></li>
<li id="download_html"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">HTML (.html)</a></li>
<li id="download_markdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Markdown (.md)</a></li>
<li id="download_rst"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">reST (.rst)</a></li>
<li id="download_latex"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">LaTeX (.tex)</a></li>
<li id="download_pdf"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">PDF via LaTeX (.pdf)</a></li>
</ul>
</li>
<li class="dropdown-submenu hidden"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Deploy as</a>
<ul id="deploy_menu" class="dropdown-menu"></ul>
</li>
<li class="divider"></li>
<li id="trust_notebook" title="Trust the output of this notebook" class="disabled">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Trusted Notebook</a></li>
<li class="divider"></li>
<li id="kill_and_exit" title="Shutdown this notebook's kernel, and close this window">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Close and Halt</a></li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">Edit</a>
<ul id="edit_menu" class="dropdown-menu">
<li id="cut_cell"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Cut Cells</a></li>
<li id="copy_cell"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Copy Cells</a></li>
<li id="paste_cell_above" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Paste Cells Above</a></li>
<li id="paste_cell_below" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Paste Cells Below</a></li>
<li id="paste_cell_replace" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Paste Cells & Replace</a></li>
<li id="delete_cell"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Delete Cells</a></li>
<li id="undelete_cell" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Undo Delete Cells</a></li>
<li class="divider"></li>
<li id="split_cell"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Split Cell</a></li>
<li id="merge_cell_above"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Merge Cell Above</a></li>
<li id="merge_cell_below"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Merge Cell Below</a></li>
<li class="divider"></li>
<li id="move_cell_up"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Move Cell Up</a></li>
<li id="move_cell_down"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Move Cell Down</a></li>
<li class="divider"></li>
<li id="edit_nb_metadata"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Edit Notebook Metadata</a></li>
<li class="divider"></li>
<li id="find_and_replace"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#"> Find and Replace </a></li>
<li class="divider"></li>
<li id="cut_cell_attachments"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Cut Cell Attachments</a></li>
<li id="copy_cell_attachments"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Copy Cell Attachments</a></li>
<li id="paste_cell_attachments" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Paste Cell Attachments</a></li>
<li class="divider"></li>
<li id="insert_image" class="disabled"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#"> Insert Image </a></li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">View</a>
<ul id="view_menu" class="dropdown-menu">
<li id="toggle_header" title="Show/Hide the logo and notebook title (above menu bar)">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle Header</a>
</li>
<li id="toggle_toolbar" title="Show/Hide the action icons (below menu bar)">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle Toolbar</a>
</li>
<li id="toggle_line_numbers" title="Show/Hide line numbers in cells">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle Line Numbers</a>
</li>
<li id="menu-cell-toolbar" class="dropdown-submenu">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Cell Toolbar</a>
<ul class="dropdown-menu" id="menu-cell-toolbar-submenu"><li data-name="None"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">None</a></li><li data-name="Edit%20Metadata"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Edit Metadata</a></li><li data-name="Raw%20Cell%20Format"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Raw Cell Format</a></li><li data-name="Slideshow"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Slideshow</a></li><li data-name="Attachments"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Attachments</a></li><li data-name="Tags"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Tags</a></li></ul>
</li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">Insert</a>
<ul id="insert_menu" class="dropdown-menu">
<li id="insert_cell_above" title="Insert an empty Code cell above the currently active cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Insert Cell Above</a></li>
<li id="insert_cell_below" title="Insert an empty Code cell below the currently active cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Insert Cell Below</a></li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">Cell</a>
<ul id="cell_menu" class="dropdown-menu">
<li id="run_cell" title="Run this cell, and move cursor to the next one">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run Cells</a></li>
<li id="run_cell_select_below" title="Run this cell, select below">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run Cells and Select Below</a></li>
<li id="run_cell_insert_below" title="Run this cell, insert below">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run Cells and Insert Below</a></li>
<li id="run_all_cells" title="Run all cells in the notebook">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run All</a></li>
<li id="run_all_cells_above" title="Run all cells above (but not including) this cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run All Above</a></li>
<li id="run_all_cells_below" title="Run this cell and all cells below it">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Run All Below</a></li>
<li class="divider"></li>
<li id="change_cell_type" class="dropdown-submenu" title="All cells in the notebook have a cell type. By default, new cells are created as 'Code' cells">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Cell Type</a>
<ul class="dropdown-menu">
<li id="to_code" title="Contents will be sent to the kernel for execution, and output will display in the footer of cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Code</a></li>
<li id="to_markdown" title="Contents will be rendered as HTML and serve as explanatory text">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Markdown</a></li>
<li id="to_raw" title="Contents will pass through nbconvert unmodified">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Raw NBConvert</a></li>
</ul>
</li>
<li class="divider"></li>
<li id="current_outputs" class="dropdown-submenu"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Current Outputs</a>
<ul class="dropdown-menu">
<li id="toggle_current_output" title="Hide/Show the output of the current cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle</a>
</li>
<li id="toggle_current_output_scroll" title="Scroll the output of the current cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle Scrolling</a>
</li>
<li id="clear_current_output" title="Clear the output of the current cell">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Clear</a>
</li>
</ul>
</li>
<li id="all_outputs" class="dropdown-submenu"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">All Output</a>
<ul class="dropdown-menu">
<li id="toggle_all_output" title="Hide/Show the output of all cells">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle</a>
</li>
<li id="toggle_all_output_scroll" title="Scroll the output of all cells">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Toggle Scrolling</a>
</li>
<li id="clear_all_output" title="Clear the output of all cells">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Clear</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">Kernel</a>
<ul id="kernel_menu" class="dropdown-menu">
<li id="int_kernel" title="Send KeyboardInterrupt (CTRL-C) to the Kernel">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Interrupt</a>
</li>
<li id="restart_kernel" title="Restart the Kernel">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Restart</a>
</li>
<li id="restart_clear_output" title="Restart the Kernel and clear all output">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Restart & Clear Output</a>
</li>
<li id="restart_run_all" title="Restart the Kernel and re-run the notebook">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Restart & Run All</a>
</li>
<li id="reconnect_kernel" title="Reconnect to the Kernel">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Reconnect</a>
</li>
<li id="shutdown_kernel" title="Shutdown the Kernel">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Shutdown</a>
</li>
<li class="divider"></li>
<li id="menu-change-kernel" class="dropdown-submenu">
<a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Change kernel</a>
<ul class="dropdown-menu" id="menu-change-kernel-submenu"><li id="kernel-submenu-python3"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Python 3</a></li></ul>
</li>
</ul>
</li>
<li class="dropdown"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="dropdown-toggle" data-toggle="dropdown">Help</a>
<ul id="help_menu" class="dropdown-menu">
<li id="notebook_tour" title="A quick tour of the notebook user interface"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">User Interface Tour</a></li>
<li id="keyboard_shortcuts" title="Opens a dialog which shows all keyboard shortcuts"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Keyboard Shortcuts</a></li>
<li id="edit_keyboard_shortcuts" title="Opens a dialog allowing you to edit Keyboard shortcuts"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">Edit Keyboard Shortcuts</a></li>
<li class="divider"></li>
<li><a rel="noreferrer" href="http://nbviewer.ipython.org/github/ipython/ipython/blob/3.x/examples/Notebook/Index.ipynb" target="_blank" title="Opens in a new window">
<i class="fa fa-external-link menu-icon pull-right"></i>
Notebook Help
</a></li>
<li><a rel="noreferrer" href="https://help.github.com/articles/markdown-basics/" target="_blank" title="Opens in a new window">
<i class="fa fa-external-link menu-icon pull-right"></i>
Markdown
</a></li>
<li id="kernel-help-links" class="divider"></li><li><a target="_blank" title="Opens in a new window" href="http://docs.python.org/3.6?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>Python</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://ipython.org/documentation.html?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>IPython</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://docs.scipy.org/doc/numpy/reference/?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>NumPy</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://docs.scipy.org/doc/scipy/reference/?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>SciPy</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://matplotlib.org/contents.html?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>Matplotlib</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://docs.sympy.org/latest/index.html?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>SymPy</span></a></li><li><a target="_blank" title="Opens in a new window" href="http://pandas.pydata.org/pandas-docs/stable/?v=20190904115201"><i class="fa fa-external-link menu-icon pull-right"></i><span>pandas</span></a></li><li class="divider"></li>
<li title="About Jupyter Notebook"><a id="notebook_about" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#">About</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="maintoolbar" class="navbar">
<div class="toolbar-inner navbar-inner navbar-nobg">
<div id="maintoolbar-container" class="container toolbar"><div class="btn-group" id="save-notbook"><button class="btn btn-default" title="Save and Checkpoint" data-jupyter-action="jupyter-notebook:save-notebook"><i class="fa-save fa"></i></button></div><div class="btn-group" id="insert_above_below"><button class="btn btn-default" title="insert cell below" data-jupyter-action="jupyter-notebook:insert-cell-below"><i class="fa-plus fa"></i></button></div><div class="btn-group" id="cut_copy_paste"><button class="btn btn-default" title="cut selected cells" data-jupyter-action="jupyter-notebook:cut-cell"><i class="fa-cut fa"></i></button><button class="btn btn-default" title="copy selected cells" data-jupyter-action="jupyter-notebook:copy-cell"><i class="fa-copy fa"></i></button><button class="btn btn-default" title="paste cells below" data-jupyter-action="jupyter-notebook:paste-cell-below"><i class="fa-paste fa"></i></button></div><div class="btn-group" id="move_up_down"><button class="btn btn-default" title="move selected cells up" data-jupyter-action="jupyter-notebook:move-cell-up"><i class="fa-arrow-up fa"></i></button><button class="btn btn-default" title="move selected cells down" data-jupyter-action="jupyter-notebook:move-cell-down"><i class="fa-arrow-down fa"></i></button></div><div class="btn-group" id="run_int"><button class="btn btn-default" title="run cell, select below" data-jupyter-action="jupyter-notebook:run-cell-and-select-next"><i class="fa-step-forward fa"></i></button><button class="btn btn-default" title="interrupt kernel" data-jupyter-action="jupyter-notebook:interrupt-kernel"><i class="fa-stop fa"></i></button><button class="btn btn-default" title="restart the kernel (with dialog)" data-jupyter-action="jupyter-notebook:confirm-restart-kernel"><i class="fa-repeat fa"></i></button></div><select id="cell_type" class="form-control select-xs"><option value="code">Code</option><option value="markdown">Markdown</option><option value="raw">Raw NBConvert</option><option value="heading">Heading</option><option value="multiselect" disabled="disabled" style="display: none;">-</option></select><div class="btn-group"><button class="btn btn-default" title="open the command palette" data-jupyter-action="jupyter-notebook:show-command-palette"><i class="fa-keyboard-o fa"></i></button></div><div class="btn-group" id="submit-notebook-button-group" style="float:right"><button class="btn btn-default" title="Submit this notebook for grading." id="submit-notebook-button" style="background-color:rgb(42, 115, 204); color:white; padding:4px 8px">Submit Assignment</button></div></div>
</div>
</div>
</div>
<div class="lower-header-bar"></div>
</div>
<div id="site" style="height: 409px; display: block;">
<div id="ipython-main-app">
<div id="notebook_panel">
<div id="notebook" tabindex="-1"><div class="container" id="notebook-container"><div class="cell text_cell rendered unselected" tabindex="2"><div class="prompt input_prompt"></div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 0px;"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; padding-right: 0px; padding-bottom: 0px; margin-bottom: -17px; border-right-width: 13px; min-height: 939px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 21.3333px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-header cm-header-1"># Gram-Schmidt process</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-header cm-header-2">## Instructions</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">In this assignment you will write a function to perform the Gram-Schmidt procedure, which takes a list of vectors and forms an orthonormal basis from this set.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">As a corollary, the procedure allows us to determine the dimension of the space spanned by the basis vectors, which is equal to or less than the space which the vectors sit.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">You'll start by completing a function for 4 basis vectors, before generalising to when an arbitrary number of vectors are given.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Again, a framework for the function has already been written.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Look through the code, and you'll be instructed where to make changes.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">We'll do the first two rows, and you can use this as a guide to do the last two.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-header cm-header-3">### Matrices in Python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Remember the structure for matrices in <span class="cm-em">*numpy*</span> is,</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">3</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">3</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">3</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">3</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">You can access the value of each element individually using,</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-variable">n</span>, <span class="cm-variable">m</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">You can also access a whole row at a time using,</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[<span class="cm-variable">n</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Building on last assignment, in this exercise you will need to select whole columns at a time.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">This can be done with,</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span>[:, <span class="cm-variable">m</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">which will select the m'th column (starting at zero).</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">In this exercise, you will need to take the dot product between vectors. This can be done using the @ operator.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">To dot product vectors u and v, use the code,</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```python</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">u</span> <span class="cm-operator">@</span> <span class="cm-variable">v</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment">```</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">All the code you should complete will be at the same level of indentation as the instruction comment.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-header cm-header-3">### How to submit</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Edit the code in the cell below to complete the assignment.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Once you are finished and happy with it, press the <span class="cm-em">*Submit Assignment*</span> button at the top of this notebook.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Please don't change any of the function names, as these will be checked by the grading script.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">If you have further questions about submissions or programming assignments, here is a <span class="cm-link">[list]</span><span class="cm-string cm-url">(https://www.coursera.org/learn/linear-algebra-machine-learning/discussions/weeks/1/threads/jB4klkn5EeibtBIQyzFmQg)</span> of Q&A. You can also raise an issue on the discussion forum. Good luck!</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 939px;"></div><div class="CodeMirror-gutters" style="display: none; height: 952px;"></div></div></div></div><div class="text_cell_render rendered_html" tabindex="-1"><h1 id="Gram-Schmidt-process">Gram-Schmidt process<a class="anchor-link" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#Gram-Schmidt-process">¶</a></h1>
<h2 id="Instructions">Instructions<a class="anchor-link" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#Instructions">¶</a></h2>
<p>In this assignment you will write a function to perform the Gram-Schmidt procedure, which takes a list of vectors and forms an orthonormal basis from this set.
As a corollary, the procedure allows us to determine the dimension of the space spanned by the basis vectors, which is equal to or less than the space which the vectors sit.</p>
<p>You'll start by completing a function for 4 basis vectors, before generalising to when an arbitrary number of vectors are given.</p>
<p>Again, a framework for the function has already been written.
Look through the code, and you'll be instructed where to make changes.
We'll do the first two rows, and you can use this as a guide to do the last two.</p>
<h3 id="Matrices-in-Python">Matrices in Python<a class="anchor-link" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#Matrices-in-Python">¶</a></h3>
<p>Remember the structure for matrices in <em>numpy</em> is,</p>
<pre><code class="cm-s-ipython language-python"><span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">0</span>, <span class="cm-number">3</span>]
<span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">1</span>, <span class="cm-number">3</span>]
<span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">2</span>, <span class="cm-number">3</span>]
<span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">0</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">1</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">2</span>] <span class="cm-variable">A</span>[<span class="cm-number">3</span>, <span class="cm-number">3</span>]
</code></pre>
<p>You can access the value of each element individually using,</p>
<pre><code class="cm-s-ipython language-python"><span class="cm-variable">A</span>[<span class="cm-variable">n</span>, <span class="cm-variable">m</span>]
</code></pre>
<p>You can also access a whole row at a time using,</p>
<pre><code class="cm-s-ipython language-python"><span class="cm-variable">A</span>[<span class="cm-variable">n</span>]
</code></pre>
<p>Building on last assignment, in this exercise you will need to select whole columns at a time.
This can be done with,</p>
<pre><code class="cm-s-ipython language-python"><span class="cm-variable">A</span>[:, <span class="cm-variable">m</span>]
</code></pre>
<p>which will select the m'th column (starting at zero).</p>
<p>In this exercise, you will need to take the dot product between vectors. This can be done using the @ operator.
To dot product vectors u and v, use the code,</p>
<pre><code class="cm-s-ipython language-python"><span class="cm-variable">u</span> <span class="cm-operator">@</span> <span class="cm-variable">v</span>
</code></pre>
<p>All the code you should complete will be at the same level of indentation as the instruction comment.</p>
<h3 id="How-to-submit">How to submit<a class="anchor-link" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#How-to-submit">¶</a></h3>
<p>Edit the code in the cell below to complete the assignment.
Once you are finished and happy with it, press the <em>Submit Assignment</em> button at the top of this notebook.</p>
<p>Please don't change any of the function names, as these will be checked by the grading script.</p>
<p>If you have further questions about submissions or programming assignments, here is a <a href="https://www.coursera.org/learn/linear-algebra-machine-learning/discussions/weeks/1/threads/jB4klkn5EeibtBIQyzFmQg" target="_blank">list</a> of Q&A. You can also raise an issue on the discussion forum. Good luck!</p>
</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [1]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 1272.26px; left: 144.26px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 0px;"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1" draggable="false"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 788.104px; margin-bottom: -17px; border-right-width: 13px; min-height: 1511px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 138.667px; top: 1266.67px; height: 16.6667px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># GRADED FUNCTION</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-keyword">import</span> <span class="cm-variable">numpy</span> <span class="cm-keyword">as</span> <span class="cm-variable">np</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-keyword">import</span> <span class="cm-variable">numpy</span>.<span class="cm-property">linalg</span> <span class="cm-keyword">as</span> <span class="cm-variable">la</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">verySmallNumber</span> = <span class="cm-number">1e-14</span> <span class="cm-comment"># That's 1×10⁻¹⁴ = 0.00000000000001</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Our first function will perform the Gram-Schmidt procedure for 4 basis vectors.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># We'll take this list of vectors as the columns of a matrix, A.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># We'll then go through the vectors one at a time and set them to be orthogonal</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># to all the vectors that came before it. Before normalising.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Follow the instructions inside the function at each comment.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># You will be told where to add code to complete the function.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-keyword">def</span> <span class="cm-def">gsBasis4</span>(<span class="cm-variable">A</span>) :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>(<span class="cm-variable">A</span>, <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>) <span class="cm-comment"># Make B as a copy of A, since we're going to alter it's values.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># The zeroth column is easy, since it has no other vectors to make it normal to.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># All that needs to be done is to normalise it. I.e. divide by its modulus, or norm.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>] <span class="cm-operator">/</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">0</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># For the first column, we need to subtract any overlap with our new zeroth vector.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># If there's anything left after that subtraction, then B[:, 1] is linearly independant of B[:, 0]</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># If this is the case, we can normalise it. Otherwise we'll set that vector to zero.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">if</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">1</span>]) <span class="cm-operator">></span> <span class="cm-variable">verySmallNumber</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] <span class="cm-operator">/</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">1</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">else</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] = <span class="cm-variable">np</span>.<span class="cm-property">zeros_like</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">1</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Now we need to repeat the process for column 2.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Insert two lines of code, the first to subtract the overlap with the zeroth vector,</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># and the second to subtract the overlap with the first.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Again we'll need to normalise our new vector.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Copy and adapt the normalisation fragment from above to column 2.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">if</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">2</span>]) <span class="cm-operator">></span> <span class="cm-variable">verySmallNumber</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">/</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">2</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">else</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] = <span class="cm-variable">np</span>.<span class="cm-property">zeros_like</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">2</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Finally, column three:</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Insert code to subtract the overlap with the first three vectors.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">0</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">1</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-number">2</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Now normalise if possible</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">if</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">3</span>]) <span class="cm-operator">></span> <span class="cm-variable">verySmallNumber</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] = <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] <span class="cm-operator">/</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">3</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">else</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-number">3</span>] = <span class="cm-variable">np</span>.<span class="cm-property">zeros_like</span>(<span class="cm-variable">B</span>[:, <span class="cm-number">3</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Finally, we return the result:</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">return</span> <span class="cm-variable">B</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># The second part of this exercise will generalise the procedure.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Previously, we could only have four vectors, and there was a lot of repeating in the code.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># We'll use a for-loop here to iterate the process for each vector.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-keyword">def</span> <span class="cm-def">gsBasis</span>(<span class="cm-variable">A</span>) :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>(<span class="cm-variable">A</span>, <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>) <span class="cm-comment"># Make B as a copy of A, since we're going to alter it's values.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Loop over all vectors, starting with zero, label them with i</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">for</span> <span class="cm-variable">i</span> <span class="cm-keyword">in</span> <span class="cm-builtin">range</span>(<span class="cm-variable">B</span>.<span class="cm-property">shape</span>[<span class="cm-number">1</span>]) :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Inside that loop, loop over all previous vectors, j, to subtract.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">for</span> <span class="cm-variable">j</span> <span class="cm-keyword">in</span> <span class="cm-builtin">range</span>(<span class="cm-variable">i</span>) :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Complete the code to subtract the overlap with previous vectors.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># you'll need the current vector B[:, i] and a previous vector B[:, j]</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] = <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] <span class="cm-operator">-</span> <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] <span class="cm-operator">@</span> <span class="cm-variable">B</span>[:, <span class="cm-variable">j</span>] <span class="cm-operator">*</span> <span class="cm-variable">B</span>[:, <span class="cm-variable">j</span>]</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Next insert code to do the normalisation test for B[:, i]</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">if</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>]) <span class="cm-operator">></span> <span class="cm-variable">verySmallNumber</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] = <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] <span class="cm-operator">/</span> <span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">else</span> :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>] = <span class="cm-variable">np</span>.<span class="cm-property">zeros_like</span>(<span class="cm-variable">B</span>[:, <span class="cm-variable">i</span>])</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> </span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-comment"># Finally, we return the result:</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">return</span> <span class="cm-variable">B</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># This function uses the Gram-schmidt process to calculate the dimension</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># spanned by a list of vectors.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Since each vector is normalised to one, or is zero,</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># the sum of all the norms will be the dimension.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-keyword">def</span> <span class="cm-def">dimensions</span>(<span class="cm-variable">A</span>) :</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> <span class="cm-keyword">return</span> <span class="cm-variable">np</span>.<span class="cm-property">sum</span>(<span class="cm-variable">la</span>.<span class="cm-property">norm</span>(<span class="cm-variable">gsBasis</span>(<span class="cm-variable">A</span>), <span class="cm-variable">axis</span>=<span class="cm-number">0</span>))</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 1511px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1524px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style="display: none;"></div><div class="output" style="display: none;"></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell text_cell rendered unselected" tabindex="2"><div class="prompt input_prompt"></div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-default CodeMirror-wrap"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true" style="bottom: 0px;"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; padding-right: 0px; padding-bottom: 0px; margin-bottom: -17px; border-right-width: 13px; min-height: 131px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 20px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-header cm-header-2">## Test your code before submission</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">To test the code you've written above, run the cell (select the cell above, then press the play button [ ▶| ] or press shift-enter).</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">You can then use the code below to test out your function.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">You don't need to submit this cell; you can edit and run it as much as you like.</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;">Try out your code on tricky test cases!</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 131px;"></div><div class="CodeMirror-gutters" style="display: none; height: 144px;"></div></div></div></div><div class="text_cell_render rendered_html" tabindex="-1"><h2 id="Test-your-code-before-submission">Test your code before submission<a class="anchor-link" href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#Test-your-code-before-submission">¶</a></h2>
<p>To test the code you've written above, run the cell (select the cell above, then press the play button [ ▶| ] or press shift-enter).
You can then use the code below to test out your function.
You don't need to submit this cell; you can edit and run it as much as you like.</p>
<p>Try out your code on tricky test cases!</p>
</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [2]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59377px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 333.844px; margin-bottom: -17px; border-right-width: 13px; min-height: 95px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">V</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>([[<span class="cm-number">1</span>,<span class="cm-number">0</span>,<span class="cm-number">2</span>,<span class="cm-number">6</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">0</span>,<span class="cm-number">1</span>,<span class="cm-number">8</span>,<span class="cm-number">2</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">2</span>,<span class="cm-number">8</span>,<span class="cm-number">3</span>,<span class="cm-number">1</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">1</span>,<span class="cm-operator">-</span><span class="cm-number">6</span>,<span class="cm-number">2</span>,<span class="cm-number">3</span>]], <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>)</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis4</span>(<span class="cm-variable">V</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 95px;"></div><div class="CodeMirror-gutters" style="display: none; height: 108px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[2]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.40824829, -0.1814885 , 0.04982278, 0.89325973],
[ 0. , 0.1088931 , 0.99349591, -0.03328918],
[ 0.81649658, 0.50816781, -0.06462163, -0.26631346],
[ 0.40824829, -0.83484711, 0.07942048, -0.36063281]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [3]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 464.833px; margin-bottom: -17px; border-right-width: 13px; min-height: 78px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Once you've done Gram-Schmidt once,</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># doing it again should give you the same result. Test this:</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">U</span> = <span class="cm-variable">gsBasis4</span>(<span class="cm-variable">V</span>)</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis4</span>(<span class="cm-variable">U</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 78px;"></div><div class="CodeMirror-gutters" style="display: none; height: 91px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[3]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.40824829, -0.1814885 , 0.04982278, 0.89325973],
[ 0. , 0.1088931 , 0.99349591, -0.03328918],
[ 0.81649658, 0.50816781, -0.06462163, -0.26631346],
[ 0.40824829, -0.83484711, 0.07942048, -0.36063281]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [4]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 241.615px; margin-bottom: -17px; border-right-width: 13px; min-height: 45px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Try the general function too.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis</span>(<span class="cm-variable">V</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 45px;"></div><div class="CodeMirror-gutters" style="display: none; height: 58px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[4]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.40824829, -0.1814885 , 0.04982278, 0.89325973],
[ 0. , 0.1088931 , 0.99349591, -0.03328918],
[ 0.81649658, 0.50816781, -0.06462163, -0.26631346],
[ 0.40824829, -0.83484711, 0.07942048, -0.36063281]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [5]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 326.281px; margin-bottom: -17px; border-right-width: 13px; min-height: 111px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># See what happens for non-square matrices</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">A</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>([[<span class="cm-number">3</span>,<span class="cm-number">2</span>,<span class="cm-number">3</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">2</span>,<span class="cm-number">5</span>,<span class="cm-operator">-</span><span class="cm-number">1</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">2</span>,<span class="cm-number">4</span>,<span class="cm-number">8</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">12</span>,<span class="cm-number">2</span>,<span class="cm-number">1</span>]], <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>)</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis</span>(<span class="cm-variable">A</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 111px;"></div><div class="CodeMirror-gutters" style="display: none; height: 124px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[5]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.23643312, 0.18771349, 0.22132104],
[ 0.15762208, 0.74769023, -0.64395812],
[ 0.15762208, 0.57790444, 0.72904263],
[ 0.94573249, -0.26786082, -0.06951101]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [6]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 103.031px; margin-bottom: -17px; border-right-width: 13px; min-height: 28px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">dimensions</span>(<span class="cm-variable">A</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 28px;"></div><div class="CodeMirror-gutters" style="display: none; height: 41px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[6]:</div><div class="output_subarea output_text output_result"><pre>3.0</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [7]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 349.219px; margin-bottom: -17px; border-right-width: 13px; min-height: 78px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">B</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>([[<span class="cm-number">6</span>,<span class="cm-number">2</span>,<span class="cm-number">1</span>,<span class="cm-number">7</span>,<span class="cm-number">5</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">2</span>,<span class="cm-number">8</span>,<span class="cm-number">5</span>,<span class="cm-operator">-</span><span class="cm-number">4</span>,<span class="cm-number">1</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">1</span>,<span class="cm-operator">-</span><span class="cm-number">6</span>,<span class="cm-number">3</span>,<span class="cm-number">2</span>,<span class="cm-number">8</span>]], <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>)</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis</span>(<span class="cm-variable">B</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 78px;"></div><div class="CodeMirror-gutters" style="display: none; height: 91px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[7]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.93704257, -0.12700832, -0.32530002, 0. , 0. ],
[ 0.31234752, 0.72140727, 0.61807005, 0. , 0. ],
[ 0.15617376, -0.6807646 , 0.71566005, 0. , 0. ]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered selected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [8]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 105.625px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 103.031px; margin-bottom: -17px; border-right-width: 13px; min-height: 28px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style=""><div class="CodeMirror-cursor" style="left: 100.031px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">dimensions</span><span class=" CodeMirror-matchingbracket">(</span><span class="cm-variable">B</span><span class=" CodeMirror-matchingbracket">)</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 28px;"></div><div class="CodeMirror-gutters" style="display: none; height: 41px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[8]:</div><div class="output_subarea output_text output_result"><pre>3.0</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [9]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 741.667px; margin-bottom: -17px; border-right-width: 13px; min-height: 95px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code" style=""><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-comment"># Now let's see what happens when we have one vector that is a linear combination of the others.</span></span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">C</span> = <span class="cm-variable">np</span>.<span class="cm-property">array</span>([[<span class="cm-number">1</span>,<span class="cm-number">0</span>,<span class="cm-number">2</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">0</span>,<span class="cm-number">1</span>,<span class="cm-operator">-</span><span class="cm-number">3</span>],</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"> [<span class="cm-number">1</span>,<span class="cm-number">0</span>,<span class="cm-number">2</span>]], <span class="cm-variable">dtype</span>=<span class="cm-variable">np</span>.<span class="cm-property">float_</span>)</span></pre><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">gsBasis</span>(<span class="cm-variable">C</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 95px;"></div><div class="CodeMirror-gutters" style="display: none; height: 108px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[9]:</div><div class="output_subarea output_text output_result"><pre>array([[ 0.70710678, 0. , 0. ],
[ 0. , 1. , 0. ],
[ 0.70710678, 0. , 0. ]])</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell rendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [10]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 103.031px; margin-bottom: -17px; border-right-width: 13px; min-height: 28px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span class="cm-variable">dimensions</span>(<span class="cm-variable">C</span>)</span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 28px;"></div><div class="CodeMirror-gutters" style="display: none; height: 41px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to scroll output; double click to hide" style=""></div><div class="output" style=""><div class="output_area"><div class="prompt output_prompt"><bdi>Out</bdi>[10]:</div><div class="output_subarea output_text output_result"><pre>2.0</pre></div></div></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div><div class="cell code_cell unrendered unselected" tabindex="2"><div class="input"><div class="prompt input_prompt"><bdi>In</bdi> [ ]:</div><div class="inner_cell"><div class="ctb_hideshow"><div class="celltoolbar"></div></div><div class="input_area"><div class="CodeMirror cm-s-ipython"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 5.59375px; left: 5.59375px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-vscrollbar" cm-not-content="true"><div style="min-width: 1px; height: 0px;"></div></div><div class="CodeMirror-hscrollbar" cm-not-content="true"><div style="height: 100%; min-height: 1px; width: 0px;"></div></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; min-width: 3px; margin-bottom: -17px; border-right-width: 13px; min-height: 28px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines"><div style="position: relative; outline: none;"><div class="CodeMirror-measure"></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-cursors" style="visibility: hidden;"><div class="CodeMirror-cursor" style="left: 0px; top: 0px; height: 16.6667px;"> </div></div><div class="CodeMirror-code"><pre class=" CodeMirror-line "><span style="padding-right: 0.1px;"><span cm-text=""></span></span></pre></div></div></div></div></div><div style="position: absolute; height: 13px; width: 1px; border-bottom: 0px solid transparent; top: 28px;"></div><div class="CodeMirror-gutters" style="display: none; height: 41px;"></div></div></div></div></div></div><div class="output_wrapper"><div class="out_prompt_overlay prompt" title="click to expand output; double click to hide output" style="display: none;"></div><div class="output" style="display: none;"></div><div class="btn btn-default output_collapsed" title="click to expand output" style="display: none;">. . .</div></div></div></div><div class="end_space"></div></div>
<div id="tooltip" class="ipython_tooltip" style="display:none"><div class="tooltipbuttons"><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" role="button" class="ui-button"><span class="ui-icon ui-icon-close">Close</span></a><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" class="ui-corner-all" role="button" id="expanbutton" title="Grow the tooltip vertically (press shift-tab twice)"><span class="ui-icon ui-icon-plus">Expand</span></a><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" role="button" class="ui-button" title="show the current docstring in pager (press shift-tab 4 times)"><span class="ui-icon ui-icon-arrowstop-l-n">Open in Pager</span></a><a href="https://rygipkxnkzwrgncouxukpx.coursera-apps.org/notebooks/GramSchmidtProcess.ipynb#" role="button" class="ui-button" title="Tooltip will linger for 10 seconds while you type" style="display: none;"><span class="ui-icon ui-icon-clock">Close</span></a></div><div class="pretooltiparrow"></div><div class="tooltiptext smalltooltip"></div></div>
</div>
</div>
</div>
<div id="pager" class="ui-resizable">
<div id="pager-contents">
<div id="pager-container" class="container"></div>
</div>
<div id="pager-button-area"><a role="button" title="Open the pager in an external window" class="ui-button"><span class="ui-icon ui-icon-extlink"></span></a><a role="button" title="Close the pager" class="ui-button"><span class="ui-icon ui-icon-close"></span></a></div>
<div class="ui-resizable-handle ui-resizable-n" style="z-index: 90;"></div></div>
<script type="text/javascript">
sys_info = {"notebook_version": "5.0.0", "notebook_path": "/opt/conda/lib/python3.6/site-packages/notebook", "commit_source": "", "commit_hash": "", "sys_version": "3.6.2 | packaged by conda-forge | (default, Jul 23 2017, 22:59:30) \n[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]", "sys_executable": "/opt/conda/bin/python", "sys_platform": "linux", "platform": "Linux-4.14.70-67.55.amzn1.x86_64-x86_64-with-debian-stretch-sid", "os_name": "posix", "default_encoding": "UTF-8"};
</script>
<script src="./GramSchmidtProcess_files/encoding.js.download" charset="utf-8"></script>
<script src="./GramSchmidtProcess_files/main.min.js.download" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
function _remove_token_from_url() {
if (window.location.search.length <= 1) {
return;
}
var search_parameters = window.location.search.slice(1).split('&');
for (var i = 0; i < search_parameters.length; i++) {
if (search_parameters[i].split('=')[0] === 'token') {
// remote token from search parameters
search_parameters.splice(i, 1);
var new_search = '';
if (search_parameters.length) {
new_search = '?' + search_parameters.join('&');
}
var new_url = window.location.origin +
window.location.pathname +
new_search +
window.location.hash;
window.history.replaceState({}, "", new_url);
return;
}
}
}
_remove_token_from_url();
</script>
<div style="position: absolute; width: 0px; height: 0px; overflow: hidden; padding: 0px; border: 0px; margin: 0px;"><div id="MathJax_Font_Test" style="position: absolute; visibility: hidden; top: 0px; left: 0px; width: auto; padding: 0px; border: 0px; margin: 0px; white-space: nowrap; text-align: left; text-indent: 0px; text-transform: none; line-height: normal; letter-spacing: normal; word-spacing: normal; font-size: 40px; font-weight: normal; font-style: normal;"></div></div></body></html>