Traffic in a city, currents in a circuit, atoms in a reaction, a curve through data points, a balanced diet: each becomes a linear system $A\mathbf{x}=\mathbf{b}$ โ and row reduction does the rest.
Why do engineers, chemists, economists and data scientists all learn row reduction? Because an astonishing number of real problems are linear: quantities are added up, and each one is a fixed multiple of a few unknowns. Cars entering a junction must leave it; electric charge cannot pile up in a wire; atoms are neither created nor destroyed in a reaction; a curve through measured data must hit every point. Each of these rules becomes one linear equation, and together they form a system that we already know how to solve.
In this section we build such models from scratch. The pattern is always the same: name the unknowns, write one equation for each physical rule, row-reduce, and then interpret the answer in the real situation โ including free variables (which describe the freedom the real system has) and inconsistency (which tells us the model's demands are impossible). Interpretation matters: a negative traffic flow or $2.7$ molecules of oxygen is mathematically fine but physically meaningless.
Network Flow
A network is a set of points called junctions (or nodes) joined by branches along which something flows: cars along one-way streets, water through pipes, data through cables, money between accounts. The flow along each branch is measured as a rate (vehicles per hour, litres per second).
๐ Definition 1.11 โ Conservation of flow
A network satisfies conservation of flow if at every junction
$$\text{total flow into the junction}=\text{total flow out of the junction},$$
and, consequently, the total flow into the whole network equals the total flow out of it. Each junction gives one linear equation in the unknown branch flows.
โ๏ธ Example 1 โ Traffic in a city block
Four one-way streets form a block with corners $A$ (top left), $B$ (top right), $C$ (bottom right) and $D$ (bottom left); the network is drawn in Interactive 1 below. Traffic runs $A\to B$ (flow $x_1$), $B\to C$ ($x_2$), $D\to C$ ($x_3$) and $A\to D$ ($x_4$), in vehicles per hour. From outside the block, $500$ vehicles/h enter at $A$; at $B$, $150$ enter and $350$ leave; at $C$, $400$ leave; at $D$, $250$ enter and $150$ leave.
Find the general flow pattern.
Since the streets are one-way, every $x_i\ge0$. Find the possible range of each flow.
If street $AD$ is closed for repairs, what are the other flows?
๐ก Show solutionโถ
Equations Flow in $=$ flow out at each junction: $$\begin{array}{lrcl}A: & 500&=&x_1+x_4\\ B: & x_1+150&=&x_2+350\\ C: & x_2+x_3&=&400\\ D: & x_4+250&=&x_3+150\end{array}\qquad\Longrightarrow\qquad\left[\begin{array}{cccc|c}1&0&0&1&500\\1&-1&0&0&200\\0&1&1&0&400\\0&0&1&-1&100\end{array}\right]$$ (Check: total in $500+150+250=900$, total out $350+400+150=900$.)
Reduce $R_2\to R_2-R_1$ gives $(0,-1,0,-1\mid-300)$; $R_2\to-R_2$ gives $(0,1,0,1\mid300)$; $R_3\to R_3-R_2$ gives $(0,0,1,-1\mid100)$; $R_4\to R_4-R_3$ gives a zero row: $$\left[\begin{array}{cccc|c}1&0&0&1&500\\0&1&0&1&300\\0&0&1&-1&100\\0&0&0&0&0\end{array}\right].$$ The zero row reflects the fact that the four junction equations are not independent (they always add up to "total in $=$ total out").
(a) General flow $x_4=t$ is free: $$x_1=500-t,\qquad x_2=300-t,\qquad x_3=100+t,\qquad x_4=t.$$
(b) Ranges $x_4\ge0$ needs $t\ge0$; $x_2\ge0$ needs $t\le300$; $x_1,x_3$ are then automatically positive. So $0\le t\le300$, giving $0\le x_4\le300$, $\ 0\le x_2\le300$, $\ 200\le x_1\le500$ and $100\le x_3\le400$ vehicles/h.
Interactive 1 โ Traffic Network with a Free Flow
The junction equations leave one free flow $t=x_4$. Move the slider (or press Play): flows are drawn with thickness proportional to their size. A flow that turns red and dashed is negative โ cars would have to drive the wrong way along a one-way street โ so that value of $t$ is mathematically a solution but physically impossible. The gauge on the right shades the feasible range of $t$.
$t=x_4$โ
$x_1$โ
$x_2$โ
$x_3$โ
feasible?โ
Electrical Circuits
In a direct-current circuit, batteries push current $I$ (measured in amperes, A) through wires and resistors (resistance $R$ in ohms, $\Omega$). Three physical laws turn a circuit diagram into a linear system for the unknown currents.
๐ Physical laws for circuits โ Ohm and Kirchhoff
Ohm's law. The voltage drop across a resistor of resistance $R$ carrying current $I$ is $V=IR$ (volts).
Kirchhoff's current law. At every junction (node) the total current flowing in equals the total current flowing out โ conservation of flow again.
Kirchhoff's voltage law. Around any closed loop, the sum of the voltage rises supplied by batteries equals the sum of the voltage drops $IR$ across resistors (taking directions into account).
Choose a direction for each unknown current before you start. If a current comes out negative, it simply flows the other way.
The circuit of Example 2. The longer plate of each battery is its positive terminal; arrows show the chosen current directions.
โ๏ธ Example 2 โ A two-loop circuit
In the circuit above, the left branch contains a $12$ V battery and a $3\ \Omega$ resistor, the middle branch a $2\ \Omega$ resistor, and the right branch a $10$ V battery and a $4\ \Omega$ resistor. Find the currents $I_1$, $I_2$, $I_3$.
๐ก Show solutionโถ
Current law At node $P$, $I_1$ and $I_2$ flow in and $I_3$ flows out: $I_1+I_2-I_3=0$. (Node $Q$ gives the same equation.)
Voltage law Left loop (left branch and middle branch): the $12$ V rise equals the drops $3I_1$ and $2I_3$, so $3I_1+2I_3=12$. Right loop (middle and right branches): $4I_2+2I_3=10$.
Back-substitute $I_3=3$ A; $-I_2+18=17$ gives $I_2=1$ A; $I_1=I_3-I_2=2$ A.
Check Left loop: $3(2)+2(3)=12$ โ. Right loop: $4(1)+2(3)=10$ โ. Power check: the batteries supply $12(2)+10(1)=34$ W and the resistors use $2^2(3)+1^2(4)+3^2(2)=12+4+18=34$ W โ.
Balancing Chemical Equations
In a chemical reaction atoms are rearranged, never created or destroyed, so each element must appear in equal numbers on both sides. Putting unknown whole-number coefficients in front of each molecule gives a homogeneous linear system โ one equation per element โ and Theorem 1.5 is exactly why there is always a nonzero answer when there are more molecules than elements.
โ๏ธ Example 3 โ Burning propane
Propane burns in oxygen to give carbon dioxide and water: $$x_1\,\mathrm{C_3H_8}+x_2\,\mathrm{O_2}\ \longrightarrow\ x_3\,\mathrm{CO_2}+x_4\,\mathrm{H_2O}.$$ Find the smallest positive whole numbers $x_1,\dots,x_4$ that balance the equation.
๐ก Show solutionโถ
Count atoms Carbon: $3x_1=x_3$. Hydrogen: $8x_1=2x_4$. Oxygen: $2x_2=2x_3+x_4$. Move everything to the left: $$\begin{bmatrix}3&0&-1&0\\8&0&0&-2\\0&2&-2&-1\end{bmatrix}\mathbf{x}=\mathbf{0}.$$
Reduce Three equations, four unknowns, homogeneous โ so there is a free variable. Row reduction gives $$\operatorname{rref}=\begin{bmatrix}1&0&0&-\tfrac14\\0&1&0&-\tfrac54\\0&0&1&-\tfrac34\end{bmatrix},$$ so with $x_4=t$: $x_1=\tfrac t4$, $x_2=\tfrac{5t}{4}$, $x_3=\tfrac{3t}{4}$.
Whole numbers The smallest $t$ making every coefficient a positive whole number is $t=4$: $$\mathrm{C_3H_8}+5\,\mathrm{O_2}\ \longrightarrow\ 3\,\mathrm{CO_2}+4\,\mathrm{H_2O}.$$
Check C: $3=3$; H: $8=4\times2$; O: $5\times2=10=3\times2+4$ โ. The free variable says only the ratios $1:5:3:4$ are fixed โ doubling every coefficient describes the same reaction.
Polynomial Interpolation
Given measured data points, we often want a smooth formula that passes exactly through them โ to estimate values in between, to draw a smooth path for a robot arm or an animated character, or to design the curve of a road. The simplest choice is a polynomial. If $p(x)=a_0+a_1x+a_2x^2+\dots+a_nx^n$ must pass through $(x_0,y_0),\dots,(x_n,y_n)$, then each point gives one equation $p(x_i)=y_i$ that is linear in the unknown coefficients $a_0,\dots,a_n$ (even though $p$ is not linear in $x$):
$$\left[\begin{array}{ccccc|c}1&x_0&x_0^2&\cdots&x_0^n&y_0\\1&x_1&x_1^2&\cdots&x_1^n&y_1\\\vdots&&&&\vdots&\vdots\\1&x_n&x_n^2&\cdots&x_n^n&y_n\end{array}\right].$$
The coefficient matrix is called a Vandermonde matrix.
๐ Theorem 1.6 โ Polynomial interpolation
Let $(x_0,y_0),(x_1,y_1),\dots,(x_n,y_n)$ be $n+1$ points whose $x$-coordinates $x_0,\dots,x_n$ are distinct. Then there is exactly one polynomial $p$ of degree at most $n$ with $p(x_i)=y_i$ for $i=0,1,\dots,n$. It is called the interpolating polynomial of the points.
Reason. First take every $y_i=0$. A polynomial of degree at most $n$ that is zero at $n+1$ different numbers must be the zero polynomial (a nonzero one has at most $n$ roots), so this homogeneous system has only the trivial solution โ no free variables, so all $n+1$ columns of the square Vandermonde matrix are pivot columns. Then every row has a pivot too, so no row $\left[\,0\ \cdots\ 0\mid c\,\right]$ can appear for any right-hand side: by Theorem 1.4 the system has exactly one solution for every choice of $y_0,\dots,y_n$.
โ๏ธ Example 4 โ A parabola through three points
Find the polynomial of degree at most $2$ whose graph passes through $(-1,6)$, $(1,2)$ and $(2,3)$.
๐ก Show solutionโถ
System With $p(x)=a_0+a_1x+a_2x^2$: $$\left[\begin{array}{ccc|c}1&-1&1&6\\1&1&1&2\\1&2&4&3\end{array}\right]$$
Solve $a_2=1$, $a_1=-2$, $a_0=6+a_1-a_2=3$. So $p(x)=x^2-2x+3$.
Check $p(-1)=1+2+3=6$ โ, $p(1)=1-2+3=2$ โ, $p(2)=4-4+3=3$ โ. Drag the points in Interactive 2 to see how the parabola and its system change.
Interactive 2 โ Drag the Data, Watch the Interpolating Polynomial
Drag any orange point (it snaps to halves). The table shows the augmented matrix $\left[\,V\mid\mathbf{y}\,\right]$ for the coefficients $a_0,a_1,\dots$, which is solved exactly by GaussโJordan elimination every time you move a point; the blue curve is the unique interpolating polynomial of Theorem 1.6. Two points can never share an $x$-coordinate. Play moves the last point up and down.
interpolating polynomial $p(x)$โ
points / degree at mostโ
check: $p(x_i)=y_i$โ
โ ๏ธ Interpolation is not the same as a good model
1. Distinct $x$-values are essential. Two points with the same $x$ but different $y$ cannot lie on the graph of any function, and the system has two contradictory rows.
2. More points, wilder curves. A polynomial through many points can swing violently between them, especially near the ends. For noisy measurements it is usually better to fit a simple curve that passes near the points โ the method of least squares in Section 8.3.
3. Don't extrapolate far. An interpolating polynomial is trustworthy, if at all, only between the data points.
Mixtures, Nutrition and Partial Fractions
Whenever several ingredients each contribute fixed amounts of several properties โ nutrients in foods, metals in alloys, interest from investments โ matching a target gives one equation per property.
โ๏ธ Example 5 โ Planning a meal
A sports dietitian combines three foods. Per serving, food $A$ provides $4$ g protein, $20$ g carbohydrate and $2$ g fat; food $B$ provides $9$ g, $15$ g and $1$ g; food $C$ provides $8$ g, $10$ g and $6$ g. How many servings of each give exactly $41$ g protein, $85$ g carbohydrate and $23$ g fat?
๐ก Show solutionโถ
Model With $a,b,c$ servings: $$\left[\begin{array}{ccc|c}4&9&8&41\\20&15&10&85\\2&1&6&23\end{array}\right]\quad\begin{array}{l}\text{protein}\\\text{carbohydrate}\\\text{fat}\end{array}$$
Reduce Put the row with the small leading entry on top, $R_1\leftrightarrow R_3$, then clear column 1: $$\left[\begin{array}{ccc|c}2&1&6&23\\20&15&10&85\\4&9&8&41\end{array}\right]\xrightarrow{\ R_2\to R_2-10R_1,\ \ R_3\to R_3-2R_1\ }\left[\begin{array}{ccc|c}2&1&6&23\\0&5&-50&-145\\0&7&-4&-5\end{array}\right]$$ $$\xrightarrow{\ R_2\to\frac15R_2\ }\left[\begin{array}{ccc|c}2&1&6&23\\0&1&-10&-29\\0&7&-4&-5\end{array}\right]\xrightarrow{\ R_3\to R_3-7R_2\ }\left[\begin{array}{ccc|c}2&1&6&23\\0&1&-10&-29\\0&0&66&198\end{array}\right]$$
Solve $c=3$; $b=-29+30=1$; $2a=23-1-18=4$, so $a=2$. The meal is $2$ servings of $A$, $1$ of $B$ and $3$ of $C$.
Check Protein $8+9+24=41$ g โ, carbohydrate $40+15+30=85$ g โ, fat $4+1+18=23$ g โ. All amounts are non-negative, so the plan is realistic.
Partial fractions (uses calculus). In Calculus II, rational functions are integrated by splitting them into partial fractions. Finding the unknown numerators is a linear-systems problem: clear denominators and compare coefficients of each power of $x$.
โ๏ธ Example 6 โ Partial fractions by a linear system
Find $A$, $B$, $C$ with $$\frac{x^2+2x+3}{(x-1)(x+1)(x+2)}=\frac{A}{x-1}+\frac{B}{x+1}+\frac{C}{x+2}.$$
Reduce $$\left[\begin{array}{ccc|c}1&1&1&1\\3&1&0&2\\2&-2&-1&3\end{array}\right]\xrightarrow{\ R_2\to R_2-3R_1,\ \ R_3\to R_3-2R_1\ }\left[\begin{array}{ccc|c}1&1&1&1\\0&-2&-3&-1\\0&-4&-3&1\end{array}\right]\xrightarrow{\ R_3\to R_3-2R_2\ }\left[\begin{array}{ccc|c}1&1&1&1\\0&-2&-3&-1\\0&0&3&3\end{array}\right]$$ So $C=1$, $-2B-3=-1$ gives $B=-1$, and $A=1-B-C=1$.
Result $$\frac{x^2+2x+3}{(x-1)(x+1)(x+2)}=\frac{1}{x-1}-\frac{1}{x+1}+\frac{1}{x+2}.$$ Check at $x=0$: left side $\tfrac{3}{(-1)(1)(2)}=-\tfrac32$; right side $-1-1+\tfrac12=-\tfrac32$ โ. (Integrating now gives $\ln|x-1|-\ln|x+1|+\ln|x+2|+C$ โ uses calculus.)
๐งญ Problem-solving strategy โ building a linear model
Name the unknowns with units (vehicles/h, amperes, servings, coefficients).
One rule, one equation: conservation at each junction, Kirchhoff's laws, one equation per element, per data point, per nutrient.
Row-reduce the augmented matrix and classify the solution set with Theorem 1.4.
Interpret: impose real-world restrictions (non-negative flows, whole-number molecules), explain free variables and contradictions, and check the answer in the original rules.
Exercises
I
Network flow. Flows are in vehicles per hour (parts 1โ3) and litres per second (parts 4โ5).
1 A one-way roundabout has entry/exit points $P$, $Q$, $R$, $S$ in clockwise order, with flows $x_1$ ($P\to Q$), $x_2$ ($Q\to R$), $x_3$ ($R\to S$) and $x_4$ ($S\to P$) on the roundabout itself. At $P$, $300$ vehicles enter and $200$ leave; at $Q$, $150$ enter and $250$ leave; at $R$, $200$ enter and $300$ leave; at $S$, $250$ enter and $150$ leave. Write the junction equations and find the general solution.
2 For the roundabout of part 1, find the smallest possible flow on each of the four segments.
3 The segment $S\to P$ of the roundabout is closed for repairs. Can the traffic of part 1 still be handled? Explain.
4 Water enters a pipe network at junction $A$ at $100$ L/s and leaves at junction $C$ ($60$ L/s) and junction $D$ ($40$ L/s). The pipes are $A\to B$ ($x_1$), $A\to D$ ($x_2$), $B\to C$ ($x_3$), $D\to C$ ($x_4$) and $B\to D$ ($x_5$). Find the general flow and state the restrictions on the free variables that keep every flow non-negative.
5 In part 4 the pipe $B\to D$ is shut and a meter shows $x_3=40$ L/s. Find the other flows.
๐ก Show solutionsโถ
1 $P$: $x_4+300=x_1+200$; $Q$: $x_1+150=x_2+250$; $R$: $x_2+200=x_3+300$; $S$: $x_3+250=x_4+150$. The RREF has pivots in columns 1โ3 and a zero row; with $x_4=t$: $$x_1=t+100,\quad x_2=t,\quad x_3=t-100,\quad x_4=t.$$
2 All flows $\ge0$ requires $t-100\ge0$, i.e. $t\ge100$. The smallest flows are $x_1=200$, $x_2=100$, $x_3=0$, $x_4=100$ vehicles/h (all at $t=100$).
3 No. Closing $S\to P$ forces $t=x_4=0$, and then $x_3=-100$: $100$ vehicles/h would have to drive the wrong way from $S$ to $R$. With these entry and exit numbers the closure is impossible: the $250$ vehicles/h entering at $S$ could only leave by the $150$ vehicles/h exit at $S$. The traffic entering at $S$ would need to be reduced (or $100$ more vehicles/h allowed to exit there), or a diversion opened.
4 $A$: $x_1+x_2=100$; $B$: $x_1=x_3+x_5$; $C$: $x_3+x_4=60$; $D$: $x_2+x_5=x_4+40$. Two free variables: with $x_3=s$, $x_5=t$, $$x_1=s+t,\quad x_2=100-s-t,\quad x_3=s,\quad x_4=60-s,\quad x_5=t.$$ Non-negativity: $0\le s\le60$, $t\ge0$ and $s+t\le100$.
5 $t=0$, $s=40$: $x_1=40$, $x_2=60$, $x_4=20$ L/s. Check at $D$: in $60+0$, out $20+40$ โ.
II
Electrical circuits. Parts 2โ4 use the layout of the figure for Example 2 (left branch: battery $E_1$ and resistor $R_1$, current $I_1$ upward; middle branch: resistor $R_3$, current $I_3$ downward; right branch: battery $E_2$ and resistor $R_2$, current $I_2$ upward), with new values.
1 A single loop contains a $12$ V battery and resistors of $2\ \Omega$ and $4\ \Omega$ in series. Use Kirchhoff's voltage law to find the current.
3 $E_1=10$ V, $R_1=2\ \Omega$, $R_3=4\ \Omega$, $R_2=2\ \Omega$, $E_2=4$ V. Find the currents and interpret any negative value.
4 For the circuit of part 2, find the power $I^2R$ used in each resistor and check that the total equals the power $E_1I_1+E_2I_2$ supplied by the batteries.
๐ก Show solutionsโถ
1 $12=2I+4I$, so $I=2$ A.
2 $I_1+I_2-I_3=0$, $\ 2I_1+2I_3=8$, $\ 3I_2+2I_3=12$. Row reduction gives $I_1=1$ A, $I_2=2$ A, $I_3=3$ A. Check: $2+6=8$ โ, $6+6=12$ โ.
3 $I_1+I_2-I_3=0$, $\ 2I_1+4I_3=10$, $\ 2I_2+4I_3=4$. Substituting $I_3=I_1+I_2$: $6I_1+4I_2=10$ and $4I_1+6I_2=4$, so $I_1=\tfrac{11}{5}=2.2$ A, $I_2=-\tfrac45=-0.8$ A, $I_3=\tfrac75=1.4$ A. The negative $I_2$ means $0.8$ A actually flows downward through the right branch: the stronger $10$ V battery forces current backwards through the $4$ V battery (as when a battery is being charged).
4 $R_1$: $1^2\cdot2=2$ W; $R_2$: $2^2\cdot3=12$ W; $R_3$: $3^2\cdot2=18$ W; total $32$ W. Supplied: $8(1)+12(2)=32$ W โ โ energy is conserved.
III
Balance each chemical equation with the smallest positive whole numbers by setting up and solving a homogeneous linear system.
1 $\mathrm{H_2}+\mathrm{O_2}\to\mathrm{H_2O}$
2 $\mathrm{N_2}+\mathrm{H_2}\to\mathrm{NH_3}$ (making ammonia for fertiliser)
6 Unknowns $x_1,\dots,x_6$ in order. K: $x_1=x_3$; Mn: $x_1=x_4$; O: $4x_1=x_5$; H: $x_2=2x_5$; Cl: $x_2=x_3+2x_4+2x_6$. Five equations, six unknowns: one free variable. With $x_1=t$: $x_3=x_4=t$, $x_5=4t$, $x_2=8t$, and $8t=t+2t+2x_6$ gives $x_6=\tfrac{5t}{2}$. $t=2$: $$2\mathrm{KMnO_4}+16\mathrm{HCl}\to2\mathrm{KCl}+2\mathrm{MnCl_2}+8\mathrm{H_2O}+5\mathrm{Cl_2}.$$
IV
Polynomial interpolation.
1 Find the polynomial of degree at most $2$ through $(0,1)$, $(1,2)$, $(2,5)$.
2 Find the polynomial of degree at most $2$ through $(-1,4)$, $(1,0)$, $(3,8)$.
3 Find the polynomial of degree at most $3$ through $(-1,2)$, $(0,1)$, $(1,0)$, $(2,5)$.
4Weather. The temperature in Muscat on a summer morning is $18\,^\circ$C at 6:00, $26\,^\circ$C at 8:00 and $30\,^\circ$C at 10:00. With $t$ = hours after 6:00, fit $T(t)=a_0+a_1t+a_2t^2$ to these readings and use the vertex of the parabola to predict the time and value of the maximum temperature.
5 Show that no polynomial of degree at most $2$ passes through $(0,0)$, $(1,1)$, $(2,4)$, $(3,10)$. Which degree is needed?
6 For which value of $k$ do the points $(0,1)$, $(1,3)$, $(2,5)$, $(3,k)$ lie on a straight line? What is the interpolating polynomial of degree at most $3$ for that $k$?
Check: plot the data and the interpolating polynomial
2 $\left[\begin{array}{ccc|c}1&-1&1&4\\1&1&1&0\\1&3&9&8\end{array}\right]$: $R_2\to R_2-R_1$ gives $2a_1=-4$, so $a_1=-2$; $R_3\to R_3-R_1$ gives $4a_1+8a_2=4$, so $a_2=\tfrac32$; $a_0=4+a_1-a_2=\tfrac12$. $p(x)=\tfrac32x^2-2x+\tfrac12$.
3 $a_0=1$; $a_0-a_1+a_2-a_3=2$; $a_0+a_1+a_2+a_3=0$; $a_0+2a_1+4a_2+8a_3=5$. Adding the middle two: $2+2a_2=2$, so $a_2=0$; then $a_1+a_3=-1$ and $2a_1+8a_3=4$, so $a_3=1$, $a_1=-2$. $p(x)=x^3-2x+1$.
4 $a_0=18$; $18+2a_1+4a_2=26$; $18+4a_1+16a_2=30$. So $a_1+2a_2=4$ and $a_1+4a_2=3$, giving $a_2=-\tfrac12$, $a_1=5$: $T(t)=18+5t-\tfrac12t^2$. The vertex is at $t=-\dfrac{5}{2(-1/2)}=5$, i.e. 11:00, with $T(5)=18+25-12.5=30.5\,^\circ$C. (A rough model: real afternoon temperatures depend on much more than three readings.)
5 The first three points force $p(x)=x^2$ (they determine a unique parabola by Theorem 1.6), but then $p(3)=9\ne10$; equivalently the $4\times4$ augmented system reduces to a row $\left[\,0\ 0\ 0\mid c\ne0\,\right]$. Four points need degree at most $3$: here $p(x)=\tfrac16x^3+\tfrac12x^2+\tfrac13x$.
6 The line through $(0,1)$ and $(1,3)$ is $y=2x+1$; it also passes through $(2,5)$, and at $x=3$ it gives $7$, so $k=7$. Then the unique interpolating polynomial of degree at most $3$ is $p(x)=2x+1$ itself โ its $x^2$ and $x^3$ coefficients are $0$. "Degree at most $n$" allows lower degrees.
V
Mixtures, money and partial fractions.
1Metallurgy. Alloy $A$ is $60\%$ copper, $30\%$ zinc, $10\%$ tin; alloy $B$ is $20\%$, $70\%$, $10\%$; alloy $C$ is $40\%$, $20\%$, $40\%$. How many kilograms of each must be melted together to make $100$ kg of an alloy that is $44\%$ copper, $40\%$ zinc and $16\%$ tin?
2Nutrition. A serving of food $X$ has $10$ g protein and $5$ g fat; a serving of food $Y$ has $4$ g protein and $8$ g fat. How many servings of each give $38$ g protein and $31$ g fat?
3Finance. An investor puts $20\,000$ OMR into three funds paying $3\%$, $5\%$ and $8\%$ a year. The amount in the $5\%$ fund equals the total in the other two, and the yearly interest is $1050$ OMR. How much is in each fund?
4Partial fractions. Find $A$, $B$ with $\dfrac{3x+5}{(x+1)(x+3)}=\dfrac{A}{x+1}+\dfrac{B}{x+3}$.
5Partial fractions. Find $A$, $B$, $C$ with $\dfrac{2x^2-x+1}{x(x-1)^2}=\dfrac{A}{x}+\dfrac{B}{x-1}+\dfrac{C}{(x-1)^2}$.
6Economics. Two related goods have demand and supply (in units) $Q_{d1}=100-2P_1+P_2$, $Q_{s1}=-20+4P_1$ and $Q_{d2}=80+P_1-3P_2$, $Q_{s2}=-45+2P_2$, where $P_1,P_2$ are prices in OMR. Find the equilibrium prices (supply $=$ demand for both goods) and quantities.
๐ก Show solutionsโถ
1 $0.6a+0.2b+0.4c=44$, $\ 0.3a+0.7b+0.2c=40$, $\ 0.1a+0.1b+0.4c=16$ (kg of each metal; these three add up to $a+b+c=100$). Row reduction gives $a=50$, $b=30$, $c=20$ kg. Check copper: $30+6+8=44$ kg โ.
2 $10x+4y=38$, $5x+8y=31$. $R_2\to R_2-\tfrac12R_1$: $6y=12$, so $y=2$ and $x=3$: $3$ servings of $X$ and $2$ of $Y$.
3 $a+b+c=20\,000$, $\ b=a+c$, $\ 0.03a+0.05b+0.08c=1050$. The first two give $b=10\,000$ and $a+c=10\,000$; then $0.03a+0.08c=550$ gives $0.05c=250$. So $5000$ OMR at $3\%$, $10\,000$ OMR at $5\%$ and $5000$ OMR at $8\%$. Check: $150+500+400=1050$ โ.
4 $3x+5=A(x+3)+B(x+1)$: $A+B=3$, $3A+B=5$, so $A=1$, $B=2$: $\dfrac{3x+5}{(x+1)(x+3)}=\dfrac1{x+1}+\dfrac2{x+3}$.
6 Good 1: $100-2P_1+P_2=-20+4P_1$, i.e. $6P_1-P_2=120$. Good 2: $80+P_1-3P_2=-45+2P_2$, i.e. $P_1-5P_2=-125$. Solving: $P_1=25$ OMR, $P_2=30$ OMR; quantities $Q_1=-20+100=80$ units and $Q_2=-45+60=15$ units.
๐ฌ ResearchโTeaching NexusResearch-tutored ยท optional, about 30 minutes
Research question. A city wants to know the traffic on every street of a district but can only afford a few automatic counters. What is the smallest number of counters, and where must they go, so that conservation of flow determines all the other streets?
Why it matters. Traffic engineers in cities from Muscat to Manchester plan signal timings, bus lanes and road works from flow data. Counters cost money to install and maintain; linear algebra says exactly how much information is missing.
What to do.
Sketch a real district you know (5โ8 junctions) as a network of one-way or two-way streets (treat a two-way street as two branches). Assume the flows entering and leaving the district are known from its boundary roads.
Write the junction equations and row-reduce. The number of free variables is the number of streets that must be measured.
Compare with the formula $m-n+1$ for a connected network with $n$ junctions and $m$ internal streets. Test it on Example 1 and on Exercise I.4.
Choose which streets to measure: try making your free variables the measured streets, and check that a different choice of streets (for example, all streets around a single block) does not always work.
Tools: a map of your district; Python (sympy.Matrix.rref), an online RREF calculator or pen and paper
Hand in: Your network diagram, the RREF, the minimum number of counters, a valid set of street positions, and one sentence on what happens if a counter fails.
Going further. Real counts are noisy, so the junction equations are never satisfied exactly. Look up how transport agencies "balance" traffic counts โ it is a least-squares problem (Section 8.3).
Instructor note: for a connected network with all boundary flows known, the $n$ junction equations have rank $n-1$ (they always sum to "total in $=$ total out"), so there are $m-(n-1)$ free variables: $1$ for Example 1 ($m=n=4$) and $2$ for Exercise I.4 ($m=5$, $n=4$). A set of measured streets works exactly when it contains at least one street of every cycle of the network โ measuring several streets of one block while leaving another block unmeasured fails.
๐งช Self-check quiz
0/5 correct
Q1. At a junction, flows $x_1$ and $200$ come in, while $x_2$ and $350$ go out. Conservation of flow gives
Q2. Kirchhoff's voltage law says that around any closed loop of a circuit
Q3. Balancing a chemical equation with $4$ molecules and $3$ elements leads to
Q4. How many points with distinct $x$-coordinates determine a unique polynomial of degree at most $3$?
Q5. In Example 1 the flows are $x_1=500-t$, $x_2=300-t$, $x_3=100+t$, $x_4=t$, all required to be $\ge0$. The largest possible value of $x_3$ is