# How can I find expansion coefficients of the y vector in a given basis?

Consider the following vectors in $$\mathbb R^4$$:

$$\mathbf{v}^{(0)}=\begin{bmatrix}\frac{1}{2}\\\frac{1}{2}\\\frac{1}{2}\\\frac{1}{2} \end{bmatrix} , \mathbf{v}^{(1)}=\begin{bmatrix}\frac{1}{2}\\\frac{1}{2}\\-\frac{1}{2}\\-\frac{1}{2} \end{bmatrix}, \mathbf{v}^{(2)}=\begin{bmatrix}\frac{1}{2}\\-\frac{1}{2}\\\frac{1}{2}\\-\frac{1}{2} \end{bmatrix} \mathbf{v}^{(3)}=\begin{bmatrix}\frac{1}{2}\\-\frac{1}{2}\\\frac{-1}{2}\\\frac{1}{2} \end{bmatrix}$$

Let $$\mathbf{y}=\begin{bmatrix}0.5\\1.5\\-0.5\\0.5\\\end{bmatrix} \text,$$

what are the expansion coefficients of $$\mathbf{y}$$ in the basis $$\{\mathbf{v}_0, \mathbf{v}_1, \mathbf{v}_2, \mathbf{v}_3\}$$?

The basis vectors are orthonormal (very nice!, half the job done), Now project/take inner product of the basis vectors with $$\mathbf{y}$$ to get the expansion coefficients.

In general for an orthnormal basis any $$\mathbf{y}$$ in $$\mathbb R^N$$ can be written as $$\mathbf{y} = \sum_{k=0}^{k=N-1}a_k\mathbf{v_k}$$ where $$a_k = \mathbf{y}^T\mathbf{v_k}$$, in this example

$$\mathbf{y} = \mathbf{v_0} + \mathbf{v_1} - \mathbf{v_2}$$, so the cefficients are [1,1,-1,0] for $$\mathbf{v_0}$$,$$\mathbf{v_1}$$, $$\mathbf{v_2}$$, $$\mathbf{v_3}$$ respectively.

You need to find projection of $$\vec{y}$$ along unit vectors in the direction of each of the basis vectors $$\mathbf v^{(i)}$$.

For finding unit vector in the direction of the vector, you just divide the vector by its magnitude.

And, for finding projection along a unit-vector, you just take the dot-product with the unit-vector.

So, the combined steps boil down to doing the following: $$<\vec{y}, \frac{\mathbf v^{i}}{||\mathbf v^{i}||^{2}_{2}}>$$

In your case the basis-vectors are already normalized, meaning they are already unit vectors, so just take the dot-product(inner product) of vector $$\vec{y}$$ with each of the basis vectors $$\mathbf v^i$$