# Thread: Give a basis of a subspace

1. ## Give a basis of a subspace

Hi MHF,
We have the following vectorial subspace $\displaystyle W$ pertaining to $\displaystyle \mathbb{R}^4$ such that $\displaystyle W=\{ (x,y,z,w) \in \mathbb{R}^4 : 2x-z+w=0, x-y-z=0 \}$.
1)Find a basis of W.
2)Find a basis of W orthogonal.
My attempt :
1)I just wrote the 2 equations defining W as a matrix and chosen the 2 first column vectors of the matrix as being a basis of W.
Precisely I got that a basis of W is {(2,1),(0,-1)}. (0,-1) being the last column vector of the matrix I formed.
2)I'm not 100% sure about what I've done here. I chosen the basis {(2,1),(1,0)}.

How can I check if I'm right on this? I guess I could form a matrix with the vectors in the basis I gave and try to get a null row or column when reducing it. But I'm not sure, and not sure how to form the matrix too.
Can you help me?

2. Originally Posted by arbolis
Hi MHF,
We have the following vectorial subspace $\displaystyle W$ pertaining to $\displaystyle \mathbb{R}^4$ such that $\displaystyle W=\{ (x,y,z,w) \in \mathbb{R}^4 : 2x-z+w=0, x-y-z=0 \}$.
1)Find a basis of W.
2)Find a basis of W orthogonal.
My attempt :
1)I just wrote the 2 equations defining W as a matrix and chosen the 2 first column vectors of the matrix as being a basis of W.
Precisely I got that a basis of W is {(2,1),(0,-1)}. (0,-1) being the last column vector of the matrix I formed.
2)I'm not 100% sure about what I've done here. I chosen the basis {(2,1),(1,0)}.

How can I check if I'm right on this? I guess I could form a matrix with the vectors in the basis I gave and try to get a null row or column when reducing it. But I'm not sure, and not sure how to form the matrix too.
Can you help me?
to find a basis for W, just solve the equations: $\displaystyle \begin{cases}2x-z+w=0 \\ x-y-z=0 \end{cases},$ which gives you: $\displaystyle z=x-y, \ w=-x-y.$ so a typical element of W is: $\displaystyle \begin{bmatrix}x \\ y \\ x-y \\ -x-y \end{bmatrix}=x \begin{bmatrix}1 \\ 0 \\ 1 \\ -1 \end{bmatrix} + y \begin{bmatrix} 0 \\ 1 \\ -1 \\ -1 \end{bmatrix}=xu_1+yu_2.$

thus $\displaystyle \{u_1,u_2\}$ is a basis for W. to find a basis for $\displaystyle W^{\perp},$ an easy way is to look for all vectors $\displaystyle v=\begin{bmatrix} x \\ y \\ z \\ w \end{bmatrix}$ such that $\displaystyle v \cdot u_1=v \cdot u_2=0,$ i.e. $\displaystyle \begin{cases}x+z-w=0 \\ y-z-w=0 \end {cases}.$ that gives us: $\displaystyle z=\frac{y-x}{2}, \ w=\frac{x+y}{2}.$

so a typical element of $\displaystyle W^{\perp}$ is: $\displaystyle \begin{bmatrix} x \\ y \\ \frac{y-x}{2} \\ \frac{x+y}{2} \end{bmatrix}=\frac{x}{2}\begin{bmatrix} 2 \\ 0 \\ -1 \\ 1 \end{bmatrix}+\frac{y}{2}\begin{bmatrix} 0 \\ 2 \\ 1 \\ 1 \end{bmatrix}=\frac{x}{2}u_3 + \frac{y}{2}u_4.$ thus $\displaystyle \{u_3,u_4 \}$ is a basis for $\displaystyle W^{\perp}.$

3. $\displaystyle 2x-z+w=\begin{bmatrix} 2 \\ 0 \\-1 \\ 1 \end{bmatrix}.\begin{bmatrix} x \\ y \\z \\ w \end{bmatrix}=0$,normal vector $\displaystyle \vec{v}_1=\begin{bmatrix} 2 \\ 0 \\-1 \\ 1 \end{bmatrix} ,x-y-z=0$, normal vector $\displaystyle \vec{v}_2=\begin{bmatrix} 1 \\ -1 \\ -1 \\ 0 \end{bmatrix}$

$\displaystyle W=\{ (x,y,z,w) \in \mathbb{R}^4 : 2x-z+w=0, x-y-z=0 \}$, so $\displaystyle W$ is intersection line of two hyperplanes.

We solve equation $\displaystyle A\vec{x}=\vec{0}, A=\begin{bmatrix} 2&0&-1&1\\ 1&-1&-1&0 \end{bmatrix}, W=ker (A) ,rref (A)=\begin{bmatrix} 1&0&-1/2&1/2\\ 0&1&1/2&1/2 \end{bmatrix},$
$\displaystyle rank(A) = Dim(W)=2$, so there are two linear independent vectors in basis.

$\displaystyle W=\begin{bmatrix} (z-w)/2 \\ -(z+w)/2 \\ z \\ w \end{bmatrix} =z\begin{bmatrix} 1/2 \\ -1/2 \\ 1 \\ 0 \end{bmatrix}+w\begin{bmatrix} -1/2 \\ -1/2 \\ 0 \\ 1 \end{bmatrix}, basis = (\begin{bmatrix} \frac{1}{2}\\ -\frac{1}{2} \\ 1 \\ 0 \end{bmatrix},\begin{bmatrix} -\frac{1}{2}\\ -\frac{1}{2} \\ 0 \\ 1 \end{bmatrix})$

by the way, dimension is four. if it's 3, it's easy to calc by W = span(v1 x v2)

**********
$\displaystyle W^{\perp}$ is hyperplane orthogonal to intersection line $\displaystyle W$. Its basis is two linear independent normal vectors $\displaystyle (\vec{v}_1,\vec{v}_2). W^{\perp} basis = (\begin{bmatrix} 2 \\0 \\ -1 \\ 1 \end{bmatrix},\begin{bmatrix} 1 \\ -1 \\ -1 \\ 0 \end{bmatrix})$

There is no union solution. This answer is the same with **NonCommAlg's Avatar** above.

4. Thank you very much to both. I'll study this in detail today.

5. Without using matrices: You have two equations, 2x-z+w=0 and x-y-z=0 in 4 variables. The equations are independent so we can solve for two of the variables in terms of the other 2 meaning that this is a two dimensional subspace of the four dimensional $\displaystyle R^4$.

We get z= x- y from the second equation and, putting that into the first, 2x-(x-y)+ w= x+ y+ w= 0 so w= -x-y. If we take x= 1, y= 0, z= 1, w= -1 so (1, 0, 1, -1) is a vector in that subspace. Taking x= 0, y= 1, z= -1, w= -1 so (0, 1, -1, -1) is another vector in that subspace. Taking x=1, y= 0 and x= 0, y= 1 ensures that they are independent vectors so {(1, 0, 1, -1), (0, 1, -1, -1)} is a basis for the subspace W.

Vectors in the orthogonal subspace to W must be perpendicular to every vector in W. Since we already know that 2x- z+ w= 2(x)+ 0(y)+ (-1)z+ (1)w= 0 and x-y-z= 1(x)+ (-1)y+ (-1)z+ 0(w)= 0, it is clear that (2, 0, -1, 1) and (1, -1, -1, 0) are in that orthogonal orthogonal space and it is clear that they are independent so {(2, 0, -1, 1), (1, -1, -1, 0)} is a basis for the orthogonal subspace to W

6. To NCA : I could follow all you put until here :
that gives us:
. Could you please tell me how did you get these values for z and w?

To HallsofIvy : Nicely saw. Especially the second part. Thank you.

7. To add two equations: $\displaystyle \begin{cases}x+z-w=0 \\ y-z-w=0 \end {cases}$ $\displaystyle \rightarrow (x+z-w) + (y-z-w)=0 \rightarrow x+y-2w=0 \rightarrow w=\frac{x+y}{2}$