Let x 1 , x 2 , x 3 x_1,x_2,x_3 x 1 , x 2 , x 3 be the amount of sodium in 1 slice pizza, 1 ice-cream and 1 soda respectively. We have
{ x 1 + x 2 + x 3 = 1030 3 x 1 + 2 x 3 = 2420 2 x 1 + x 2 + 2 x 3 = 1910 ⇒ ( 1 1 1 3 0 1 2 1 2 ) ( x 1 x 2 x 3 ) = ( 1030 2420 1910 ) ⇒ ⇒ ( x 1 x 2 x 3 ) = ( 1 1 1 3 0 1 2 1 2 ) − 1 ( 1030 2420 1910 ) \left\{ \begin{array}{c} x_1+x_2+x_3=1030\\ 3x_1+2x_3=2420\\ 2x_1+x_2+2x_3=1910\\\end{array} \right. \Rightarrow \left( \begin{matrix} 1& 1& 1\\ 3& 0& 1\\ 2& 1& 2\\\end{matrix} \right) \left( \begin{array}{c} x_1\\ x_2\\ x_3\\\end{array} \right) =\left( \begin{array}{c} 1030\\ 2420\\ 1910\\\end{array} \right) \Rightarrow \\\Rightarrow \left( \begin{array}{c} x_1\\ x_2\\ x_3\\\end{array} \right) =\left( \begin{matrix} 1& 1& 1\\ 3& 0& 1\\ 2& 1& 2\\\end{matrix} \right) ^{-1}\left( \begin{array}{c} 1030\\ 2420\\ 1910\\\end{array} \right) ⎩ ⎨ ⎧ x 1 + x 2 + x 3 = 1030 3 x 1 + 2 x 3 = 2420 2 x 1 + x 2 + 2 x 3 = 1910 ⇒ ⎝ ⎛ 1 3 2 1 0 1 1 1 2 ⎠ ⎞ ⎝ ⎛ x 1 x 2 x 3 ⎠ ⎞ = ⎝ ⎛ 1030 2420 1910 ⎠ ⎞ ⇒ ⇒ ⎝ ⎛ x 1 x 2 x 3 ⎠ ⎞ = ⎝ ⎛ 1 3 2 1 0 1 1 1 2 ⎠ ⎞ − 1 ⎝ ⎛ 1030 2420 1910 ⎠ ⎞
Find ( 1 1 1 3 0 1 2 1 2 ) − 1 \left( \begin{matrix} 1& 1& 1\\ 3& 0& 1\\ 2& 1& 2\\\end{matrix} \right) ^{-1} ⎝ ⎛ 1 3 2 1 0 1 1 1 2 ⎠ ⎞ − 1 with Gauss method:
[ 1 1 1 3 0 1 2 1 2 1 0 0 0 1 0 0 0 1 ] [ 1 1 1 0 − 3 − 2 0 − 1 0 1 0 0 − 3 1 0 − 2 0 1 ] [ 1 1 1 0 − 3 − 2 0 0 2 / 3 1 0 0 − 3 1 0 − 1 − 1 / 3 1 ] [ 1 1 1 0 − 3 − 2 0 0 1 1 0 0 − 3 1 0 − 1.5 − 0.5 1.5 ] [ 1 1 0 0 − 3 0 0 0 1 2.5 0.5 − 1.5 − 6 0 3 − 1.5 − 0.5 1.5 ] [ 1 1 0 0 1 0 0 0 1 2.5 0.5 − 1.5 2 0 − 1 − 1.5 − 0.5 1.5 ] [ 1 0 0 0 1 0 0 0 1 0.5 0.5 − 0.5 2 0 − 1 − 1.5 − 0.5 1.5 ] \left[ \begin{matrix} 1& 1& 1\\ 3& 0& 1\\ 2& 1& 2\\\end{matrix}\,\,\begin{matrix} 1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\\\end{matrix} \right] ~\left[ \begin{matrix} 1& 1& 1\\ 0& -3& -2\\ 0& -1& 0\\\end{matrix}\,\,\begin{matrix} 1& 0& 0\\ -3& 1& 0\\ -2& 0& 1\\\end{matrix} \right] ~\\~\left[ \begin{matrix} 1& 1& 1\\ 0& -3& -2\\ 0& 0& 2/3\\\end{matrix}\,\,\begin{matrix} 1& 0& 0\\ -3& 1& 0\\ -1& -1/3& 1\\\end{matrix} \right] ~\\~\left[ \begin{matrix} 1& 1& 1\\ 0& -3& -2\\ 0& 0& 1\\\end{matrix}\,\,\begin{matrix} 1& 0& 0\\ -3& 1& 0\\ -1.5& -0.5& 1.5\\\end{matrix} \right] ~\\~\left[ \begin{matrix} 1& 1& 0\\ 0& -3& 0\\ 0& 0& 1\\\end{matrix}\,\,\begin{matrix} 2.5& 0.5& -1.5\\ -6& 0& 3\\ -1.5& -0.5& 1.5\\\end{matrix} \right] ~\\~\left[ \begin{matrix} 1& 1& 0\\ 0& 1& 0\\ 0& 0& 1\\\end{matrix}\,\,\begin{matrix} 2.5& 0.5& -1.5\\ 2& 0& -1\\ -1.5& -0.5& 1.5\\\end{matrix} \right] ~\\~\left[ \begin{matrix} 1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\\\end{matrix}\,\,\begin{matrix} 0.5& 0.5& -0.5\\ 2& 0& -1\\ -1.5& -0.5& 1.5\\\end{matrix} \right] ⎣ ⎡ 1 3 2 1 0 1 1 1 2 1 0 0 0 1 0 0 0 1 ⎦ ⎤ ⎣ ⎡ 1 0 0 1 − 3 − 1 1 − 2 0 1 − 3 − 2 0 1 0 0 0 1 ⎦ ⎤ ⎣ ⎡ 1 0 0 1 − 3 0 1 − 2 2/3 1 − 3 − 1 0 1 − 1/3 0 0 1 ⎦ ⎤ ⎣ ⎡ 1 0 0 1 − 3 0 1 − 2 1 1 − 3 − 1.5 0 1 − 0.5 0 0 1.5 ⎦ ⎤ ⎣ ⎡ 1 0 0 1 − 3 0 0 0 1 2.5 − 6 − 1.5 0.5 0 − 0.5 − 1.5 3 1.5 ⎦ ⎤ ⎣ ⎡ 1 0 0 1 1 0 0 0 1 2.5 2 − 1.5 0.5 0 − 0.5 − 1.5 − 1 1.5 ⎦ ⎤ ⎣ ⎡ 1 0 0 0 1 0 0 0 1 0.5 2 − 1.5 0.5 0 − 0.5 − 0.5 − 1 1.5 ⎦ ⎤
from which the inverse matrix is
[ 0.5 0.5 − 0.5 2 0 − 1 − 1.5 − 0.5 1.5 ] \left[ \begin{matrix} 0.5& 0.5& -0.5\\ 2& 0& -1\\ -1.5& -0.5& 1.5\\\end{matrix} \right] ⎣ ⎡ 0.5 2 − 1.5 0.5 0 − 0.5 − 0.5 − 1 1.5 ⎦ ⎤
Then
( x 1 x 2 x 3 ) = ( 1 1 1 3 0 1 2 1 2 ) − 1 ( 1030 2420 1910 ) = = ( 0.5 0.5 − 0.5 2 0 − 1 − 1.5 − 0.5 1.5 ) ( 1030 2420 1910 ) = ( 770 150 110 ) \left( \begin{array}{c} x_1\\ x_2\\ x_3\\\end{array} \right) =\left( \begin{matrix} 1& 1& 1\\ 3& 0& 1\\ 2& 1& 2\\\end{matrix} \right) ^{-1}\left( \begin{array}{c} 1030\\ 2420\\ 1910\\\end{array} \right) =\\=\left( \begin{matrix} 0.5& 0.5& -0.5\\ 2& 0& -1\\ -1.5& -0.5& 1.5\\\end{matrix} \right) \left( \begin{array}{c} 1030\\ 2420\\ 1910\\\end{array} \right) =\left( \begin{array}{c} 770\\ 150\\ 110\\\end{array} \right) ⎝ ⎛ x 1 x 2 x 3 ⎠ ⎞ = ⎝ ⎛ 1 3 2 1 0 1 1 1 2 ⎠ ⎞ − 1 ⎝ ⎛ 1030 2420 1910 ⎠ ⎞ = = ⎝ ⎛ 0.5 2 − 1.5 0.5 0 − 0.5 − 0.5 − 1 1.5 ⎠ ⎞ ⎝ ⎛ 1030 2420 1910 ⎠ ⎞ = ⎝ ⎛ 770 150 110 ⎠ ⎞
This means 1 slice pizza is 770 mg, 1 ice-cream is 150 mg, 1 soda is 110 mg.
Comments