I have vector $\mathbf{g}=(0,2,-1,1)$ and I have to represent the vector as a sum of two $\mathbf{g}_1$ and $\mathbf{g}_2$ if $\mathbf{g}_1 \in L$ and $\mathbf{g}_2 \in L^{\perp}$ if $L = \langle \mathbf{a}_1,\mathbf{a}_2\rangle \in \mathbb{R}^4$ and if $\mathbf{a}_1=(0,1,1,1)$ and $\mathbf{a}_2=(-1,0,1,0)$
The main problem is that I do not even know how to approach it in theory, what steps I need to reproduce and so on. I have been looking and googling for explanation for some mature amount of time, but still did not get what I supposed to do step by step.
Let $\mathbf{g}_1$ be the orthogonal projection of $\mathbf g$ onto $L$. Now, define $\mathbf{g}_2=\mathbf{g}-\mathbf{g}_1$. Then $\mathbf{g}_2\in L^\perp$.
It turns out that $\mathbf{g}_1=(-1,1,0,1)$ and that $\mathbf{g}_2=(1,1,-1,0)$.