Let's assume that `a` and `b` are linearly independent vectors from `R^3` (they do not lie on the same line), that is there is no such real number `lambda` such that `a=lambda b.`
a. The basis of this space is `(a,b)` because `a` and `b` are independent by assumption and two `a`'s are the same vector so they are dependent. Also because there are two vectors in the basis dimension is 2.
b. Again the basis is `(a,b)` because `a` and `b` are independent by assumption and vector `a+b=1cdot a+1cdot b` is linear combination of those two vectors so it's in the same space. Again as in a. dimension is 2.
We could have chosen a different basis e.g. `(a,a+b)` or `(b,a+b)`.