Tutorials › Linear Algebra › Finding All Inputs That Map to a Given Output

Linear Transformations of R^n · Tutorial 197 of 1000

Finding All Inputs That Map to a Given Output

Use augmented matrices to determine whether an output has any inputs and, when it does, describe all of them.

Intermediate 10 min read

What You'll Learn

  • Express the inputs mapping to an output as the solutions of a matrix equation.
  • Test consistency by row-reducing the augmented matrix.
  • Identify how free variables describe all possible inputs.
  • Write a nonempty preimage as one particular input plus null-space vectors.
  • Check a proposed solution family by multiplying it by the matrix.

A Prescribed Output and Its Inputs

A linear transformation can send several different inputs to the same output, or it may never produce a particular output at all. To answer the question “Which inputs map to \(\mathbf{b}\)?”, represent the transformation by a matrix and solve an equation. The key distinction is between a system with no solution and one with solutions that depend on free variables.

Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\), and consider the linear transformation \(T:\mathbb{R}^n\to\mathbb{R}^m\) given by \(T(\mathbf{x})=\mathbf{A}\mathbf{x}\). For a fixed output \(\mathbf{b}\in\mathbb{R}^m\), its preimage is the set of inputs that map to \(\mathbf{b}\):

$$ T^{-1}(\{\mathbf{b}\})=\{\mathbf{x}\in\mathbb{R}^n:T(\mathbf{x})=\mathbf{b}\} =\{\mathbf{x}\in\mathbb{R}^n:\mathbf{A}\mathbf{x}=\mathbf{b}\}. $$

This notation names a set of inputs; it does not assume that \(T\) has an inverse function. The equation \(\mathbf{A}\mathbf{x}=\mathbf{b}\) is a system of \(m\) equations in \(n\) unknowns. Its solutions are exactly the preimage. There may be no solutions, one solution, or a family of solutions.

Definition: The system \(\mathbf{A}\mathbf{x}=\mathbf{b}\) is consistent if it has at least one solution, and inconsistent if it has none. Thus the preimage of \(\mathbf{b}\) is empty exactly when the system is inconsistent.

Writing \(\mathbf{A}=\begin{bmatrix}\mathbf{a}_1&\cdots&\mathbf{a}_n\end{bmatrix}\), the matrix product is \(\mathbf{A}\mathbf{x}=x_1\mathbf{a}_1+\cdots+x_n\mathbf{a}_n\). Consequently, finding an input is the same as finding coefficients that express \(\mathbf{b}\) as a linear combination of the columns. In other words, the system is consistent exactly when \(\mathbf{b}\) is in the column space of \(\mathbf{A}\). Row reduction gives a practical test for that condition and, when it holds, a way to describe every input.

Use the Augmented Matrix

To solve \(\mathbf{A}\mathbf{x}=\mathbf{b}\), row-reduce the augmented matrix \([\mathbf{A}\mid\mathbf{b}]\), which appends the entries of \(\mathbf{b}\) as a final column. Row operations must be applied to the entire augmented matrix, including that last column. A row of the form \([0\ \cdots\ 0\mid c]\) with \(c\ne0\) represents the impossible equation \(0=c\), so it proves inconsistency. A row of zeros on both sides represents \(0=0\), which adds no restriction.

Theorem (Augmented-matrix test): Let \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{b}\in\mathbb{R}^m\). The system \(\mathbf{A}\mathbf{x}=\mathbf{b}\) is consistent if and only if the reduced row echelon form of \([\mathbf{A}\mid\mathbf{b}]\) has no row whose coefficient entries are all zero and whose final entry is nonzero. If it is consistent, the variables corresponding to nonpivot columns of the coefficient matrix are free, and assigning values to them determines the pivot variables and gives every solution.

Proof. Each elementary row operation preserves the solution set of the augmented system: swapping two equations changes only their order; multiplying an equation by a nonzero scalar gives an equivalent equation; and adding a multiple of one equation to another can be undone by subtracting that multiple. Therefore the original system and its reduced row echelon form have exactly the same solutions. A row with zero coefficient entries and nonzero final entry asserts \(0=c\) for some \(c\ne0\), which no values of the variables can satisfy. Conversely, if there is no such row, every nonzero row has at least one nonzero coefficient. In reduced row echelon form, each pivot variable is specified by its row as a constant minus a combination of free variables. Assigning any real values to the free variables then determines all pivot variables and satisfies every row; zero rows impose no further condition. This constructs solutions, and every solution must have those same pivot-variable values for its chosen free-variable values. Thus the system is consistent exactly in the stated case, and the description includes all its solutions. \(\square\)

Worked Systems

Worked Example: A Unique Input

Let \(T:\mathbb{R}^2\to\mathbb{R}^2\) be given by \(\mathbf{A}=\begin{bmatrix}1&2\\3&1\end{bmatrix}\). Find every input sent to \(\mathbf{b}=\begin{bmatrix}5\\7\end{bmatrix}\).

Start with the augmented matrix. Replace \(R_2\) by \(R_2-3R_1\), scale the new \(R_2\) by \(-\tfrac15\), then replace \(R_1\) by \(R_1-2R_2\):

$$ \begin{bmatrix}1&2&\mid&5\\3&1&\mid&7\end{bmatrix} \sim \begin{bmatrix}1&2&\mid&5\\0&-5&\mid&-8\end{bmatrix} \sim \begin{bmatrix}1&2&\mid&5\\0&1&\mid&\tfrac85\end{bmatrix} \sim \begin{bmatrix}1&0&\mid&\tfrac95\\0&1&\mid&\tfrac85\end{bmatrix}. $$

There is a pivot in each variable column and no free variable, so the only input is \(\mathbf{x}=\begin{bmatrix}\tfrac95\\[2pt]\tfrac85\end{bmatrix}\).

Check: Multiplication gives \(\mathbf{A}\mathbf{x}=\begin{bmatrix}\tfrac95+2(\tfrac85)\\3(\tfrac95)+\tfrac85\end{bmatrix}=\begin{bmatrix}\tfrac{25}{5}\\\tfrac{35}{5}\end{bmatrix}=\begin{bmatrix}5\\7\end{bmatrix}\), as required.

Worked Example: A Family of Inputs

Let \(T:\mathbb{R}^3\to\mathbb{R}^2\) have matrix \(\mathbf{A}=\begin{bmatrix}1&2&-1\\2&4&-2\end{bmatrix}\). Find every input sent to \(\mathbf{b}=\begin{bmatrix}3\\6\end{bmatrix}\).

Subtract \(2R_1\) from \(R_2\) in the augmented matrix:

$$ \begin{bmatrix}1&2&-1&\mid&3\\2&4&-2&\mid&6\end{bmatrix} \sim \begin{bmatrix}1&2&-1&\mid&3\\0&0&0&\mid&0\end{bmatrix}. $$

The system is consistent. The reduced equation is \(x_1+2x_2-x_3=3\). Columns 2 and 3 have no pivots, so set \(x_2=s\) and \(x_3=t\), where \(s,t\in\mathbb{R}\). Then \(x_1=3-2s+t\), and every input in the preimage has the form

$$ \mathbf{x}= \begin{bmatrix}3\\0\\0\end{bmatrix} +s\begin{bmatrix}-2\\1\\0\end{bmatrix} +t\begin{bmatrix}1\\0\\1\end{bmatrix}, \qquad s,t\in\mathbb{R}. $$

Check: Multiplying the particular input gives \(\mathbf{A}\begin{bmatrix}3\\0\\0\end{bmatrix}=\begin{bmatrix}3\\6\end{bmatrix}\). For the two parameter directions, \(\mathbf{A}\begin{bmatrix}-2\\1\\0\end{bmatrix}=\begin{bmatrix}-2+2\\-4+4\end{bmatrix}=\mathbf{0}\) and \(\mathbf{A}\begin{bmatrix}1\\0\\1\end{bmatrix}=\begin{bmatrix}1-1\\2-2\end{bmatrix}=\mathbf{0}\). Therefore every displayed input maps to \(\mathbf{b}\), for every \(s,t\).

Worked Example: No Input

For \(\mathbf{A}=\begin{bmatrix}1&1\\2&2\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}1\\3\end{bmatrix}\), determine the preimage.

Subtract \(2R_1\) from \(R_2\) in the augmented matrix:

$$ \begin{bmatrix}1&1&\mid&1\\2&2&\mid&3\end{bmatrix} \sim \begin{bmatrix}1&1&\mid&1\\0&0&\mid&1\end{bmatrix}. $$

The last row says \(0=1\), so the system is inconsistent and the preimage is empty. This conclusion also follows from the original equations: \(x_1+x_2=1\) would imply \(2x_1+2x_2=2\), not \(3\).

Check: Since every possible input would have to satisfy both equations, while the first forces the left side of the second to equal \(2\), no input can map to \(\mathbf{b}\).

One Particular Input Plus Null-Space Directions

The parameter family in the second example has a general form. The null space of \(\mathbf{A}\) is \(\operatorname{Nul}\mathbf{A}=\{\mathbf{z}\in\mathbb{R}^n:\mathbf{A}\mathbf{z}=\mathbf{0}\}\), the set of inputs mapped to the zero vector. Once one input \(\mathbf{x}_p\) mapping to \(\mathbf{b}\) is known, adding any null-space vector leaves the output unchanged.

Theorem: For \(\mathbf{A}\in\mathbb{R}^{m\times n}\) and \(\mathbf{b}\in\mathbb{R}^m\), if \(\mathbf{A}\mathbf{x}=\mathbf{b}\) has a solution \(\mathbf{x}_p\), then its full solution set is \(\{\mathbf{x}_p+\mathbf{z}:\mathbf{z}\in\operatorname{Nul}\mathbf{A}\}\). If it has no solution, its preimage is empty.

Proof. Assume first that \(\mathbf{x}\) is any solution. Then \(\mathbf{A}\mathbf{x}=\mathbf{b}=\mathbf{A}\mathbf{x}_p\), so linearity of matrix multiplication gives \(\mathbf{A}(\mathbf{x}-\mathbf{x}_p)=\mathbf{0}\). Thus \(\mathbf{z}=\mathbf{x}-\mathbf{x}_p\) belongs to \(\operatorname{Nul}\mathbf{A}\), and \(\mathbf{x}=\mathbf{x}_p+\mathbf{z}\). For the reverse inclusion, take any \(\mathbf{z}\in\operatorname{Nul}\mathbf{A}\). Then \(\mathbf{A}(\mathbf{x}_p+\mathbf{z})=\mathbf{A}\mathbf{x}_p+\mathbf{A}\mathbf{z}=\mathbf{b}+\mathbf{0}=\mathbf{b}\), so every such sum is a solution. If no \(\mathbf{x}_p\) exists, the defining equation has no solution, and the preimage is empty. \(\square\)

This gives a useful interpretation of free variables: they describe the directions in which an input can change without changing its output. In the family example, the particular input is \(\begin{bmatrix}3\\0\\0\end{bmatrix}\), while the two parameter vectors are in the null space. The theorem explains why combining them with any real parameters preserves the output.

Common Pitfall: Reducing Only the Coefficient Matrix

A row of zeros in the reduced coefficient matrix does not by itself prove that a system is consistent. For the inconsistent example, reducing only \(\mathbf{A}\) gives \(\begin{bmatrix}1&1\\0&0\end{bmatrix}\). The tempting but incorrect conclusion is “there is no contradictory row, so a solution exists.” This omits the right-hand side: the actual augmented reduction is \(\begin{bmatrix}1&1&\mid&1\\0&0&\mid&1\end{bmatrix}\), whose last row asserts \(0=1\). Always row-reduce \([\mathbf{A}\mid\mathbf{b}]\), not just \(\mathbf{A}\).

A related check is to substitute the proposed family into the original matrix equation. A set of parameter expressions is not verified just because it solves the reduced equations as written; the multiplication check confirms that the inputs really map to the prescribed output.

Check Your Understanding

For each system, identify whether the preimage is empty, a single input, or a family, and justify the conclusion using the augmented matrix.

  1. For \(\mathbf{A}=\begin{bmatrix}1&1\\1&-1\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}4\\2\end{bmatrix}\), find every input.
  2. For \(\mathbf{A}=\begin{bmatrix}1&2&0\\2&4&0\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}3\\6\end{bmatrix}\), write the solution set using free variables.
  3. For \(\mathbf{A}=\begin{bmatrix}1&1\\2&2\end{bmatrix}\) and \(\mathbf{b}=\begin{bmatrix}2\\5\end{bmatrix}\), explain why the preimage is empty.
  4. Prove that if \(\mathbf{x}_p\) is one input mapping to \(\mathbf{b}\), then adding any \(\mathbf{z}\in\operatorname{Nul}\mathbf{A}\) gives another such input.
  5. What does a row \([0\ \cdots\ 0\mid c]\), with \(c\ne0\), tell you about the preimage?

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon