04 - Sabiranje i oduzimanje matrica
Sabiranje i oduzimanje matrica
  • Sabiranje matrica
  • Primer 1
  • Oduzimanje matrica
  • Primer 2
04
Sabiranje matrica
Sabirati se mogu samo matrice istog tipa. Zbir dve matrice je matrica istog tipa, kao i one koje se sabiraju.
$\color{red} {\text{Zbir dve matrice}}\,\,\,$ se definiše samo za matrice istog tipa. Zbir dve matrice $ A = \left[ a_{ i j } \right]_{ m \times n} , B = \left[ b_{ i j } \right]_{ m \times n } $ predstavlja matricu $ C $ istog tipa kao i matrice $ A $ i $ B , $ u oznaci $ C = A + B , $ takvu da je $ C = \left[ a_{ i j } + b_{ i j } \right]_{ m \times n } . $ U razvijenom obliku prethodno možemo zapisati: $$ A=\left [ \begin{array}{cccccc} a_{11} & a_{12} & \ldots & a_{1j} & \ldots & a_{1n} \\ a_{21} & a_{22} & \ldots & a_{2j} & \ldots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots & & \vdots \\ a_{i1} & a_{i2} & \ldots & a_{ij} & \ldots & a_{in} \\ \vdots & \vdots & & \vdots & \ddots& \vdots \\ a_{m1} & a_{m2} & \ldots & a_{mj} & \ldots & a_{mn} \end{array}\right ] \quad\text{i}\quad B= \left [ \begin{array}{cccccc} b_{11} & b_{12} & \ldots & b_{1j} & \ldots & b_{1n} \\ b_{21} & b_{22} & \ldots & b_{2j} & \ldots & b_{2n}\\ \vdots & \vdots & \ddots & \vdots & & \vdots \\ b_{i1} & b_{i2} & \ldots & b_{ij} & \ldots & b_{in} \\ \vdots & \vdots & & \vdots & \ddots& \vdots \\ b_{m1} & b_{m2} & \ldots & b_{mj} & \ldots & b_{mn} \end{array}\right ] $$ tada je $$ C=\left [ \begin{array}{cccccc} a_{11}+b_{11} & a_{12}+b_{12} & \ldots & a_{1j}+b_{1j} & \ldots & a_{1n}+b_{1n} \\ a_{21}+b_{21} & a_{22}+b_{22} & \ldots & a_{2j}+b_{2j} & \ldots & a_{2n}+b_{2n}\\ \vdots & \vdots & \ddots & \vdots & & \vdots \\ a_{i1}+b_{i1} & a_{i2}+b_{i2} & \ldots & a_{ij}+b_{ij} & \ldots & a_{in}+b_{in} \\ \vdots & \vdots & & \vdots & \ddots& \vdots \\ a_{m1}+b_{m1} & a_{m2}+b_{m2} & \ldots & a_{mj}+b_{mj} & \ldots & a_{mn}+b_{mn} \end{array}\right ]. $$ Analogno se može definisati zbir konačnog broja matrica. Za ovako definisano sabiranje matrica može se pokazati da važi:

$1^{\circ}$ $A+B=B+A,$ (komutativnost sabiranja matrica),
$2^{\circ}$ $(A+B)+C=A+(B+C),$ (asocijativnost sabiranja matrica).
Primer 1
Sabiranje dve matrice.

Sabrati matrice $$ \left[ \begin{array}{rrr} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ 10 & 11 & 12 \end{array}\right ] \quad \text{ i } \quad \left[ \begin{array}{rrr} -6 & -5 & -4 \\ -3 & -2 & -1 \\ 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right ] $$ $\textbf{Rešenje.}$ $$ \left[ \begin{array}{rrr} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \\ 10 & 11 & 12 \end{array}\right ]+\left[ \begin{array}{rrr} -6 & -5 & -4 \\ -3 & -2 & -1 \\ 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right ]=\left[ \begin{array}{rrr} -5 & -3 & -1 \\ 1 & 3 & 5 \\ 7 & 9 & 11 \\ 13 & 15 & 17 \end{array}\right ]. $$

Oduzimanje matrica
Oduzimati se mogu samo matrice istog tipa. Razlika dve matrice je matrica istog tipa, kao i one koje se oduzimaju.
$\color{red} {\text{Razlika dve matrice}}\,\,$ $A=\left[a_{ij} \right]_{m\times n}$ i $B=\left[b_{ij} \right]_{m\times n}$ je matrica $D,$ tj. $D=A-B,$ istog tipa kao i matrice $A$ i $B,$ takva da je $D=\left[a_{ij}-b_{ij} \right]_{m\times n}.$

Za proizvoljan tip matrice $A,$ postoji nula--matrica $O,$ istog tipa kao i matrica $A,$ tako da je:

$1^{\circ}$ $A+O=O+A=A$ (neutralni element za sabiranja matrica).

Ako sa $-A,$ označimo matricu $(-1)\cdot A,$ tada važi:

$2^{\circ}$ $A+(-A)=(-A)+A=O.$

Za dve matrice $A$ i $B$ istog tipa za koje važi da je $A+B=O,\,\,$ tj. $a_{ij}+b_{ij}=0,\,\,$ tj. $a_{ij}=-b_{ij},\,\,$ za $1\leq i\leq m,\,1\leq j\leq n\,\,$ kažemo da su suprotne matrice i pišemo $A=-B.$
Primer 2
Primer na kome treba uočiti prioritete u izvršenju operacija. Sabiranje, odnosno oduzimanje matrica je nižeg prioriteta u odnosu na množenje matrice skalarom.
Neka su date matrice \begin{aligned} A = \left[ \begin{array}{rrr} -1 & 3 & 0 \\ -4 & 5 & -8 \\ 2 & 3 & -5 \\ \end{array}\right ]& \quad \text{ i } \quad B = \left[ \begin{array}{rrr} -3 & -2 & -1 \\ 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right ] \end{aligned} Izračunati $ 3 \cdot A - B . $

$\textbf{Rešenje.}$ \begin{equation*} \begin{aligned} 3 \cdot A - B & = 3\cdot\left[ \begin{array}{rrr} -1 & 3 & 0 \\ -4 & 5 & -8 \\ 2 & 3 & -5 \\ \end{array}\right ] - \left[ \begin{array}{rrr} -3 & -2 & -1 \\ 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right ]=\\[2mm] &=\left[ \begin{array}{rrr} -3 & 9 & 0 \\ -12 & 15 & -24 \\ 6 & 9 & -15 \\ \end{array}\right ]-\left[ \begin{array}{rrr} -3 & -2 & -1 \\ 0 & 1 & 2 \\ 3 & 4 & 5 \end{array}\right ]=\\[2mm] &=\left[ \begin{array}{rrr} 0 & 11 & 1 \\ -12 & 14 & -26 \\ 3 & 5 & -20 \\ \end{array}\right ]. \end{aligned} \end{equation*}

$\textbf{Napomena.}$ Odavde se vidi da je množenje matrice skalarom, prioritetnije od oduzimanja (i sabiranja) matrica.