## Direct and Indirect Cost Example With Matrices

A company has two production departments,
$P_1, \: P_2$
and three service departments
$S_1, \: S_2, |; S_3$
. The monthly costs
$x_1, \: x_2, \: x_3, \: x_4, \: x_5$
of each department are unknown, and the direct monthly cost of each department are shown in the third column. The fourth, fifth and sixth columns shown the allocation of charges for the services of
$S_1, \: S_2, \: S_3$
to the various departments. The problem is to find the total cost for each department.
 Department Total Cost Direct Cost $S_1$ $S_2$ $S_3$ $S_1$ $x_1$ 600 0.25$x_1$ 0.15$x_2$ 0.15$x_3$ $S_2$ $x_2$ 1100 0.35$x_1$ 0.20$x_2$ 0.25$x_3$ $S_3$ $x_3$ 600 0.10$x_1$ 0.10$x_2$ 0.35$x_3$ $P_1$ $x_4$ 2100 0.15$x_1$ 0.25$x_2$ 0.15$x_3$ $P_2$ $x_5$ 1500 0.15$x_1$ 0.30$x_2$ 0.10$x_3$ Total $x_1$ $x_2$ $x_3$
The total cost for each department is as follows:
$x_1=600+0.25x_1+0.15x_2+0.15x_3$

$x_2=1100+0.35x_1+0.20x_2+0.25x_3$

$x_3=600+0.10x_1+0.10x_2+0.35x_3$

We can write this as
$\begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}= \begin{pmatrix}600\\1100\\600\end{pmatrix}+ \left( \begin{array}{ccc} 0.25 & 0.15 & 0.15 \\ 0.35 & 0.20 & 0.25 \\ 0.10 & 0.10 & 0.35 \end{array} \right) \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}$
, or
$(\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right) - \left( \begin{array}{ccc} 0.25 & 0.15 & 0.15 \\ 0.35 & 0.20 & 0.25 \\ 0.10 & 0.10 & 0.35 \end{array} \right)) \begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}= \begin{pmatrix}600\\1100\\600\end{pmatrix}$

Hence
$\begin{pmatrix}x_1\\x_2\\x_3\end{pmatrix}={(\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right) - \left( \begin{array}{ccc} 0.25 & 0.15 & 0.15 \\ 0.35 & 0.20 & 0.25 \\ 0.10 & 0.10 & 0.35 \end{array} \right) )}^{-1} \begin{pmatrix}600\\1100\\600\end{pmatrix}=\begin{pmatrix}1638\\2569\\1562\end{pmatrix}$

with these values the table becomes
 Department Total Cost Direct Cost $S_1$ $S_2$ $S_3$ $S_1$ 1638 600 409.50 385.35 234.30 $S_2$ 2569 1100 573.30 523.80 390.50 $S_3$ 1562 600 163.80 256.90 546.70 $P_1$ $322.25$ 2100 245.70 542.25 234.30 $P_2$ $2672.60$ 1500 245.70 770.70 156.20