# How to construct $A$ and $b$, given the set of all solutions to $Ax=b$?

I want to find a matrix $A \in \mathbb{C}^{2x4}$ and $b \in\mathbb{C}^{2}$ the solution of $Ax=b$ is: $$L = \left\{\pmatrix{1\\2\\0\\-1} + x_1\pmatrix{1\\-2\\2\\1} + x_2\pmatrix{2\\2\\-1\\1}\right\}$$

Therefore $\dim(A) = 4$, $\dim(\ker(A)) = 2$, $\dim(\operatorname{im}(A)) = 2$.

$A$ and $b$ have the following format:

$$A= \begin{pmatrix} a_{11} & a_{12} & a_{13} & a_{14}\\ a_{21} & a_{22} & a_{23} & a_{24} \\ \end{pmatrix} b= \pmatrix{b_1\\b_2}$$

My idea is to solve the following equation for A and b:

$$A\,\pmatrix{1 + x_1 + 2x_2\\2 - 2x_1+ 2x_2\\2x_1 - x_2\\-1+x_1 + x_2} = b$$ Is this the right way to start? I get then a linear equation with 12 unknowns and only 2 equations. I know that there must be many solutions. Do I simply define some of them as 1 or 0?

If you do this you don't get a linear system with twelve unknowns and two equations. Firstly, computing the product of $A$ with a matrix with some entries unknown is not linear, because it will involve terms of the form $a_{ij}x_k$; and secondly, $x_1$ and $x_2$ are not unknowns, the equation has to hold for all values of $x_1$ and $x_2$.

You know that in general the set of solutions of a system $Ax=b$ is given (if non-empty) by $v_0+\operatorname{null}A$ for some solution $v_0$ (any one will do, but you need to know that there is at least one). Comparing this with the definition of $L$, you get that $A$ must be such that $$\operatorname{null} A=\operatorname{span} ((1,-2,2,1)^T , (2,2,-1,1)^T).$$ So you want the rows $A_1,A_2$ of $A$ to be linearly independent (so that $A$ has rank $2$) and such that $$A_i\cdot (1,-2,2,1)^T=0=A_i\cdot (2,2,-1,1)^T;$$ Taking the transpose of these equations shows that the rows of $A$ must form a basis of the space of solutions to the homogeneous linear system $$\left\{\begin{array}{lll}a_1-2a_2+2a_3+a_4 & = & 0 \\ 2a_1+2a_2-a_3+a_4 & = & 0 \end{array}\right.$$

Once you've found the matrix $A$, you need to make sure that $(1,2,0,-1)^T$ is a solution of the system $Ax=b$, so you just have to take $$b=A\cdot \pmatrix{1\\2\\0\\-1}.$$

• What are the "lines" $A_1$ and $A_2$? And is't span() a set of vectors? How can it be a null matrix? – maxammann Jan 7 '17 at 14:19
• It's not a null matrix, it's the null space of the matrix. It's the same as the kernel. The lines $A_1$ and $A_2$ are the lines of $A$, so for example $A_1= ( a_{11} , a_{12} , a_{13} , a_{14})$. – Arnaud D. Jan 7 '17 at 14:24
• What is $A_i$? Are those the rows of A? – maxammann Jan 7 '17 at 14:39
• Yes that's what I meant. Sorry about the confusion, I've learned all this in French so sometimes I use the wrong words. – Arnaud D. Jan 7 '17 at 14:43
• @p000ison I've added some explanations. Sorry for not doing so earlier, I was busy yesterday. – Arnaud D. Jan 10 '17 at 18:04

Using $$v_0=\pmatrix{1\\2\\0\\-1} \quad v_1=\pmatrix{1\\-2\\2\\1} \quad v_2=\pmatrix{2\\2\\-1\\1}$$ If you want $$b = A(v_0 + x_1 v_1 + x_2 v_2) \iff \\ \underbrace{b - A v_0}_d = x_1 Av_1 + x_2 Av_2 = \underbrace{(Av_1 Av_2)}_C \underbrace{(x_1, x_2)^T}_u \iff \\ C u = d \quad$$ to hold for all $u = (x_1, x_2)^T \in \mathbb{R}^2$ it must include $0$, so $C0 = 0 = d$ and thus $b = A v_0$ for whatever $A$ we end up with.

Further $C u = 0$ for all $u$ means $C e_i = c_i = 0$ thus $C=(c_1 \, c_2) = (0 \, 0) = 0$.

This requires $A v_1 = A v_2 = 0$.

With $A^T = (r_1 \, r_2)$ we need $r_i^T v_j = r_i \cdot v_j = 0 \iff r_i \perp v_j \iff v_j^T r_i = 0$.

So $\ker A = \langle v_1, v_2 \rangle \perp \langle r_1, r_2 \rangle = \DeclareMathOperator{img}{img}\img A^T$ $$V^T r = 0 \iff \begin{bmatrix} v_1^T \\ v_2^T \end{bmatrix} = \begin{bmatrix} 1 & -2 & 2 & 1 \\ 2 & 2 & -1 & 1 \end{bmatrix} \to \begin{bmatrix} 1 & -2 & 2 & 1 \\ 0 & 6 & -5 & -1 \end{bmatrix} \to \\ \begin{bmatrix} 1 & -2 & 2 & 1 \\ 0 & 1 & -5/6 & -1/6 \end{bmatrix} \to \begin{bmatrix} 1 & 0 & 1/3 & 2/3 \\ 0 & 1 & -5/6 & -1/6 \end{bmatrix}$$ We find $r_1 = (-1, 1, 1, 1)^T$, $r_2 = (0, 3, 4, -2)^T$ do the job.

So $$A = \begin{pmatrix} -1 & 1 & 1 & 1 \\ 0 & 3 & 4 & -2 \end{pmatrix} \quad b = \begin{pmatrix} 0 \\ 8 \end{pmatrix}$$ is a solution.

• k, I think you followed the same strategy as @Arnaud D. Why are to transforming $\begin{bmatrix} v_1^T \\ v_2^T \end{bmatrix}$? How does this lead to your solution? – maxammann Jan 9 '17 at 9:29
• Oh, I thought I explained all steps in detail. The goal is to get two linear independent vectors $r_i$ which are perpendicular to the two vectors $v_j$. I used Gauss-Jordan to get two other linear independent vectors from $\langle v_1, v_2 \rangle$, so it is easier for me to determine orthogonal $r_i$ and thus $A$. Then $b$ follows. – mvw Jan 9 '17 at 9:57