---
title: "Applications: Leontief Economics and Computer Graphics"
module: Matrix Algebra
moduleNumber: 2
lessonNumber: 5
order: 205
summary: >
  The Leontief input–output model balances an economy through (I − C)x = d and
  expands the inverse as a geometric series in the consumption matrix. Computer
  graphics moves figures with matrix products, using homogeneous coordinates so
  that translation and perspective projection become matrix multiplications too.
topics: [Matrix Algebra]
sources:
  - book: Lay
    ref: "Ch. 2 — Matrix Algebra; §2.6 The Leontief Input–Output Model, §2.7 Applications to Computer Graphics"
---

The Leontief input–output model, recognized with a Nobel Prize in economics,
balances supply against demand across an entire economy through a single matrix
equation, solved with the
[inverse](/linear-algebra/matrix-algebra/matrix-inverse-and-invertibility) and a
series expansion in powers of a matrix. Computer graphics animates figures by
[multiplying](/linear-algebra/matrix-algebra/matrix-operations) their vertex
coordinates by transformation matrices, and a change of coordinates lets even
translation and perspective, which are not linear, join the same matrix
arithmetic.

## The Leontief input–output model

Divide an economy into $n$ sectors that produce goods or services. Let the
**production vector** $x \in \mathbb{R}^n$ list each sector's yearly output, and
let the **final demand vector** $d \in \mathbb{R}^n$ list what a non-productive
**open sector** (consumers, government, exports) demands. Producing goods itself
consumes goods: making output creates **intermediate demand** for inputs. The
model seeks a production level that exactly balances the two demands,

$$
\underbrace{x}_{\text{produced}} = \underbrace{\text{intermediate demand}}_{\text{used up in production}} + \underbrace{d}_{\text{final demand}}.
$$

$$
% caption: Flow in a three-sector economy: sectors feed one another (intermediate
% demand) while the open sector draws off the final demand d.
\begin{tikzpicture}[>=stealth, font=\footnotesize,
  sec/.style={draw, minimum width=22mm, minimum height=9mm, align=center, font=\scriptsize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[sec] (m) at (0,2.0) {manufacturing};
  \node[sec] (a) at (-2.6,-0.6) {agriculture};
  \node[sec] (s) at (2.6,-0.6) {services};
  \node[sec] (o) at (0,-2.4) {open sector};
  % inter-sector flows
  \draw[->] (m) to[bend right=15] (a);
  \draw[->] (a) to[bend right=15] (m);
  \draw[->] (m) to[bend left=15] (s);
  \draw[->] (s) to[bend left=15] (m);
  \draw[->] (a) to[bend right=12] (s);
  \draw[->] (s) to[bend right=12] (a);
  % final demand to open sector
  \draw[->, black, thick] (a) -- (o);
  \draw[->, black, thick] (s) -- (o);
  \draw[->, black, thick] (m) -- (o);
  \node[black, font=\scriptsize, anchor=west, fill=white, inner sep=1.5pt] at (1.15,-1.75) {f\/inal demand $d$};
\end{tikzpicture}
$$

The model's assumption is that each sector has a fixed **unit consumption
vector**: the inputs, from every sector, needed per unit of its output. Collecting
these as columns forms the **consumption matrix** $C = [\,c_1 \; \cdots \; c_n\,]$.
If sector $j$ plans output $x_j$, its intermediate demand is $x_j c_j$, so the
total intermediate demand is

$$
x_1 c_1 + \cdots + x_n c_n = Cx.
$$

> **Definition (Leontief production equation).** With production $x$, consumption
> matrix $C$, and final demand $d$, the input–output model is
> $$
> x = Cx + d, \qquad \text{equivalently} \qquad (I - C)x = d.
> $$

> **Worked example.** If manufacturing has unit consumption vector
> $c_1 = (.5, .2, .1)$ and plans $100$ units of output, its intermediate demand is
>
> $$
> 100\,c_1 = 100\begin{bmatrix} .5 \\ .2 \\ .1 \end{bmatrix} = \begin{bmatrix} 50 \\ 20 \\ 10 \end{bmatrix}.
> $$
>
> Producing $100$ units consumes $50$ units of manufacturing output, $20$ of
> agriculture, and $10$ of services.

### Solving the model

> **Worked example.** Take three sectors with consumption matrix and demand
>
> $$
> C = \begin{bmatrix} .5 & .4 & .2 \\ .2 & .3 & .1 \\ .1 & .1 & .3 \end{bmatrix},
> \qquad
> d = \begin{bmatrix} 50 \\ 30 \\ 20 \end{bmatrix}.
> $$
>
> Each column of $C$ sums to less than $1$: a sector needs under one unit of
> inputs per unit of output. The coefficient matrix is
>
> $$
> I - C = \begin{bmatrix} .5 & -.4 & -.2 \\ -.2 & .7 & -.1 \\ -.1 & -.1 & .7 \end{bmatrix},
> $$
>
> and row reducing $[\,I - C \mid d\,]$ gives the production level, to the nearest
> unit,
>
> $$
> x \approx \begin{bmatrix} 226 \\ 119 \\ 78 \end{bmatrix}.
> $$
>
> Manufacturing produces far more than the $50$ units demanded of it, because
> every sector, manufacturing included, consumes manufacturing output as an input.

### When a solution exists

The economics guarantees the equation is solvable and the answer is meaningful.

> **Theorem (Leontief solvability).** Let $C$ be a consumption matrix and $d$ a
> final demand, both with nonnegative entries. If every column sum of $C$ is less
> than $1$, then $(I - C)^{-1}$ exists, and the production vector
> $$
> x = (I - C)^{-1} d
> $$
> has nonnegative entries and is the unique solution of $x = Cx + d$.

Nonnegativity matters: a production vector with a negative entry would be
economically meaningless. The column-sum condition is the natural one — a sector
that consumed a full unit or more of inputs per unit of output could never run a
surplus.

### The inverse as a series

The proof of the Leontief solvability theorem also yields a way to compute $(I - C)^{-1}$ and an
economic reading of it. Imagine meeting the demand $d$ in rounds. First produce
$d$; this needs inputs $Cd$. Producing $Cd$ needs $C(Cd) = C^2 d$; producing that
needs $C^3 d$; and so on. The total production is

$$
x = d + Cd + C^2 d + C^3 d + \cdots = (I + C + C^2 + C^3 + \cdots)\,d.
$$

The bracketed sum is $(I - C)^{-1}$, justified by the finite identity

$$
(I - C)(I + C + C^2 + \cdots + C^m) = I - C^{m+1}.
$$

When the column sums of $C$ are all below $1$, the powers $C^m$ approach the zero
matrix, so $C^{m+1} \to 0$ and the right side tends to $I$. Thus

$$
(I - C)^{-1} \approx I + C + C^2 + \cdots + C^m,
$$

and in practice the powers shrink fast enough that a few terms suffice.

$$
% caption: Meeting demand d in rounds: each round of production creates the next
% round of intermediate demand, and the geometric series in C sums to (I − C)⁻¹.
\begin{tikzpicture}[>=stealth, font=\footnotesize,
  rd/.style={draw, minimum width=15mm, minimum height=8mm, align=center, font=\scriptsize}]
  \definecolor{acc}{HTML}{4A6FA5}
  \node[rd] (d0) at (0,0) {$d$};
  \node[rd] (d1) at (2.6,0) {$Cd$};
  \node[rd] (d2) at (5.2,0) {$C^2 d$};
  \node[rd] (d3) at (7.8,0) {$C^3 d$};
  \node (dots) at (9.7,0) {etc.};
  \draw[->, thick] (d0) -- (d1) node[midway, above, font=\scriptsize] {apply $C$};
  \draw[->, thick] (d1) -- (d2) node[midway, above, font=\scriptsize] {apply $C$};
  \draw[->, thick] (d2) -- (d3) node[midway, above, font=\scriptsize] {apply $C$};
  \draw[->, thick] (d3) -- (dots);
  \draw[black] (-0.9,-0.7) -- (-0.9,-0.95) -- (8.7,-0.95) -- (8.7,-0.7);
  \node[black, font=\scriptsize] at (3.9,-1.25) {sum of all rounds $= x$};
\end{tikzpicture}
$$

The entries of $(I - C)^{-1}$ carry economic meaning: **column $j$ lists the extra
output each sector must produce to satisfy a one-unit increase in final demand for
sector $j$**. If final demand shifts from $d$ to $d + \Delta d$, production shifts
by $\Delta x = (I - C)^{-1}\Delta d$, so the inverse is the multiplier that
propagates a demand change through the whole economy.

## Computer graphics

A graphical object is stored as a list of vertices, connected by line segments.
Because the standard transformations map line segments to line segments, moving an
object reduces to transforming its vertices and reconnecting them.

> **Definition (Data matrix).** The **data matrix** $D$ of a figure stores its
> vertices as columns. A linear transformation with matrix $A$ acts on the whole
> figure at once: the columns of $AD$ are the transformed vertices.

For example, the shear $A = \begin{bmatrix} 1 & .25 \\ 0 & 1 \end{bmatrix}$ slants
a figure by shifting each point's $x$-coordinate in proportion to its height,
turning an upright letter into an italic one; following it with the $x$-scaling
$S = \begin{bmatrix} .75 & 0 \\ 0 & 1 \end{bmatrix}$ compensates for the added
width. The composite transformation is the single matrix $SA$.

$$
% caption: A shear matrix slants a figure by displacing each vertex horizontally
% in proportion to its height; the outline is transformed vertex by vertex.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  % upright square with an arrow motif
  \draw[black] (0,0) rectangle (1.4,1.8);
  \draw[black] (0,0) -- (1.4,1.8);
  \node[black, font=\scriptsize] at (0.7,-0.35) {upright};
  % arrow
  \draw[->, very thick] (2.1,0.9) -- (3.3,0.9) node[midway, above, font=\scriptsize] {shear};
  % sheared parallelogram (top shifted right by 0.45)
  \draw[acc, thick] (4.0,0) -- (5.4,0) -- (5.85,1.8) -- (4.45,1.8) -- cycle;
  \draw[acc, thick] (4.0,0) -- (5.85,1.8);
  \node[black, font=\scriptsize] at (4.9,-0.35) {slanted};
\end{tikzpicture}
$$

### Homogeneous coordinates

A translation $(x, y) \mapsto (x + h, y + k)$ is not linear (it moves the origin),
so it is not multiplication by a $2 \times 2$ matrix. To address this, lift the
plane one level.

> **Definition (Homogeneous coordinates).** The point $(x, y)$ in $\mathbb{R}^2$
> is given **homogeneous coordinates** $(x, y, 1)$, identifying it with the point
> one unit above the $xy$-plane. Homogeneous coordinates are transformed by
> $3 \times 3$ matrices.

$$
% caption: Homogeneous coordinates lift each point of the plane to the copy of the
% plane one unit up, where a 3-by-3 matrix can act on the third coordinate.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  \draw[black] (0,0) -- (3.2,0) -- (4.4,1.0) -- (1.2,1.0) -- cycle;
  \node[black, font=\scriptsize, anchor=east] at (0,0.5) {plane $z = 0$};
  \fill[acc!10] (0,2.0) -- (3.2,2.0) -- (4.4,3.0) -- (1.2,3.0) -- cycle;
  \draw[acc] (0,2.0) -- (3.2,2.0) -- (4.4,3.0) -- (1.2,3.0) -- cycle;
  \node[black, font=\scriptsize, anchor=east] at (0,2.5) {plane $z = 1$};
  \fill[black] (2.0,0.6) circle (1.5pt);
  \node[black, font=\scriptsize, anchor=north] at (2.05,0.55) {point in the plane};
  \fill[acc] (2.0,2.6) circle (1.5pt);
  \node[black, font=\scriptsize, anchor=south] at (2.05,2.65) {lifted point};
  \draw[->, black, thick, dashed] (2.0,0.75) -- (2.0,2.5);
\end{tikzpicture}
$$

With the extra coordinate, translation becomes a matrix product:

$$
\begin{bmatrix} 1 & 0 & h \\ 0 & 1 & k \\ 0 & 0 & 1 \end{bmatrix}
\begin{bmatrix} x \\ y \\ 1 \end{bmatrix}
= \begin{bmatrix} x + h \\ y + k \\ 1 \end{bmatrix}.
$$

Any linear map on $\mathbb{R}^2$ with matrix $A$ becomes the block matrix
$\begin{bmatrix} A & 0 \\ 0 & 1 \end{bmatrix}$ in homogeneous coordinates, so
rotations, reflections, and scalings keep their familiar forms while translation
joins them. The three basic $3 \times 3$ transforms:

| Transformation | Homogeneous matrix |
| --- | --- |
| Translate by $(h, k)$ | $\begin{bmatrix} 1 & 0 & h \\ 0 & 1 & k \\ 0 & 0 & 1 \end{bmatrix}$ |
| Rotate by $\varphi$ about origin | $\begin{bmatrix} \cos\varphi & -\sin\varphi & 0 \\ \sin\varphi & \cos\varphi & 0 \\ 0 & 0 & 1 \end{bmatrix}$ |
| Scale $x$ by $s$, $y$ by $t$ | $\begin{bmatrix} s & 0 & 0 \\ 0 & t & 0 \\ 0 & 0 & 1 \end{bmatrix}$ |

### Composite transformations

Screen motion usually chains several transforms, and composition is matrix
multiplication in reverse order of application.

$$
% caption: The composite transform in stages: an upright flag is scaled, rotated
% 90° about the origin, then translated, one matrix product per arrow.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  % stage 1: original flag
  \draw[black, thick] (0,0) -- (0,1.4);
  \draw[black, thick] (0,1.4) -- (0.7,1.4) -- (0.7,0.95) -- (0,0.95);
  \node[black, font=\scriptsize] at (0.35,-0.4) {original};
  \draw[->, thick] (1.1,0.7) -- (1.9,0.7) node[midway, above, font=\scriptsize] {scale};
  % stage 2: scaled flag (smaller)
  \begin{scope}[xshift=2.3cm]
    \draw[black, thick] (0,0) -- (0,0.7);
    \draw[black, thick] (0,0.7) -- (0.35,0.7) -- (0.35,0.475) -- (0,0.475);
    \node[black, font=\scriptsize] at (0.3,-0.4) {scaled};
  \end{scope}
  \draw[->, thick] (3.1,0.7) -- (3.9,0.7) node[midway, above, font=\scriptsize] {rotate};
  % stage 3: rotated flag (pole now horizontal, banner down)
  \begin{scope}[xshift=4.6cm, yshift=0.35cm]
    \draw[black, thick] (0,0) -- (0.7,0);
    \draw[black, thick] (0.7,0) -- (0.7,-0.35) -- (0.475,-0.35) -- (0.475,0);
    \node[black, font=\scriptsize] at (0.35,-0.75) {rotated};
  \end{scope}
  \draw[->, thick] (5.6,0.7) -- (6.4,0.7) node[midway, above, font=\scriptsize] {translate};
  % stage 4: translated flag
  \begin{scope}[xshift=7.0cm, yshift=0.7cm]
    \draw[acc, thick] (0,0) -- (0.7,0);
    \draw[acc, thick] (0.7,0) -- (0.7,-0.35) -- (0.475,-0.35) -- (0.475,0);
    \node[black, font=\scriptsize] at (0.35,-1.1) {placed};
  \end{scope}
\end{tikzpicture}
$$

> **Worked example.** To scale by $.3$, then rotate $90^\circ$ about the origin,
> then translate by $(-.5, 2)$, multiply the three homogeneous matrices right to
> left. Combine the rotation and scaling first:
>
> $$
> \begin{bmatrix} 0 & -1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}
> \begin{bmatrix} .3 & 0 & 0 \\ 0 & .3 & 0 \\ 0 & 0 & 1 \end{bmatrix}
> = \begin{bmatrix} 0 & -.3 & 0 \\ .3 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}.
> $$
>
> Then apply the translation on the left:
>
> $$
> \begin{bmatrix} 1 & 0 & -.5 \\ 0 & 1 & 2 \\ 0 & 0 & 1 \end{bmatrix}
> \begin{bmatrix} 0 & -.3 & 0 \\ .3 & 0 & 0 \\ 0 & 0 & 1 \end{bmatrix}
> = \begin{bmatrix} 0 & -.3 & -.5 \\ .3 & 0 & 2 \\ 0 & 0 & 1 \end{bmatrix}.
> $$
>
> The single product performs all three moves at once.

Building the composite once and reusing it on every vertex is why graphics
hardware multiplies small matrices at high speed.

### Three dimensions and perspective

The same lift works one dimension higher: $(x, y, z)$ gets homogeneous coordinates
$(x, y, z, 1)$, and $4 \times 4$ matrices carry out rotation about an axis,
translation, and scaling in space. More generally $(X, Y, Z, H)$ with $H \ne 0$
represents the point $(X/H, Y/H, Z/H)$, so every nonzero scalar multiple of
$(x, y, z, 1)$ names the same point. That freedom is what makes perspective a
matrix operation.

To display a three-dimensional scene on a flat screen, project each point onto a
viewing plane through the viewer's eye. Put the screen at the $xy$-plane and the
eye at $(0, 0, d)$ on the positive $z$-axis. A point $(x, y, z)$ maps to the image
point $(x^\ast, y^\ast, 0)$ where the line from the eye through the point crosses
the screen. Similar triangles give

$$
x^\ast = \frac{x}{1 - z/d}, \qquad y^\ast = \frac{y}{1 - z/d}.
$$

$$
% caption: Perspective projection (side view in the xz-plane): the eye at (0,0,d)
% sees the point (x,y,z) at where its sight line crosses the screen z = 0.
\begin{tikzpicture}[>=stealth, font=\footnotesize]
  \definecolor{acc}{HTML}{4A6FA5}
  % axes: horizontal = x, vertical = z
  \draw[->, black] (-0.4,0) -- (5.4,0) node[anchor=west, font=\scriptsize] {$x$};
  \draw[->, black] (0,-0.4) -- (0,3.5) node[anchor=south, font=\scriptsize] {$z$};
  \node[black, font=\scriptsize, anchor=north] at (2.4,0) {screen $z = 0$};
  % eye on z-axis
  \fill[black] (0,3.0) circle (1.8pt);
  \node[black, anchor=east, font=\scriptsize] at (-0.05,3.0) {eye $(0,0,d)$};
  % object point
  \fill[acc] (2.4,1.4) circle (1.8pt);
  \node[black, anchor=south west, font=\scriptsize] at (2.45,1.45) {$(x,y,z)$};
  % sight line: eye through object, then dashed on to the screen point (4.5,0)
  \draw[acc, thick] (0,3.0) -- (2.4,1.4);
  \draw[acc, thick, dashed] (2.4,1.4) -- (4.5,0);
  % projected point on screen
  \fill[black] (4.5,0) circle (1.8pt);
  \node[black, anchor=north, font=\scriptsize] at (4.5,-0.05) {$(x_p, y_p, 0)$};
\end{tikzpicture}
$$

Scaling the image coordinates by $1 - z/d$, the point $(x, y, 0, 1 - z/d)$ is a
homogeneous representative of the projection, so a single matrix performs it:

$$
P\begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix}
= \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & -1/d & 1 \end{bmatrix}
\begin{bmatrix} x \\ y \\ z \\ 1 \end{bmatrix}
= \begin{bmatrix} x \\ y \\ 0 \\ 1 - z/d \end{bmatrix}.
$$

Dividing the first three entries by the fourth recovers the screen coordinates
$(x^\ast, y^\ast, 0)$. Continuous, realistic animation is a stream of such
$4 \times 4$ products — rotations, translations, and projections — which is why
graphics processors implement $4 \times 4$ matrix arithmetic directly in
hardware.

## Common ground

Both models reduce to matrix operations. Leontief economics solves $(I - C)x = d$
with the inverse, read as a demand multiplier and computed as a series in powers
of $C$; computer graphics composes transformation matrices, with homogeneous
coordinates extending matrix multiplication to translation and perspective. Powers
of a matrix and its inverse reappear in
[eigenvalues](/linear-algebra/eigenvalues/eigenvectors-and-eigenvalues) and the
[dynamical systems](/linear-algebra/eigenvalues/dynamical-systems) they
govern.[^lay-apps]

[^lay-apps]: **Lay**, _Linear Algebra and Its Applications_, §2.6 — the Leontief input–output model, the production equation $(I - C)x = d$, Theorem 11 on solvability, and the series expansion $(I - C)^{-1} = I + C + C^2 + \cdots$; §2.7 — data matrices, homogeneous coordinates for 2-D and 3-D graphics, composite transformations as matrix products, and the perspective projection matrix.
