Trace of Matrix
If (X) is a square matrix, the sum of its diagonal elements is called the trace.
⚠️**:** Trace is defined only for square matrices.
X=123654100(3×3)
Diag(X)=150
Tr(X)=1+5+0=6
Matrix Inner Product
If (X,Y) are two matrices of the same size, then
⚠️ Correction: must be same dimensions.
⟨X,Y⟩=Tr(XYT)
Also,
⟨Y,X⟩=Tr(YXT)
And
✅ Important property added
⟨X,Y⟩=⟨Y,X⟩
Example
X=123013241Y=01321210−1
YT=02111032−1
XYT=[211 634 7614]
Tr(XYT)=2+3+14=19
Transpose Properties
Property 1
(XT)T=X
Example
X=123456
XT=[142536]
(XT)T=X
Property 2
⚠️ Correction (important):
(XY)T=YTXT
NOT
XTYT
Example
X=[1123]Y=[3051]
XY=
[3378]
(XY)T=[3738]
Now compute
YTXT
YT=[3501]XT=[1213]
YTXT=[3738]
Matches ✔️
Example 2 (Inner Product)
X=[1201]Y=[1210]
YT=[1120]
⟨X,Y⟩=Tr(XYT)
XYT=[1324]
=1+4=5
Also
⟨Y,X⟩=Tr(YXT)=5
Classwork
1. (YTx)
YT=[12 33 01](3×2)
x=[12](2×1)
YTx=[5 9 2]
2. Hadamard Product
Z⊙Z=101021011⊙101021011
101041011
3. (2Zy)
2101021011313
61014
4. (<x,x>)
⟨x,x⟩=Tr(xxT)
Tr[1001]=2
5. Outer Product
x⊗y=xyT
[12][313]=[361236]
6. $Diag(x
)$
Diag([1001])
=[11]
7. Trace
Tr(Z)=1+2+1=4
8. (xTYz)
xTYz
[12]
[123301]
130
[592]
130=32
Vector Outer Product
v⊗v=vvT
[xy][xy]=[x2xyxyy2]
Trace of Outer Product
⚠️**:** result must be scalar
Tr(v⊗v)=x2+y2
AX=B
[1324][56]=[1739]
This represents a linear transformation
R2→R2
System:
x+2y=17
3x+4y=39
Solution
y=6x=5
Row Operation Rules
You can:
- Multiply equation by constant
- Swap equations
- Add/subtract equations
These are elementary row operations.