Projection Matrix Calculation for Vectors a_k: P_6P_5P_4P_3P_2P_1a_0

In summary, a projection matrix is a square matrix used to transform a vector onto a lower-dimensional subspace by projecting it onto a set of basis vectors. It is calculated by taking the dot product of a vector with each basis vector and arranging the results into a matrix. The purposes of using a projection matrix include simplifying transformations in linear algebra, computer graphics, and reducing the dimensionality of datasets in machine learning and data analysis. The order of basis vectors does not affect the calculation, but the order of the projection matrix does affect the resulting projection. Projection matrices can be applied to any vector as long as the dimensions are compatible.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

We have the vectors $\displaystyle{a_k=\begin{pmatrix}\cos \frac{k\pi}{3} \\ \sin \frac{k\pi}{3}\end{pmatrix}, \ k=0, 1, \ldots , 6}$. Let $P_k$ be the projection matrix onto $a_k$.
Calculate $P_6P_5P_4P_3P_2P_1a_0$. Are the elements of the projection matrix defined as $P_{ij}=\frac{a_ij_j}{a\cdot a}$ ? (Wondering)
 
Physics news on Phys.org
  • #2
mathmari said:
Hey! :eek:

We have the vectors $\displaystyle{a_k=\begin{pmatrix}\cos \frac{k\pi}{3} \\ \sin \frac{k\pi}{3}\end{pmatrix}, \ k=0, 1, \ldots , 6}$. Let $P_k$ be the projection matrix onto $a_k$.
Calculate $P_6P_5P_4P_3P_2P_1a_0$. Are the elements of the projection matrix defined as $P_{ij}=\frac{a_ij_j}{a\cdot a}$ ?

Hey mathmari!

What do you mean by $a_ij_j$? (Wondering)

Btw, $a$ is of unit length isn't it? So $a\cdot a=1$. (Thinking)

The projection onto $a_k$ is:
$$P_k(x) = (x\cdot a_k)a_k = a_k(a_k^T x)=(a_k a_k^T)x$$
So the elements of the matrix $P_k$ are $(P_k)_{ij} = a_{k,i} a_{k,j}$.
Oh, is that what you meant? (Wondering)
 
  • #3
Klaas van Aarsen said:
What do you mean by $a_ij_j$? (Wondering)

Btw, $a$ is of unit length isn't it? So $a\cdot a=1$. (Thinking)

The projection onto $a_k$ is:
$$P_k(x) = (x\cdot a_k)a_k = a_k(a_k^T x)=(a_k a_k^T)x$$
So the elements of the matrix $P_k$ are $(P_k)_{ij} = a_{k,i} a_{k,j}$.
Oh, is that what you meant? (Wondering)

Yes, that is what I meant, I didn't use the correct symbols. (Blush) So we get the following:
\begin{align*}&P_1=\begin{pmatrix}\cos^2\frac{\pi}{3} & \sin\frac{\pi}{3}\cos\frac{\pi}{3} \\ \sin\frac{\pi}{3}\cos\frac{\pi}{3} & \sin^2\frac{\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_2=\begin{pmatrix}\cos^2\frac{2\pi}{3} & \sin\frac{2\pi}{3}\cos\frac{2\pi}{3} \\ \sin\frac{2\pi}{3}\cos\frac{2\pi}{3} & \sin^2\frac{2\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_3=\begin{pmatrix}\cos^2\frac{3\pi}{3} & \sin\frac{3\pi}{3}\cos\frac{3\pi}{3} \\ \sin\frac{3\pi}{3}\cos\frac{3\pi}{3} & \sin^2\frac{3\pi}{3} \end{pmatrix}=\begin{pmatrix}\cos^2\pi & \sin\pi\cos\pi \\ \sin\pi\cos\pi & \sin^2\pi \end{pmatrix}=\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix} \\ & P_4=\begin{pmatrix}\cos^2\frac{4\pi}{3} & \sin\frac{4\pi}{3}\cos\frac{4\pi}{3} \\ \sin\frac{4\pi}{3}\cos\frac{4\pi}{3} & \sin^2\frac{4\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_5=\begin{pmatrix}\cos^2\frac{5\pi}{3} & \sin\frac{5\pi}{3}\cos\frac{5\pi}{3} \\ \sin\frac{5\pi}{3}\cos\frac{5\pi}{3} & \sin^2\frac{5\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_6=\begin{pmatrix}\cos^2\frac{6\pi}{3} & \sin\frac{6\pi}{3}\cos\frac{6\pi}{3} \\ \sin\frac{6\pi}{3}\cos\frac{6\pi}{3} & \sin^2\frac{6\pi}{3} \end{pmatrix}=\begin{pmatrix}\cos^2\left (2\pi\right ) & \sin\left (2\pi\right )\cos\left (2\pi\right ) \\ \sin\left (2\pi\right )\cos\left (2\pi\right ) & \sin^2\left (2\pi\right ) \end{pmatrix}=\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\end{align*}

Therefore the result that we are looking for is:
\begin{align*}P_6P_5P_4P_3P_2P_1a_0&=\left (\left (\left (\left (\left (P_6P_5\right )P_4\right )P_3\right )P_2\right )P_1\right )a_0 \\ & = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\cos 0 \\ \sin 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{8} & -\frac{\sqrt{3}}{8} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{8} & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{32} & \frac{\sqrt{3}}{32} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{64} & \frac{\sqrt{3}}{64} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{64} \\ 0\end{pmatrix}\end{align*} (Wondering)
 
  • #4
mathmari said:
So we get the following:
\begin{align*}&P_1=\begin{pmatrix}\cos^2\frac{\pi}{3} & \sin\frac{\pi}{3}\cos\frac{\pi}{3} \\ \sin\frac{\pi}{3}\cos\frac{\pi}{3} & \sin^2\frac{\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_2=\begin{pmatrix}\cos^2\frac{2\pi}{3} & \sin\frac{2\pi}{3}\cos\frac{2\pi}{3} \\ \sin\frac{2\pi}{3}\cos\frac{2\pi}{3} & \sin^2\frac{2\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_3=\begin{pmatrix}\cos^2\frac{3\pi}{3} & \sin\frac{3\pi}{3}\cos\frac{3\pi}{3} \\ \sin\frac{3\pi}{3}\cos\frac{3\pi}{3} & \sin^2\frac{3\pi}{3} \end{pmatrix}=\begin{pmatrix}\cos^2\pi & \sin\pi\cos\pi \\ \sin\pi\cos\pi & \sin^2\pi \end{pmatrix}=\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix} \\ & P_4=\begin{pmatrix}\cos^2\frac{4\pi}{3} & \sin\frac{4\pi}{3}\cos\frac{4\pi}{3} \\ \sin\frac{4\pi}{3}\cos\frac{4\pi}{3} & \sin^2\frac{4\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_5=\begin{pmatrix}\cos^2\frac{5\pi}{3} & \sin\frac{5\pi}{3}\cos\frac{5\pi}{3} \\ \sin\frac{5\pi}{3}\cos\frac{5\pi}{3} & \sin^2\frac{5\pi}{3} \end{pmatrix}=\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix} \\ & P_6=\begin{pmatrix}\cos^2\frac{6\pi}{3} & \sin\frac{6\pi}{3}\cos\frac{6\pi}{3} \\ \sin\frac{6\pi}{3}\cos\frac{6\pi}{3} & \sin^2\frac{6\pi}{3} \end{pmatrix}=\begin{pmatrix}\cos^2\left (2\pi\right ) & \sin\left (2\pi\right )\cos\left (2\pi\right ) \\ \sin\left (2\pi\right )\cos\left (2\pi\right ) & \sin^2\left (2\pi\right ) \end{pmatrix}=\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\end{align*}

Therefore the result that we are looking for is:
\begin{align*}P_6P_5P_4P_3P_2P_1a_0&=\left (\left (\left (\left (\left (P_6P_5\right )P_4\right )P_3\right )P_2\right )P_1\right )a_0 \\ & = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\cos 0 \\ \sin 0\end{pmatrix} \\ & = \begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{8} & -\frac{\sqrt{3}}{8} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}1 & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{8} & 0 \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & -\frac{\sqrt{3}}{4} \\ -\frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}-\frac{1}{32} & \frac{\sqrt{3}}{32} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}\frac{1}{4} & \frac{\sqrt{3}}{4} \\ \frac{\sqrt{3}}{4} & \frac{3}{4} \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{64} & \frac{\sqrt{3}}{64} \\ 0 & 0 \end{pmatrix}\begin{pmatrix}1 \\ 0\end{pmatrix}
\\ & = \begin{pmatrix}\frac{1}{64} \\ 0\end{pmatrix}\end{align*}

Looks all correct to me! (Nod)

Just a different possible approach:
$$P_6P_5P_4P_3P_2P_1a_0
= (a_6a_6^T)\ldots(a_2a_2^T)(a_1a_1^T)a_0
=a_6(a_6^Ta_5)\ldots(a_2^Ta_1)(a_1^Ta_0)
$$
Each pair of consecutive $a_k$ vectors corresponds to two unit vectors with an angle of $\frac\pi 3$ between them.
Their dot product is therefore $\cos\frac\pi 3$.
Thus:
$$P_6P_5P_4P_3P_2P_1a_0 = a_6(\cos\frac\pi 3)^6=\binom 10\cdot \frac 1{2^6} = \binom{\frac1{64}}0$$
 
  • #5
Klaas van Aarsen said:
Looks all correct to me! (Nod)

Just a different possible approach:
$$P_6P_5P_4P_3P_2P_1a_0
= (a_6a_6^T)\ldots(a_2a_2^T)(a_1a_1^T)a_0
=a_6(a_6^Ta_5)\ldots(a_2^Ta_1)(a_1^Ta_0)
$$
Each pair of consecutive $a_k$ vectors corresponds to two unit vectors with an angle of $\frac\pi 3$ between them.
Their dot product is therefore $\cos\frac\pi 3$.
Thus:
$$P_6P_5P_4P_3P_2P_1a_0 = a_6(\cos\frac\pi 3)^6=\binom 10\cdot \frac 1{2^6} = \binom{\frac1{64}}0$$

Ahh ok! I see! Thanks a lot! (Blush)
 

1. How do you calculate the projection matrix for vectors a_k?

The projection matrix for vectors a_k can be calculated by multiplying the individual projection matrices for each vector in the sequence (P_6P_5P_4P_3P_2P_1a_0) in reverse order. This means starting with the last vector (a_0) and multiplying it by P_1, then taking the result and multiplying it by P_2, and so on until you reach the first vector (a_k). The final result will be the projection matrix for vectors a_k.

2. What is the purpose of calculating a projection matrix for vectors a_k?

The projection matrix for vectors a_k is used to project a vector onto a subspace spanned by a set of vectors (in this case, a_0 to a_k). This can be useful in various applications, such as computer graphics and data analysis.

3. How do you represent the projection matrix mathematically?

The projection matrix is represented as P_k = A(A^TA)^-1A^T, where A is a matrix containing the vectors a_0 to a_k as its columns. This formula can be used to calculate the projection matrix for any set of vectors.

4. Can the projection matrix be used for vectors in higher dimensions?

Yes, the projection matrix can be used for vectors in any dimension. The formula for calculating the projection matrix remains the same, but the size of the matrix A will vary depending on the number of vectors and their dimensions.

5. What are some applications of using projection matrices for vector calculations?

Projection matrices have various applications in fields such as computer graphics, machine learning, and signal processing. They can be used for tasks such as dimensionality reduction, image and video compression, and data analysis.

Similar threads

  • Linear and Abstract Algebra
Replies
15
Views
1K
  • Linear and Abstract Algebra
Replies
11
Views
943
Replies
31
Views
2K
  • Linear and Abstract Algebra
2
Replies
52
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
948
  • Linear and Abstract Algebra
Replies
19
Views
1K
  • Linear and Abstract Algebra
Replies
10
Views
966
  • Linear and Abstract Algebra
Replies
2
Views
3K
  • Linear and Abstract Algebra
Replies
7
Views
1K
  • Linear and Abstract Algebra
Replies
8
Views
757
Back
Top