Matriser: Multiplikasjon

En m x k matrise A multiplisert med en k x n matrise B gir en m x n matrise C = AB slik at

c_{ij} = a_{i1} b_{1j} + a_{i2} b_{2j} + \cdots + a_{ik} b_{kj}

Husk: Antall kolonner i den første matrisen må være lik antall rader i den andre matrisen.

+ Kort video

+ Finnes det en lettere å måte å skjønne matrisemultiplikasjon?

Hva som er lett, varierer selvsagt fra person til person, men i kladden kan du flytte den ene matrisen litt opp. Da blir det kanskje lettere å se at elementene i rad i i første matrise skal multipliseres med kolonne j i andre matrise for å få rad i kolonne j i resultatet:

\begin{aligned}
\left( \begin{array}{cccc}
* & \textcolor{red}{b_{1j}} & * & * \\
* & \textcolor{blue}{b_{2j}} & * & * \\
\vdots & \textcolor{purple}{\vdots} & \vdots & \vdots \\
* & \textcolor{green}{b_{kj}} & * & *
\end{array} \right) \\
\left( \begin{array}{cccc}
* & * & \cdots & * \\
* & * & \cdots & * \\
\textcolor{red}{a_{i1}} & \textcolor{blue}{a_{i2}} & \textcolor{purple}{\cdots} & \textcolor{green}{a_{ik}} \\
* & * & \cdots & * 
\end{array} \right)
\left( \begin{array}{cccc}
* & * & * & * \\
* & * & * & * \\
* & c_{ij} & * & * \\
* & * & *& * 
\end{array} \right)
\end{aligned}

der ⁕ er tall vi ikke bryr oss om nå, og

c_{ij} = \textcolor{red}{a_{i1}} \textcolor{red}{b_{1j}} + \textcolor{blue}{a_{i2}} \textcolor{blue}{b_{2j}} + \textcolor{purple}{\cdots} + \textcolor{green}{a_{ik}} \textcolor{green}{b_{kj}}

+ Kort video

+ Kan to matriser alltid multipliseres?

Nei. Antall kolonner i den første matrisen må være likt antall rader i den andre matrisen.

Eksempel: Hvis første matrise er 2 x 2 og andre 1 x 2, kan de ikke multipliseres sammen.

\textnormal{Umulig:} \quad \left( \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right) 
\left( \begin{array}{cc} 5 & 6 \end{array} \right)

Eksempel: Hvis første matrise er 2 x 2 og andre 2 x 1, kan de multipliseres sammen.

\textnormal{Mulig:} \quad \left( \begin{array}{cc} 1 & 2 \\ 3 & 4 \end{array} \right) 
\left( \begin{array}{cc} 5 \\ 6 \end{array} \right)

+ Er AI = A?

Ja. AI = I siden I er identitetsmatrisen. Dimensjonen til I må velges slik at multiplikasjon er mulig, dvs. antall kolonner i A må være lik antall rader i I.

+ Kort video

Eksempel: Hvis A har 2 kolonner, må I ha 2 rader.

AI = 
\left( \begin{array}{cc} 
\textcolor{red}{5} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} \\
 \end{array} \right)
\left( \begin{array}{c} 
\textcolor{red}{1} & \textcolor{red}{0} \\
\textcolor{blue}{0} & \textcolor{blue}{1} 
\end{array} \right) 
= \left( \begin{array}{c} 
\textcolor{red}{5 \cdot 1} + \textcolor{blue}{4 \cdot 0} & \textcolor{red}{5 \cdot 0} + \textcolor{blue}{4 \cdot 1} \\ 
\textcolor{red}{2 \cdot 1} + \textcolor{blue}{3 \cdot 0} & \textcolor{red}{2 \cdot 0} + \textcolor{blue}{3 \cdot 1}
\end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{5} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} \\
 \end{array} \right)
= A

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{red}{0} \\
\textcolor{blue}{0} & \textcolor{blue}{1} 
\end{array} \right) \\
\left( \begin{array}{cc} 
\textcolor{red}{5} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} 
\end{array} \right)
\left( \begin{array}{cc} 5 & 4 \\ 2 & 3 \end{array} \right)
\end{aligned}

+ Er AB = BA?

Nei, AB = BA kun i spesielle tilfeller.

+ Kort video

Eksempel på to matriser, A og B, der AB er ulik BA:

AB = 
\left( \begin{array}{cc} 
\textcolor{red}{5} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} \\
 \end{array} \right)
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{red}{6} \\
\textcolor{blue}{8} & \textcolor{blue}{7} 
\end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{5 \cdot 1} + \textcolor{blue}{4 \cdot 7} & \textcolor{red}{5 \cdot 6} + \textcolor{blue}{4 \cdot 7} \\ 
\textcolor{red}{2 \cdot 1} + \textcolor{blue}{3 \cdot 8} & \textcolor{red}{2 \cdot 6} + \textcolor{blue}{3 \cdot 7}
\end{array} \right) 
= \left( \begin{array}{cc} 
33 & 58 \\ 26 & 33
\end{array} \right) \\
BA = 
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{6} \\
\textcolor{red}{8} & \textcolor{blue}{7} 
\end{array} \right) 
\left( \begin{array}{cc} 
\textcolor{red}{5} & \textcolor{red}{4} \\
\textcolor{blue}{2} & \textcolor{blue}{3} \\
 \end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{1 \cdot 5} + \textcolor{blue}{6 \cdot 2} & \textcolor{red}{1 \cdot 4} + \textcolor{blue}{6 \cdot 3} \\ 
\textcolor{red}{8 \cdot 5} + \textcolor{blue}{7 \cdot 2} & \textcolor{red}{8 \cdot 4} + \textcolor{blue}{7 \cdot 3}
\end{array} \right) 
= \left( \begin{array}{cc} 
17 & 22 \\ 54 & 53
\end{array} \right) \\
\Rightarrow AB \neq BA

Eksempel på to matriser, C og D, der CD tilfeldigvis er lik DC:

CD = 
\left( \begin{array}{cc} 
\textcolor{red}{2} & \textcolor{blue}{1} \\
\textcolor{red}{0} & \textcolor{blue}{2} \\
 \end{array} \right)
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{red}{1} \\
\textcolor{blue}{0} & \textcolor{blue}{1} 
\end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{2 \cdot 1} + \textcolor{blue}{1 \cdot 0} & \textcolor{red}{2 \cdot 1} + \textcolor{blue}{1 \cdot 1} \\ 
\textcolor{red}{0 \cdot 1} + \textcolor{blue}{2 \cdot 0} & \textcolor{red}{0 \cdot 1} + \textcolor{blue}{2 \cdot 1}
\end{array} \right) 
= \left( \begin{array}{cc} 
2 & 3 \\ 0 & 2
\end{array} \right) \\
DC = 
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{1} \\
\textcolor{red}{0} & \textcolor{blue}{1} 
\end{array} \right) 
\left( \begin{array}{cc} 
\textcolor{red}{2} & \textcolor{red}{1} \\
\textcolor{blue}{0} & \textcolor{blue}{2} \\
 \end{array} \right)
= \left( \begin{array}{cc} 
\textcolor{red}{1 \cdot 2} + \textcolor{blue}{1 \cdot 0} & \textcolor{red}{1 \cdot 1} + \textcolor{blue}{1 \cdot 2} \\ 
\textcolor{red}{0 \cdot 2} + \textcolor{blue}{1 \cdot 0} & \textcolor{red}{0 \cdot 1} + \textcolor{blue}{1 \cdot 2}
\end{array} \right) 
= \left( \begin{array}{cc} 
2 & 3 \\ 0 & 2
\end{array} \right) \\
\Rightarrow CD = DC

Dersom AB = BA sier vi at matrisene A og B kommuterer.

+ Er A eller B en nullmatrise hvis AB = 0?

Nei, selv om AB = 0 kan både A og B være ulik null.

+ Kort video

Eksempel der både A og B er ulik null:

AB = 
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{2} \\
\textcolor{red}{2} & \textcolor{blue}{4} \\
 \end{array} \right)
\left( \begin{array}{cc} 
\textcolor{red}{-6} & \textcolor{red}{8} \\
\textcolor{blue}{3} & \textcolor{blue}{-4} 
\end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{1 \cdot (-6)} + \textcolor{blue}{2 \cdot 3} & \textcolor{red}{1 \cdot 8} + \textcolor{blue}{2 \cdot (-4)} \\ 
\textcolor{red}{2 \cdot (-6)} + \textcolor{blue}{4 \cdot 3} & \textcolor{red}{2 \cdot 8} + \textcolor{blue}{4 \cdot (-4)}
\end{array} \right) 
= \left( \begin{array}{cc} 
0 & 0 \\ 0 & 0
\end{array} \right)

Hvis A og/eller B er en nullmatrise, AB = 0. Eksempel:

AB = 
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{2} \\
\textcolor{red}{2} & \textcolor{blue}{4} \\
 \end{array} \right)
\left( \begin{array}{cc} 
\textcolor{red}{0} & \textcolor{red}{0} \\
\textcolor{blue}{0} & \textcolor{blue}{0} 
\end{array} \right) 
= \left( \begin{array}{cc} 
\textcolor{red}{1 \cdot 0} + \textcolor{blue}{2 \cdot 0} & \textcolor{red}{1 \cdot 0} + \textcolor{blue}{2 \cdot 0} \\ 
\textcolor{red}{2 \cdot 0} + \textcolor{blue}{4 \cdot 0} & \textcolor{red}{2 \cdot 0} + \textcolor{blue}{4 \cdot 0}
\end{array} \right) 
= \left( \begin{array}{cc} 
0 & 0 \\ 0 & 0
\end{array} \right)

+ Eksempel 1

Regn ut:

\left( \begin{array}{cc} 2 & 4 \end{array} \right)
\left( \begin{array}{c} 5 \\ 3\end{array} \right) 

+ Kort video

Hvis første matrise er 1 x 2 og andre 2 x 1, blir resultatet en 1 x 1 matrise:

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \begin{array}{c} \textcolor{red}{5} \\ \textcolor{blue}{3} \end{array} \right) \\
\left( \begin{array}{cc} \textcolor{red}{2} & \textcolor{blue}{4} \end{array} \right)
\left( \begin{array}{cc} 22 \end{array} \right)
\end{aligned}

+ Eksempel 2

Regn ut:

\left( \begin{array}{c} 5 \\ 3 \end{array} \right) 
\left( \begin{array}{cc} 2 & 4 \end{array} \right)

+ Kort video

Hvis første matrise er 2 x 1 og andre 1 x 2, blir resultatet en 2 x 2 matrise:

\left( \begin{array}{c} \textcolor{red}{5} \\ \textcolor{red}{3} \end{array} \right) 
\left( \begin{array}{cc} \textcolor{red}{2} & \textcolor{red}{4} \end{array} \right)
= \left( \begin{array}{cc} 
\textcolor{red}{5 \cdot 2} & \textcolor{red}{5 \cdot 4} \\
\textcolor{red}{3 \cdot 2} & \textcolor{red}{3 \cdot 4} 
\end{array} \right) 
= \left( \begin{array}{cc} 10 & 20 \\ 6 & 12\end{array} \right) 

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left(\; \begin{array}{cc} \: \textcolor{red}{2} \;& \textcolor{red}{4} \end{array} \;\right) \;\\
\left( \begin{array}{c} \textcolor{red}{5} \\ \textcolor{red}{3} \end{array} \right)
\left( \begin{array}{cc} 10 &20 \\ 6 & 12\end{array} \right)
\end{aligned}

+ Eksempel 3

Regn ut:

\left( \begin{array}{cc} 
1 & 4 \\ 2 & 3
 \end{array} \right)
\left( \begin{array}{c} 5 \\ 6 \end{array} \right) 

+ Kort video

Hvis første matrise er 2 x 2 og andre 2 x 1, blir resultatet en 2 x 1 matrise:

\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} \\
 \end{array} \right)
\left( \begin{array}{c} \textcolor{red}{5} \\ \textcolor{blue}{6} \end{array} \right) 
= \left( \begin{array}{c} 
\textcolor{red}{1 \cdot 5} + \textcolor{blue}{4 \cdot 6} \\ 
\textcolor{red}{2 \cdot 5} + \textcolor{blue}{3 \cdot 6} 
\end{array} \right) 
= \left( \begin{array}{c} 29 \\ 28 \end{array} \right) 

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \begin{array}{c} \textcolor{red}{5} \\ \textcolor{blue}{6} \end{array} \right) \; \\
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{4} \\
\textcolor{red}{2} & \textcolor{blue}{3} 
\end{array} \right)
\left( \begin{array}{cc} 29 \\ 28 \end{array} \right)
\end{aligned}

+ Eksempel 4

Regn ut:

\left( \begin{array}{c} 5 & 6 \end{array} \right) 
\left( \begin{array}{cc} 1 & 4 \\ 2 & 3 \end{array} \right)

+ Kort video

Hvis første matrise er 1 x 2 og andre 2 x 2, blir resultatet en 1 x 2 matrise:

\left( \begin{array}{c} \textcolor{red}{5} & \textcolor{blue}{6} \end{array} \right) 
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{red}{4} \\
\textcolor{blue}{2} & \textcolor{blue}{3} \\
 \end{array} \right)
= \left( \begin{array}{c} 
\textcolor{red}{5 \cdot 1} + \textcolor{blue}{6 \cdot 2} & 
\textcolor{red}{5 \cdot 4} + \textcolor{blue}{6 \cdot 3} 
\end{array} \right) 
= \left( \begin{array}{c} 17 & 38 \end{array} \right) 

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \;\begin{array}{cc} 
\textcolor{red}{1} & \textcolor{red}{4} \\
\textcolor{blue}{2} & \textcolor{blue}{3} 
\end{array} \; \right) \\
\left( \begin{array}{c} \textcolor{red}{5} & \textcolor{blue}{6} \end{array} \right)
\left( \begin{array}{cc} 17 & 38 \end{array} \right)
\end{aligned}

+ Eksempel 5:

Regn ut:

\left( \begin{array}{cc} 1 & 2 \\ 0 & 4 \end{array} \right) 
\left( \begin{array}{cc} 0 & 4 \\ 3 & 1 \end{array} \right)

+ Kort video

Hvis første matrise er 2 x 2 og andre 2 x 2, blir resultatet en 2 x 2 matrise:

\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{2} \\
\textcolor{red}{0} & \textcolor{blue}{4} 
\end{array} \right) 
\left( \begin{array}{cc} 
\textcolor{red}{0} & \textcolor{red}{4} \\
\textcolor{blue}{3} & \textcolor{blue}{1} 
 \end{array} \right)
= \left( \begin{array}{c} 
\textcolor{red}{1 \cdot 0} + \textcolor{blue}{2 \cdot 3} & 
\textcolor{red}{1 \cdot 4} + \textcolor{blue}{2 \cdot 1} \\
\textcolor{red}{0 \cdot 0} + \textcolor{blue}{4 \cdot 3} & 
\textcolor{red}{0 \cdot 4} + \textcolor{blue}{4 \cdot 1}
\end{array} \right) 
= \left( \begin{array}{cc} 6 & 6 \\ 12 & 4\end{array} \right) 

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \;\begin{array}{cc} 
\textcolor{red}{0} & \textcolor{red}{4} \\
\textcolor{blue}{3} & \textcolor{blue}{1} 
\end{array} \; \right) \\
\left( \begin{array}{cc} 
\textcolor{red}{1} & \textcolor{blue}{2} \\
\textcolor{red}{0} & \textcolor{blue}{4} 
\end{array} \right)
\left( \begin{array}{cc} 6 & 6 \\ 12 & 4\end{array} \right) 
\end{aligned}

+ Eksempel 6:

Regn ut:

\left( \begin{array}{cccc} 1 & 4 & 0 \\ 2 & 3 & 1 \\ 3 & 5 & 6 \end{array} \right) 
\left( \begin{array}{c} 2 \\ 0 \\ 1 \end{array} \right)

+ Kort video

Hvis første matrise er 3 x 3 og andre 3 x 1, blir resultatet en 3 x 1 matrise:

\left( \begin{array}{cccc} 
\textcolor{red}{1} & \textcolor{blue}{4} & \textcolor{green}{0} \\
\textcolor{red}{2} & \textcolor{blue}{3} & \textcolor{green}{1} \\
\textcolor{red}{3} & \textcolor{blue}{5} & \textcolor{green}{6} 
\end{array} \right) 
\left( \begin{array}{c} 
\textcolor{red}{2} \\
\textcolor{blue}{0} \\
\textcolor{green}{1}
 \end{array} \right)
= \left( \begin{array}{c} 
\textcolor{red}{1 \cdot 2} + \textcolor{blue}{4 \cdot 0} + \textcolor{green}{0 \cdot 1} \\ 
\textcolor{red}{2 \cdot 2} + \textcolor{blue}{3 \cdot 0} + \textcolor{green}{1 \cdot 1} \\ 
\textcolor{red}{3 \cdot 2} + \textcolor{blue}{5 \cdot 0} + \textcolor{green}{6 \cdot 1}
\end{array} \right) 
= \left( \begin{array}{c} 2 \\ 5 \\ 12 \end{array} \right) 

Kladd der matrise nummer to flyttes litt opp (hvis du synes det er lettere):

\begin{aligned}
\left( \;\begin{array}{cc} 
\textcolor{red}{2} \\ \textcolor{blue}{0} \\ \textcolor{green}{1} 
\end{array} \; \right) \\
\left( \begin{array}{c} 
\textcolor{red}{1} & \textcolor{blue}{4} & \textcolor{green}{0} \\
\textcolor{red}{2} & \textcolor{blue}{3} & \textcolor{green}{1} \\
\textcolor{red}{3} & \textcolor{blue}{5} & \textcolor{green}{6} 
\end{array} \right)
\left( \begin{array}{c} 2 \\ 5 \\ 12 \end{array} \right) \end{aligned}

+ Eksempel 7: Ukjente elementer

Elementene i matrisen(e) kan være ukjente:

\left( \begin{array}{cccc} 1 & 4 & 0 \\ 2 & 3 & 1 \\ 3 & 5 & 6 \end{array} \right) 
\left( \begin{array}{c} x \\ y \\ z \end{array} \right)

+ Kort video

Hvis første matrise er 3 x 3 og andre 3 x 1, blir resultatet en 3 x 1 matrise:

\left( \begin{array}{cccc} 
\textcolor{red}{1} & \textcolor{blue}{4} & \textcolor{green}{0} \\
\textcolor{red}{2} & \textcolor{blue}{3} & \textcolor{green}{1} \\
\textcolor{red}{3} & \textcolor{blue}{5} & \textcolor{green}{6} 
\end{array} \right) 
\left( \begin{array}{c} 
\textcolor{red}{x} \\
\textcolor{blue}{y} \\
\textcolor{green}{z}
 \end{array} \right)
= \left( \begin{array}{c} 
\textcolor{red}{1 \cdot x} + \textcolor{blue}{4 \cdot y} + \textcolor{green}{0 \cdot z} \\ 
\textcolor{red}{2 \cdot x} + \textcolor{blue}{3 \cdot y} + \textcolor{green}{1 \cdot z} \\ 
\textcolor{red}{3 \cdot x} + \textcolor{blue}{5 \cdot y} + \textcolor{green}{6 \cdot z}
\end{array} \right) 
= \left( \begin{array}{c} x + 4y \\ 2x + 3y + z \\ 3x + 5y + 6z \end{array} \right) 

Dette bruker vi mye når vi løser ligningssett.

← Matematikk

↓ Oppgaver

→ Determinant