Variables Need Names and an Order
When an unknown-quantity problem has several variables, it is not enough to know which quantities are unknown. We also need to know exactly which symbol represents each quantity and, when writing a tuple or matrix, which variable comes first. A consistent choice prevents a correct set of equations from being paired with the wrong coefficients or the wrong candidate solution.
Throughout this tutorial, scalars and unknowns are real numbers. A variable declaration says what each variable represents; for example, “let \(x\) be the number of adult tickets.” An ordered variable list records the variables in a fixed sequence, such as \((x,y)\) or \((u,v,w)\). That sequence is the reference order for the equations, coefficient matrix, and solution tuple. A solution tuple is not an unordered collection: its first entry belongs to the first variable, its second entry belongs to the second, and so on.
The variables themselves have labels, such as \(x\) and \(y\), while their positions in an ordered list determine how to interpret a compact representation. Writing \((x,y)\) first and later using \((y,x)\) is allowed, but it is a change of order. The coefficient columns and tuple entries must change with it. Merely changing the order in one place changes the meaning of the written data.
Reading Equations Against a Declared Order
For a short system, a coefficient matrix records the coefficient of each variable in each equation. If the declared order is \((x,y)\), the first column contains the coefficients of \(x\), and the second contains those of \(y\). A right-hand-side column records the constants in the same equation order. In the expression \(\mathbf{A}\mathbf{x}=\mathbf{b}\), the vector \(\mathbf{x}\) is written in the declared variable order.
The equations below are already supplied as algebraic constraints. The task in each example is to organize their variables and coefficients correctly, then interpret and check a stated assignment. The emphasis is on bookkeeping rather than deriving equations from a verbal description or solving a system by a particular method.
Worked Example: Two Unknown Quantities in a Declared Order
Let \(x\) be the number of adult tickets and \(y\) the number of child tickets. Use the declared order \((x,y)\) for the supplied equations \(2x+3y=12\) and \(x-y=1\). Record the coefficient matrix and right-hand side, then check the candidate tuple \((3,2)\).
The first equation has coefficient \(2\) on \(x\) and \(3\) on \(y\); the second has coefficient \(1\) on \(x\) and \(-1\) on \(y\). In the order \((x,y)\), these give
Multiplying the matrix by the tuple’s column vector gives
Thus the tuple means \(x=3\), \(y=2\), and it satisfies both supplied equations. Reading the same tuple as \(x=2\), \(y=3\) would be a different assignment.
Worked Example: The Equations Need Not List Variables in Order
Let \(u\) be the number of adult tickets and \(c\) the number of child tickets, and declare the order \((u,c)\). The supplied equations are \(2c+4u=20\) and \(c-u=1\). Although the first equation writes the \(c\)-term first, the declared order still puts \(u\) first. Record the coefficients and check \((3,4)\).
Rewrite each equation only as needed to read off coefficients in the order \((u,c)\). The first is \(4u+2c=20\), giving the row \((4,2)\). The second is \(-u+c=1\), giving \((-1,1)\). Therefore
Check by multiplication, showing each row calculation:
The candidate is valid in the order \((u,c)\): it assigns \(u=3\) and \(c=4\). The order comes from the declaration, not from which variable happens to appear first in a written equation.
Why the Order Rule Works
We can state the bookkeeping rule precisely. Suppose the declared order is \((x_1,\dots,x_n)\). In equation \(i\), let \(a_{ij}\) be the coefficient of \(x_j\), and let \(b_i\) be its right-hand side. The coefficient matrix has entry \(a_{ij}\) in row \(i\), column \(j\), and the right-hand side vector has entry \(b_i\) in position \(i\). The \(j\)th entry of the tuple vector is the proposed value of \(x_j\).
Proof. Assume first that the assignment \(x_j=c_j\) satisfies every equation. For each \(i\), satisfaction means \(\sum_{j=1}^{n} a_{ij}c_j=b_i\). By the definition of matrix multiplication, the \(i\)th entry of \(\mathbf{A}\mathbf{c}\) is exactly \(\sum_{j=1}^{n}a_{ij}c_j\), so it equals \(b_i\). This holds for every row \(i\), hence \(\mathbf{A}\mathbf{c}=\mathbf{b}\). Conversely, assume \(\mathbf{A}\mathbf{c}=\mathbf{b}\). Equality of these column vectors means their \(i\)th entries agree for each \(i\). The \(i\)th entry of \(\mathbf{A}\mathbf{c}\) is \(\sum_{j=1}^{n}a_{ij}c_j\), so \(\sum_{j=1}^{n}a_{ij}c_j=b_i\) for every \(i\). These are precisely the equations evaluated at \(x_j=c_j\); therefore the assignment satisfies every equation. \(\square\)
This result explains why the same order is required in all three places. The \(j\)th matrix column and the \(j\)th tuple entry are paired in every row product. If the entry in position \(j\) is instead interpreted as the value of a different variable, the row products no longer evaluate the intended equations.
Changing the Order Correctly
There is no uniquely correct order for a set of variables. A convenient order may follow the problem’s labels, the order in which variables were declared, or another consistent choice. What matters is that a change of order is made everywhere. The following result describes exactly what must move.
Proof. Fix any equation row \(i\). In the original order, substituting the assignment gives the left-hand side \(\sum_{j=1}^{n}a_{ij}c_j\). In the new order, column \(k\) has coefficient \(a_{i,\pi(k)}\), and the tuple entry in position \(k\) is \(c_{\pi(k)}\). Its left-hand side is therefore \(\sum_{k=1}^{n}a_{i,\pi(k)}c_{\pi(k)}\). Because \(\pi\) lists every index from \(1\) to \(n\) exactly once, this sum contains exactly the same coefficient-value products as the original sum, only in a different order. Thus the two left-hand sides are equal. The right-hand side \(b_i\) is unchanged, so the row equation is satisfied in the new representation exactly when it is satisfied in the original. Since this holds for every row \(i\), the full system and assignment are represented consistently after the rearrangement. \(\square\)
Worked Example: Reordering Both Columns and Tuple Entries
Use the ticket equations and original order \((u,c)\) from the previous example. Now choose the order \((c,u)\). The coefficient of \(c\) becomes the first entry of each row, and the coefficient of \(u\) becomes the second. The candidate tuple must likewise be read as \((c,u)=(4,3)\).
The new coefficient matrix and tuple are
Multiplication verifies the unchanged right-hand side:
The equations and assignment are unchanged; only their coordinate order has changed. The coefficient columns and tuple entries were both rearranged, as required.
Three Variables: Keep the Same Order in Every Row
With more variables, it is especially useful to write the order above the equations or immediately before the matrix. This makes it easier to compare a row with its coefficients and to interpret a tuple without guessing which entry belongs to which quantity.
Worked Example: A Three-Variable Assignment
Let \(x\), \(y\), and \(z\) denote three unknown quantities, and declare the order \((x,y,z)\). The supplied equations are \(2x+y+z=7\), \(x+3y+2z=13\), and \(3x+y+2z=11\). Record the matrix and check the candidate tuple \((1,2,3)\).
Reading each row in the order \((x,y,z)\) gives coefficient rows \((2,1,1)\), \((1,3,2)\), and \((3,1,2)\). The tuple column and right-hand side are therefore
Compute all three row products:
Thus the candidate assignment \(x=1\), \(y=2\), \(z=3\) satisfies the three equations. The check also shows why writing down the declared order is useful: every coefficient and value is matched by its position.
Common Mistake: Changing Only the Tuple
A common error is to reverse the tuple when changing variable order but leave the coefficient matrix unchanged. For the ticket example, in order \((u,c)\) the matrix is \(\begin{bmatrix}4&2\\-1&1\end{bmatrix}\), and the tuple is \((3,4)\). If we write the reversed tuple \((4,3)\) but incorrectly retain that old matrix, the product is
which is not the right-hand side \(\begin{bmatrix}20\\1\end{bmatrix}\). This does not show that the original assignment failed; it shows that the tuple and matrix now use incompatible orders. To represent \((c,u)=(4,3)\), the columns must be reversed too, giving \(\begin{bmatrix}2&4\\1&-1\end{bmatrix}\), whose product with \(\begin{bmatrix}4\\3\end{bmatrix}\) is \(\begin{bmatrix}20\\1\end{bmatrix}\).
Before accepting a matrix-and-tuple representation, check these practical points:
- Each variable has a stated meaning.
- A single variable order is explicitly recorded.
- Each coefficient row follows that order, even when an equation writes its terms in another order.
- Each tuple entry is interpreted using the same order.
- If the order changes, the coefficient columns and tuple entries change together.
These checks are about representation, not about whether a system has one solution, many solutions, or none. They ensure that the equations, matrix, and tuple are referring to the same unknown quantities before any later analysis begins.
Check Your Understanding
In each question, make the variable order explicit and explain how it controls the representation.
- For variables \(p\) and \(q\) in the order \((p,q)\), what coefficient row represents \(5q-2p=8\)?
- If the order is \((r,s,t)\), which variable does the second entry of the tuple \((4,1,-2)\) assign a value to?
- For the equations \(a+2b=6\) and \(3a-b=5\), write the coefficient matrix and right-hand side in the order \((a,b)\).
- The order \((x,y)\) changes to \((y,x)\). What must happen to the matrix columns and tuple entries?
- Explain why reversing only a tuple, while keeping its original coefficient matrix, may give a different matrix product.