Errata for Edition 1 of Coding the Matrix, January 13, 2017

Similar documents
Analysis of Arithmetic. Analysis of Arithmetic. Analysis of Arithmetic Round-Off Errors. Analysis of Arithmetic. Analysis of Arithmetic

CMSC 425: Lecture 5 More on Geometry and Geometric Programming

Polar Coordinates. a) (2; 30 ) b) (5; 120 ) c) (6; 270 ) d) (9; 330 ) e) (4; 45 )

Recognizable Infinite Triangular Array Languages

Online-routing on the butterfly network: probabilistic analysis

Political Science 552

Stanford University CS259Q: Quantum Computing Handout 8 Luca Trevisan October 18, 2012

MODULE 5a and 5b (Stewart, Sections 12.2, 12.3) INTRO: In MATH 1114 vectors were written either as rows (a1, a2,..., an) or as columns a 1 a. ...

A Bijective Approach to the Permutational Power of a Priority Queue

Probabilistic number theory : A report on work done. What is the probability that a randomly chosen integer has no square factors?

556: MATHEMATICAL STATISTICS I

A STUDY OF HAMMING CODES AS ERROR CORRECTING CODES

18.06 Problem Set 4 Solution

H5 Gas meter calibration

Physics 121 Hour Exam #5 Solution

Analysis of Finite Word-Length Effects

Physics 107 TUTORIAL ASSIGNMENT #8

Chapter 5 Linear Equations: Basic Theory and Practice

Problem Set #10 Math 471 Real Analysis Assignment: Chapter 8 #2, 3, 6, 8

Phys 201A. Homework 5 Solutions

k. s k=1 Part of the significance of the Riemann zeta-function stems from Theorem 9.2. If s > 1 then 1 p s

c( 1) c(0) c(1) Note z 1 represents a unit interval delay Figure 85 3 Transmit equalizer functional model

Circular Motion & Torque Test Review. The period is the amount of time it takes for an object to travel around a circular path once.

MAC Module 12 Eigenvalues and Eigenvectors

On the stability of the polynomial L 2 -projection on triangles and tetrahedra

Auchmuty High School Mathematics Department Advanced Higher Notes Teacher Version

Physics 11 Chapter 3: Vectors and Motion in Two Dimensions. Problem Solving

PHYS Summer Professor Caillault Homework Solutions. Chapter 9

Chromatic number and spectral radius

Version 1.0. General Certificate of Education (A-level) June Mathematics MM04. (Specification 6360) Mechanics 4. Final.

Rigid Body Dynamics 2. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2018

Chapter 3: Theory of Modular Arithmetic 38

V V The circumflex (^) tells us this is a unit vector

arxiv:math/ v2 [math.ag] 21 Sep 2005

10/04/18. P [P(x)] 1 negl(n).

COLLAPSING WALLS THEOREM

Complex Eigenvalues. Prepared by Vince Zaccone For Campus Learning Assistance Services at UCSB

1 Spherical multipole moments

Physics 2A Chapter 10 - Moment of Inertia Fall 2018

PDF Created with deskpdf PDF Writer - Trial ::

Lecture 8 - Gauss s Law

An Estimate of Incomplete Mixed Character Sums 1 2. Mei-Chu Chang 3. Dedicated to Endre Szemerédi for his 70th birthday.

MATH 220: SECOND ORDER CONSTANT COEFFICIENT PDE. We consider second order constant coefficient scalar linear PDEs on R n. These have the form

Fall 2014 Randomized Algorithms Oct 8, Lecture 3

FREE Download Study Package from website: &

Pledge: Signature:

EM Boundary Value Problems

BEST CONSTANTS FOR UNCENTERED MAXIMAL FUNCTIONS. Loukas Grafakos and Stephen Montgomery-Smith University of Missouri, Columbia

A Crash Course in (2 2) Matrices

HW Solutions # MIT - Prof. Please study example 12.5 "from the earth to the moon". 2GmA v esc

PROBLEM SET #1 SOLUTIONS by Robert A. DiStasio Jr.

3.6 Applied Optimization

Scientific Computing II

Conjugate Gradient Methods. Michael Bader. Summer term 2012

When a mass moves because of a force, we can define several types of problem.

Quantum Fourier Transform

DESIGN OF BEAMS FOR MOMENTS

arxiv: v1 [math.co] 1 Apr 2011

INTRODUCTION. 2. Vectors in Physics 1

Physics 161 Fall 2011 Extra Credit 2 Investigating Black Holes - Solutions The Following is Worth 50 Points!!!

Trigonometry Standard Position and Radians

Section 8.2 Polar Coordinates

As is natural, our Aerospace Structures will be described in a Euclidean three-dimensional space R 3.

3.1 Random variables

When two numbers are written as the product of their prime factors, they are in factored form.

Math 301: The Erdős-Stone-Simonovitz Theorem and Extremal Numbers for Bipartite Graphs

QIP Course 10: Quantum Factorization Algorithm (Part 3)

Permutations and Combinations

c n ψ n (r)e ient/ h (2) where E n = 1 mc 2 α 2 Z 2 ψ(r) = c n ψ n (r) = c n = ψn(r)ψ(r)d 3 x e 2r/a0 1 πa e 3r/a0 r 2 dr c 1 2 = 2 9 /3 6 = 0.

Kepler s problem gravitational attraction

Physics 181. Assignment 4

The Chromatic Villainy of Complete Multipartite Graphs

Physics 111 Lecture 10. SJ 8th Ed.: Chap Torque, Energy, Rolling. Copyright R. Janow Spring basics, energy methods, 2nd law problems)

Information Retrieval Advanced IR models. Luca Bondi

Physics 4A Chapter 8: Dynamics II Motion in a Plane

THE JEU DE TAQUIN ON THE SHIFTED RIM HOOK TABLEAUX. Jaejin Lee

Reading Assignment. Problem Description for Homework #9. Read Chapters 29 and 30.

Approximating the minimum independent dominating set in perturbed graphs

Triangulating the Real Projective Plane MACIS 07

CALCULUS II Vectors. Paul Dawkins

arxiv: v2 [stat.ml] 25 Aug 2015

EE 5337 Computational Electromagnetics

Physics Courseware Physics II Electric Field and Force

Topic 4a Introduction to Root Finding & Bracketing Methods

6 PROBABILITY GENERATING FUNCTIONS

RATIONAL BASE NUMBER SYSTEMS FOR p-adic NUMBERS

Temporal-Difference Learning

ENGI 4430 Non-Cartesian Coordinates Page xi Fy j Fzk from Cartesian coordinates z to another orthonormal coordinate system u, v, ˆ i ˆ ˆi

Dorin Andrica Faculty of Mathematics and Computer Science, Babeş-Bolyai University, Cluj-Napoca, Romania

Describing Circular motion

Berkeley Math Circle AIME Preparation March 5, 2013

Numerical solution of the first order linear fuzzy differential equations using He0s variational iteration method

Supplementary information Efficient Enumeration of Monocyclic Chemical Graphs with Given Path Frequencies

COORDINATE TRANSFORMATIONS - THE JACOBIAN DETERMINANT

Phys 1215, First Test. September 20, minutes Name:

Exam 3, vers Physics Spring, 2003

Magnetometer Calibration Algorithm Based on Analytic Geometry Transform Yongjian Yang, Xiaolong Xiao1,Wu Liao

5. Properties of Abstract Voronoi Diagrams

( ) Make-up Tests. From Last Time. Electric Field Flux. o The Electric Field Flux through a bit of area is

Physics 235 Chapter 5. Chapter 5 Gravitation

Transcription:

Eata fo Edition of Coding the Matix, Januay 3, 07 You coy might not contain some of these eos. Most do not occu in the coies cuently being sold as Ail 05. Section 0.3:... the inut is a e-image of the inut... the inut is a e-image of the outut. Figue 4 in Section 0.3.8: The figue as follows: g f A A f g B B 3 C C 3 f - A g - A (f g) - =g - f - B B C C 3 3 Definition 0.3.4: thee exists x A such that f(x) = z thee exists x D such that f(x) = z. Section 4=0.4.4:...the cytogahe changes the scheme simly by emoving as a ossible value fo... as a ossible value fo k. Section 0.5.4: At the end of the section labeled Mutating a set, >>> U=S.coy() >>> U.add(5) >>> S {, 3} should end with >>> S {6} Poblem 0.8.5: ow() ow(, n). Section.4.: Using the fact that i = Using the fact that i = Section.4.5: The diagam illustating otation by 90 degees is incoect. The dots should fom vetical lines to the left of the y-axis. Task.4.8 and.4.9: The figues accomanying these tasks ae incoect; they involve otation by -90 degees (i.e. 90 degees clockwise) instead of 90 degees (i.e. 90 degees counteclockwise). Task.4.0: image.fileimage(filename) etuns a eesentation of a colo image, namely a list of lists of 3-tules. Fo the uose of this task, you must tansfom it to a eesentation of a gayscale image, using image.cologay( ). Also, the ixel intensities ae numbes between 0 and 55, not between 0 and. In this task, you should assign to ts the list of comlex numbes x + iy such that the image intensity of ixel (x, y) is less than 0. Task.4.: The task mentions ts but S is intended. Section.3: We ve seen two examles of what we can eesent with vectos: multisets and sets. Actually, we ve only seen multisets.

Section.4.: o fom [ 4, 4 to [ 3, o fom [ 4, 4 to [ 3,. Examle.6.8: Fo α =.75, β =.5, αu + βv [6.5, 0, not [6.5,. Section.8.3: Hee is an examle of solving an instance of the 3 3 uzzle Hee is an examle of one ste towads solving an instance of the 3 3 uzzle. Examle.9.: Conside the dot-oduct of [,,,, with [0, 0, 0, 40, 00 Conside the dot-oduct of [,,,, with [0, 0, 0, 40, 00. Section.9.:...in tems of five linea euations......in tems of thee linea euations.... Examle.9.5: cost = Vec(D, {hos : $.50/ounce, malt : $.50/ound, wate : $0.006}, yeast : $0.45/gam) cost = Vec(D, {hos : $.50/ounce, malt : $.50/ound, wate : $0.006, yeast : $0.45/gam}) Definition.9.6: A linea euation is an euation of the fom a = β, whee... is a vecto vaiable. A linea euation is an euation of the fom a x = β, whee... x is a vecto vaiable. Examle.9.7: The total enegy is not 65J but is 0.0845J, as the Python shows. Quiz.9.9: The total enegy consumed in the last ow of the table J, not W. Definition.9.0: In geneal, a system of linea euations (often abbeviated linea system) is a collection of euations: a = β a = β a m = β m whee is a vecto vaiable. A solution is a vecto ˆ that satisfies all the euations. In geneal, a system of linea euations (often abbeviated linea system) is a collection of euations: a x = β a x = β a m x = β m whee x is a vecto vaiable. A solution is a vecto ˆx that satisfies all the euations. Quiz.9.3: The solution The dot-oducts ae [,, 0, 0. Quiz.9.4: The solution [4, 0, 6, 3... Quiz.9.5: In the solution, the ange ange(len(haystack)-s+), not ange(len(haystack)-s). Examle.9.7: The asswod is ˆ = 0 The asswod is ˆx = 0,

Hay comutes the dot-oduct a ˆ Hay comutes the dot-oduct a ˆx Hay comutes the dot-oduct a ˆ Hay comutes the dot-oduct a ˆx Caole lets Hay log in if β = a ˆ, β = a ˆ,..., β k = a k ˆ. Caole lets Hay log in if β = a ˆx, β = a ˆx,..., β k = a k ˆx. Examle.9.8: Eve can use the distibutive oety to comute the dot-oduct of this sum with the asswod even though she does not know the asswod: (00 + 0) = 00 + 0 = 0 + = Eve can use the distibutive oety to comute the dot-oduct of this sum with the asswod x even though she does not know the asswod: (00 + 0) x = 00 x + 0 x = 0 + = Task..8: Did you get the same esult as in Task??? Did you get the same esult as in Task..7? Quiz 3..7: the solution def lin_comb(vlist,clist): etun sum([coeff*v fo (c,v) in zi(clist, vlist)) def lin_comb(vlist,clist): etun sum([coeff*v fo (coeff,v) in zi(clist, vlist)) Section 3..4: The eesentation of the old geneato [0, 0, in tems of the new geneatos [, 0, 0, [,, 0, and [,, [0, 0, = 0 [, 0, 0 [,, 0 + [,, In Examle 3..7, The secet asswod is a vecto ˆ ove GF ()... the human must esond with the dot-oduct a ˆ. The secet asswod is a vecto ˆx ove GF ()... the human must esond with the dot-oduct a ˆx. Examle 3.3.0: This line can be eesented as San {[,, } This line can be eesented as San {[,, } In Examle 3.5., Thee is one lane though the oints u = [, 0, 4.4, u = [0,, 4, and u = [0, 0, 3 Thee is one lane though the oints u = [, 0, 4.4, u = [0,, 4, and u 3 = [0, 0, 3. Section 4..4: The etty-inted fom of M >>> int(m) # @? --------- a 3 b 0 0 30 3

fo some ode of the columns. Quiz 4..9: The given imlementation of matowdict will not wok until you have imlemented the getitem ocedue in mat.y. Quiz 4.3.: The etty-inted fom of matvec(m) >>> int(matvec(m)) ( a, # ) ( a,? ) ( a, @ ) ( b, # ) ( b,? ) ( b, @ ) ------------------------------------------------------------------ 3 0 30 0 fo some ode of the columns. Quiz 4.4.: The etty-inted fom of tansose(m) >>> int(tansose(m)) a b ------ # 0 @ 0? 3 30 fo some ode of the ows. lowe-case f. Also, in the solution, the ue-case F elaced with a Examle 4.6.6: The matix-vecto oduct [, 3,, 4,,,, 0,, 0. Definition 4.6.9: An n n ue-tiangula matix A is a matix with the oety that A ij = 0 fo j > i fo i > j. Section 4.7.: Alying Lemma 4.7.4 with v = u Lemma 4.7.4 with v = u and z = u u and z = u u Alying Section 4.7.4: because it is the same as H c, which she can comute because it is the same as H c, which she can comute Section 4.9.3: The URL htt://xkcd.com/84 tts://xkcd.com/84/. Section 4..: and hee is the same diagam with the walk 3 c e 4 shown and hee is the same diagam with the walk 3 c e 4 e shown Examle 4..9: g f([x, x ) [x + x, x + x. Examle 4..5: The last matix (in the thid ow) indicating tansose: = [ 7 4 9 8 Examle 4.3.5: xvec x and xvec x. T [ 7 9 4 8. a suescit T The descition of Task 4.4. comes befoe the heading Task 4.4.. Section 4.5 (Geomety Lab): osition is used synonymously with location. Section 4.4.6: Hint: this uses the secial oety of the ode of H s ows Hint: this uses the secial oety of the ode of H s columns. 4

Poblem 4.7.0 is the same as Poblem 4.7.5. Poblem 4.7.8: Fo this ocedue, the only oeation you ae allowed to do on A is vecto-matix multilication, using the * oeato: v*a. Fo this ocedue, the only oeation you ae allowed to do on B is vecto-matix multilication, using the * oeato: v*b. Poblem 4.7.: xvec x. Section 5.3.: The Gow algoithm : def Gow(V) B = eeat while ossible: find a vecto v in V that is not in San B, and ut it in B. Examle 5.3.: Finally, note that San B = R and that neithe v no v alone could geneate R R 3. Section 5.4.3: Let D be the set of nodes, e.g. D = {Pemboke, Athletic, Main, Keeney, Wiston} D = {Pemboke, Athletic, Bio-Med, Main, Keeney, Wiston, Gegoian} Section 5.9.: The fist vecto a goes hoizontally fom the to-left cone of the whiteboad element to the to-ight cone The fist vecto a goes hoizontally fom the toleft cone of the to-left senso element to the to-ight cone and The second vecto a goes vetically fom the to-left cone of whiteboad to the bottom-left cone The second vecto a goes vetically fom the to-left cone of the to-left senso element to the bottom-left cone. L = [[0,0,0,[,0,0,[0,,0,[,,0,[0,0,,[,0,,[0,,,[,, L = [[0,0,0,[,0,0,[0,,0,[,,0,[0,0,,[,0,,[0,,,[,, Section 5.9., diagam: The oint in the bottom-left-back of the cube labeled (0,,) but is labeled (0,,0). Section 5.9.5: In Fo the thid basis vecto a... and Remembe that a oints fom the camea cente to the to-left cone of the senso aay, so a = (.5,.5, ), a a 3, and a 3 = [0, 0,. The thid vecto in cb has an exta 0. The thid vecto c 3 goes fom the oigin (the camea cente) to the to-ight cone of whiteboad. The thid vecto c 3 goes fom the oigin (the camea cente) to the to-left cone of the whiteboad. Section 5..: Section 5..6: The vecto x xvec Section 5..6: Afte Task 5.., Let [y, y, y 3 = Hx Let [y, y, y 3 = Ĥx. Poblem 5.4.8: Wite and test a ocedue sueset basis(s, L) Wite and test a ocedue sueset basis(t, L). Lemma 6..3 (Sueset-Basis Lemma) states x x 5

Fo any vecto sace V and any linealy indeendent set A of vectos, V has a basis that contains all of A. but should state Fo any vecto sace V and any linealy indeendent set A of vectos belonging to V, V has a basis that contains all of A. [ 0 0 Examle 6.3.3: V is defined to be the null sace of but defined to 0 0 be the null sace of [ 0 0 0 0. Poblem 6.7.3: The outut condition says fo i =,,..., k, but should say fo i =,,..., k, San S = San S {z, z,..., z i } {w, w,..., w k } San S = San S {z, z,..., z i } {w, w,..., w i } Section 7.7.: xvec and xvec x and x Section 7.7.4: Geneating mathbf u Geneating u. Section 7.8.3: We can eesent the factoization of 76 by the list [(, 3), (5, ), indicating that 76 is obtained by multiying togethe thee s and two 5 s We can eesent the factoization of 76 by the list [(, 3), (3, ), (7, ), indicating that 76 is obtained by multilying togethe thee s, one 3 and two 7 s, and 76 = 3 5 76 = 3 3 7. Task 7.8.7: Fo x = 6, the factoed enty has 3 7 3. This 3 7 3. Task 7.8.9: gcd(a, b) gcd(a b, N). Section 9.: In new sec fo oject othogonal(b, vlist), outut the ojection b of b othogonal to the vectos in vlist Examle 9.4.: The math is misfomatted; thee a line-beak just befoe b. That is, the math should state that b = [, 3.5, 0.5 and that b = b b0,v v,v v = b [0, 3, 3 = [,,. Section 9.6.6: These vectos san the same sace as inut vectos u,..., u k, w,..., w n... The * in w n should not be thee. Section 9.6.6: In the seudocode fo find othogonal comlement, the last line Retun [ Poof of Lemma 0.6.: The fist line of the last seuence of euations, ω c = ((ω c ) 0 + (ω c ) + (ω c ) + + (ω c ) n + (ω c ) n ) ω c z = ω c ((ω c ) 0 + (ω c ) + (ω c ) + + (ω c ) n + (ω c ) n ) Task 0.9.6: The ocedue image ound should also ensue the numbes ae between 0 and 55. Poof of Lemma.3.6: Let V be the sace dual to V Let V be the annihilato of V, and the dual of the dual the annihilato of the annihilato. 6

Section.3.3:...we ovide a module svd with a ocedue facto(a) that, given a Mat A, etuns a tile (U, Sigma, V) such that A = U * Sigma * V.tansose should end such that A = U * Sigma * V.tansose() Poof of Lemma.3.: which euals ( a + + a m ) + be which euals ( a + + a m ) ( a V + + a V m ) ( a V + + a V m ) should Section.3.5, Poof of Theoem.3.: Thee is a coected oof at htt://codingthematix.com/oof-that-fist-k-ight-singula-vectos-san-closest-sace0. df Section.3.0: Thee is a coected oof at htt://codingthematix.com/oof-that-u-is-column-othogonal0.df. Task.6.6, To hel you debug, alying the ocedue to with To hel you debug, alying the ocedue with Section.4.: The ocedue SVD solve(a) should take the vecto b as a second agument: SVD solve(a, b). Section.6 (Eigenfaces Lab): {x,y fo x in ange(66) fo y in ange(89)} {(x,y) fo x in ange(66) fo y in ange(89)}. Section..: The diagonal matix Λ is used shotly befoe it is defined. Poblem.4.8: Eo in statement of Lemma.4. The eigenvalue of A having smallest asolute value is the eciocal of the eigenvalue of A having lagest absolute value. Section.8.: xvec (t) just x (t). Section.8.: In the euation λ Λ. [ x (t) x (t) = ( SλS ) t [ x (0) x (0) Section.8.: xvec (t) x (t) and xvec (0) x (0). Section.8.4: Once consecutive addesses have been euested in timestes t and t +, it is vey likely that the addess euested in timeste t + is also consecutive should end that the addess euested in timeste t + is also consecutive. Section..: The theoem in Section.8... Thee is no theoem in that section; the theoem (the Peon-Fobenius Theoem) is not stated in the text. Section..3: The eigenvecto given fo the test case fo Task..3 is wong; the coect eigenvecto is oughly {: 0.5, : 0.68, 3: 0.5738, 4: 0.0705, 5: 0.0783, 6: 0.0705}. 7