# Revision history [back]

### Matrix projection blues

Hi on OpenCourseware MIT site: Lecture 15: Projections onto subspaces

code on sagecell.sagemath.org

Q1:
p is the b projected vector on vector a
below all letters are matrices
E=B-P with P=X*A
E=B-X*A as E perpendicular to A => dot product(A,E)) = 0 means A.transpose()*E=0
then A^T*(B-X*A)=0 so A^T*(X*A)=A^T*B (and this is false !)
but Gilbert Strang write X*A^T*A=A^T*B (and this is good !)
but we are not allowed to commute A^T*X*A by X*A^T*A if X is a matrix !
I know I made a mistake in my raisonning but I fail to find it !

Q2 : Why I must write  X=A * (A.transpose())/(( (A.transpose()) * A ).det())
instead of             X=A * (A.transpose())/(( (A.transpose()) * A ))
why I need to add .det() ?


### Matrix projection blues

Hi on OpenCourseware MIT site: Lecture 15: Projections onto subspaces

Q1:
p is the b projected vector on vector a
below all letters are matrices
E=B-P with P=X*A
E=B-X*A as E perpendicular to A => dot product(A,E)) = 0 means A.transpose()*E=0
then A^T*(B-X*A)=0 so A^T*(X*A)=A^T*B (and this is false !)
but Gilbert Strang write X*A^T*A=A^T*B (and this is good !)
but we are not allowed to commute A^T*X*A by X*A^T*A if X is a matrix !
I know I made a mistake in my raisonning but I fail to find it !

Q2 : Why I must write  X=A * (A.transpose())/(( (A.transpose()) * A ).det())
instead of             X=A * (A.transpose())/(( (A.transpose()) * A ))
why I need to add .det() ?


### Matrix projection blues

Hi on OpenCourseware MIT site: Lecture 15: Projections onto subspaces

Q1:
p is the b projected vector on vector a
below all letters are matrices
E=B-P with P=X*A
E=B-X*A as E perpendicular to A => dot product(A,E)) = 0 means A.transpose()*E=0
then A^T*(B-X*A)=0 so A^T*(X*A)=A^T*B (and this is false !)
but Gilbert Strang write X*A^T*A=A^T*B (and this is good !)
but we are not allowed to commute A^T*X*A by X*A^T*A if X is a matrix !
I know I made a mistake in my raisonning but I fail to find it !

Q2 : Why I must write  X=A * (A.transpose())/(( (A.transpose()) * A ).det())
instead of             X=A * (A.transpose())/(( (A.transpose()) * A ))
why I need to add .det() ?


### Matrix projection blues

Hi on OpenCourseware MIT site: Lecture 15: Projections onto subspaces

[edited :the code on sagecell.sagemath.org sagecell sagemath org was not the good one !]! it was the first version I wrote. when I updated the code in the cell, that does not work, I had to open a new cell]

code on sagecell sagemath org

Q1:
p is the b projected vector on vector a
below all letters are matrices
E=B-P with P=X*A
E=B-X*A as E perpendicular to A => dot product(A,E)) = 0 means A.transpose()*E=0
then A^T*(B-X*A)=0 so A^T*(X*A)=A^T*B (and this is false !)
but Gilbert Strang write X*A^T*A=A^T*B (and this is good !)
but we are not allowed to commute A^T*X*A by X*A^T*A if X is a matrix !
I know I made a mistake in my raisonning but I fail to find it !

Q2 : Why I must write  X=A * (A.transpose())/(( (A.transpose()) * A ).det())
instead of             X=A * (A.transpose())/(( (A.transpose()) * A ))
why I need to add .det() ?