Vector subspaces: basis and linearly independent elements I have two questions that I am struggling with..


*

*In a space of real functions we have a subspace defined by the set $V = \langle 1,x, \cos x, \sin x \rangle$ and its subspace defined by the set $W = \{f \in V\mid f(\pi) = 0\}$
Find some basis of $W$.


*How many linearly independent sequences of two elements are there in the space $\mathbb{Z^2_3}$?


I believe I can get the answer of the second problem even though I am doubting the method to be the most efficient one.
I think I got to a number $24$ to be the result but it was more about actually figuring it out by considering all the options for the first element of the sequence (cannot be the zero vector) and then all the options for the second element (cannot be a multiple of the first one)..
But I am pretty sure there must be some solution that uses more of linear algebra.
As to the first problem I am pretty lost as I don't really know what the problem means and how should I approach it.
Thanks for your help.
 A: Like most questions in linear algebra, it boils down to solving a linear system of equations. First, note that the functions $1,x,\sin(x)$ and $\cos(x)$ are linearly independent and so form a basis for $V$. Thus, a general function in $V$ is of the form
$$ f(x) = a + bx + c \cdot \mathrm{cos}(x) + d \cdot \mathrm{sin}(x) $$
where $a,b,c,d \in \mathbb{R}$. We have $f \in W$ if and only if $f(\pi) = 0$ if and only if
$$ f \left( \pi \right) = a + b \pi -c = 0.$$
This is a linear equation for the coefficients $(a,b,c,d)$ of $f$ whose solution subspace is a three dimensional subspace $W'$ of $V' = \mathbb{R}^4$ given by
$$ W' = \mathrm{span} \{ (0,0,0,1), (1, 0, 1, 0), (0, 1, \pi, 0 \}. $$
Translating this solutions back to $W$, we see that a basis of $W$ is given by
$$ W = \mathrm{span} \{ \mathrm{sin}(x), 1 + \mathrm{cos}(x), x + \pi \cos(x) \}. $$
Verify that you understand why the functions are linearly independent (just like the vectors spanning $W'$ were) and form a basis for $W$.

Regarding your second question, your method sounds good. The vector space $\mathbb{Z}_3^2$ has $3^2 = 9$ elements. Assuming we care about order, a sequence of two linearly independent elements $(v_1,v_2)$ consists of a non-zero vector $v_1 \in \mathbb{Z}_3^2$ and a second vector $v_2$ that is not a multiple by a scalar of $v_1$.
For $v_1$, we have $8$ options. Given $v_1$, there are three vectors that are linearly dependent on $v_1$ - those are $0 \cdot v_1 = 0$, $1 \cdot v_1 = v_1$ and $2 \cdot v_1$. Make sure you understand why $0, v_1$ and $2 v_1$ are necessarily distinct. Thus, we are left with $9 - 3 = 6$ options for $v_2$. Finally, we get $8 \cdot 6 = 48$ as the answer. If we don't care about order, we indeed get $24$ options.
