Maticové operace a inverzní matice

Proč to potřebuji?

Matice jsou základním nástrojem lineární algebry. Umožňují kompaktně zapsat soustavy rovnic, transformace v počítačové grafice, přechodové matice v Markovových řetězcích a mnoho dalšího. V tomto tématu se naučíš s maticemi počítat — sčítat je, násobit číslem i mezi sebou, transponovat a hledat inverzní matici.

Předpoklady: Soustavy rovnic a GEM (Téma 1).

Teorie

Definice matice

Definice 2.1 — Matice

Matice typu $(m, n)$ (neboli $m \times n$) je obdélníkové schéma $m \cdot n$ reálných čísel uspořádaných do $m$ řádků a $n$ sloupců:

$$\mathbf{A} = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}$$

Číslo $a_{ij}$ je prvek v $i$-tém řádku a $j$-tém sloupci. Stručně píšeme $\mathbf{A} = (a_{ij})_{m \times n}$.

Definice 2.2 — Jednotková matice

Jednotková matice $\mathbf{E}_n$ je čtvercová matice řádu $n$, která má na hlavní diagonále jedničky a všude jinde nuly:

$$\mathbf{E}_2 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \qquad \mathbf{E}_3 = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$$

Platí $\mathbf{A} \cdot \mathbf{E}_n = \mathbf{E}_m \cdot \mathbf{A} = \mathbf{A}$ pro matici $\mathbf{A}$ typu $(m, n)$.

Součet matic a násobení skalárem

Definice 2.3 — Součet matic

Sčítat lze pouze matice stejného typu. Součet matic $\mathbf{A} = (a_{ij})$ a $\mathbf{B} = (b_{ij})$ typu $(m, n)$ je matice $\mathbf{C} = \mathbf{A} + \mathbf{B}$, kde $c_{ij} = a_{ij} + b_{ij}$ — sčítáme po složkách.

Definice 2.4 — Násobení matice skalárem

Násobek matice $\mathbf{A} = (a_{ij})$ skalárem $\alpha \in \mathbb{R}$ je matice $\alpha \mathbf{A}$, kde každý prvek vynásobíme číslem $\alpha$: $(\alpha \mathbf{A})_{ij} = \alpha \cdot a_{ij}$.

Součin matic

Definice 2.5 — Součin matic

Součin matice $\mathbf{A} = (a_{ik})$ typu $(m, r)$ a matice $\mathbf{B} = (b_{kj})$ typu $(r, n)$ je matice $\mathbf{C} = \mathbf{A} \cdot \mathbf{B}$ typu $(m, n)$, jejíž prvky jsou:

$$c_{ij} = \sum_{k=1}^{r} a_{ik} \cdot b_{kj} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{ir}b_{rj}$$

Prvek $c_{ij}$ vzniká jako skalární součin $i$-tého řádku matice $\mathbf{A}$ a $j$-tého sloupce matice $\mathbf{B}$.

Poznámka — Kdy lze matice násobit?

Součin $\mathbf{A} \cdot \mathbf{B}$ existuje, pouze když počet sloupců $\mathbf{A}$ = počet řádků $\mathbf{B}$:

$$\underset{(m \times \boldsymbol{r})}{\mathbf{A}} \cdot \underset{(\boldsymbol{r} \times n)}{\mathbf{B}} = \underset{(m \times n)}{\mathbf{C}}$$

Například: matice $(2,3) \cdot$ matice $(3,1)$ = matice $(2,1)$ — lze. Ale matice $(3,1) \cdot$ matice $(2,3)$ — nelze!

Pozor! Násobení matic NENÍ komutativní

Obecně platí $\mathbf{A} \cdot \mathbf{B} \neq \mathbf{B} \cdot \mathbf{A}$! Dokonce i když oba součiny existují, výsledky se mohou lišit. Násobení matic je však asociativní: $(\mathbf{A} \cdot \mathbf{B}) \cdot \mathbf{C} = \mathbf{A} \cdot (\mathbf{B} \cdot \mathbf{C})$.

Transponovaná matice

Definice 2.6 — Transponovaná matice

Matice transponovaná k matici $\mathbf{A}$ typu $(m,n)$ je matice $\mathbf{A}^T$ typu $(n,m)$, která vznikne záměnou řádků a sloupců: $(a^T)_{ij} = a_{ji}$.

Příklad: Je-li $\mathbf{A} = \begin{pmatrix} 4 & 3 & 0 \\ 7 & 0 & 5 \end{pmatrix}$, pak $\mathbf{A}^T = \begin{pmatrix} 4 & 7 \\ 3 & 0 \\ 0 & 5 \end{pmatrix}$.

Mocniny matic

Definice 2.7 — Mocniny čtvercové matice

Pro čtvercovou matici $\mathbf{A}$ řádu $n$ definujeme:

$$\mathbf{A}^0 = \mathbf{E}_n, \quad \mathbf{A}^1 = \mathbf{A}, \quad \mathbf{A}^2 = \mathbf{A} \cdot \mathbf{A}, \quad \mathbf{A}^k = \underbrace{\mathbf{A} \cdot \mathbf{A} \cdots \mathbf{A}}_{k\text{-krát}}$$

Inverzní matice

Definice 2.8 — Inverzní matice

Matice inverzní ke čtvercové matici $\mathbf{A}$ řádu $n$ je taková matice $\mathbf{A}^{-1}$, pro kterou platí:

$$\mathbf{A} \cdot \mathbf{A}^{-1} = \mathbf{A}^{-1} \cdot \mathbf{A} = \mathbf{E}_n$$

Inverzní matice existuje, právě když je matice $\mathbf{A}$ regulární (tj. $\det \mathbf{A} \neq 0$).

Věta 2.1 — Vzorec pro inverzi matice 2×2

Pro matici $\mathbf{A} = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$, kde $ad - bc \neq 0$, platí:

$$\mathbf{A}^{-1} = \frac{1}{ad - bc} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$$

Výraz $ad - bc$ se nazývá determinant matice $\mathbf{A}$ (podrobněji v Tématu 3).

Věta 2.2 — Hledání inverzní matice pomocí GEM

Inverzní matici ke čtvercové matici $\mathbf{A}$ řádu $n$ najdeme tak, že sestavíme rozšířenou matici $(\mathbf{A} \mid \mathbf{E}_n)$ a řádkovými úpravami ji převedeme na tvar $(\mathbf{E}_n \mid \mathbf{A}^{-1})$:

$$(\mathbf{A} \mid \mathbf{E}_n) \xrightarrow{\text{GEM}} (\mathbf{E}_n \mid \mathbf{A}^{-1})$$

Pokud se na levé straně nepodaří vytvořit jednotkovou matici, matice $\mathbf{A}$ nemá inverzi (je singulární).

Řešení maticových rovnic

Poznámka — Maticové rovnice

Rovnici $\mathbf{A} \cdot \mathbf{X} = \mathbf{B}$ vyřešíme vynásobením zleva inverzní maticí:

$$\mathbf{A} \cdot \mathbf{X} = \mathbf{B} \quad \Longrightarrow \quad \mathbf{X} = \mathbf{A}^{-1} \cdot \mathbf{B}$$

Pozor: protože násobení matic není komutativní, musíme násobit ze správné strany! U rovnice $\mathbf{X} \cdot \mathbf{A} = \mathbf{B}$ násobíme zprava: $\mathbf{X} = \mathbf{B} \cdot \mathbf{A}^{-1}$.

Vlastnosti inverze matic

Pro operaci inverze matic platí:

  1. $(\mathbf{A}^{-1})^{-1} = \mathbf{A}$
  2. $(\mathbf{A} \cdot \mathbf{B})^{-1} = \mathbf{B}^{-1} \cdot \mathbf{A}^{-1}$ (pozor na pořadí!)
  3. $\mathbf{E}_n^{-1} = \mathbf{E}_n$

Řešené příklady

Příklad 1 — Součet matic a násobení skalárem

Jsou dány matice $\mathbf{A} = \begin{pmatrix} 2 & -3 \\ -1 & 1 \end{pmatrix}$ a $\mathbf{B} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}$. Vypočtěte $\mathbf{A} + \mathbf{B}$ a $-5 \cdot \begin{pmatrix} 1 & -2 \\ 0 & 2 \end{pmatrix}$.

Krok 1: Součet matic

Sčítáme po složkách (obě matice jsou typu $2 \times 2$):

$$\mathbf{A} + \mathbf{B} = \begin{pmatrix} 2 & -3 \\ -1 & 1 \end{pmatrix} + \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix} = \begin{pmatrix} 2+2 & -3+3 \\ -1+4 & 1+5 \end{pmatrix} = \begin{pmatrix} 4 & 0 \\ 3 & 6 \end{pmatrix}$$
Krok 2: Násobení skalárem

Každý prvek vynásobíme číslem $-5$:

$$-5 \cdot \begin{pmatrix} 1 & -2 \\ 0 & 2 \end{pmatrix} = \begin{pmatrix} -5 \cdot 1 & -5 \cdot (-2) \\ -5 \cdot 0 & -5 \cdot 2 \end{pmatrix} = \begin{pmatrix} -5 & 10 \\ 0 & -10 \end{pmatrix}$$
Příklad 2 — Součin matic 2×2

Spočtěte součiny $\mathbf{A} \cdot \mathbf{B}$ a $\mathbf{B} \cdot \mathbf{A}$ pro matice $\mathbf{A} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$ a $\mathbf{B} = \begin{pmatrix} 5 & 4 \\ 6 & 11 \end{pmatrix}$. Platí $\mathbf{A} \cdot \mathbf{B} = \mathbf{B} \cdot \mathbf{A}$?

Krok 1: Počítáme A * B

Prvek na pozici $(i,j)$ = skalární součin $i$-tého řádku $\mathbf{A}$ a $j$-tého sloupce $\mathbf{B}$:

$$c_{11} = 1 \cdot 5 + 2 \cdot 6 = 5 + 12 = 17$$ $$c_{12} = 1 \cdot 4 + 2 \cdot 11 = 4 + 22 = 26$$ $$c_{21} = 3 \cdot 5 + 4 \cdot 6 = 15 + 24 = 39$$ $$c_{22} = 3 \cdot 4 + 4 \cdot 11 = 12 + 44 = 56$$ $$\mathbf{A} \cdot \mathbf{B} = \begin{pmatrix} 17 & 26 \\ 39 & 56 \end{pmatrix}$$
Krok 2: Počítáme B * A
$$\mathbf{B} \cdot \mathbf{A} = \begin{pmatrix} 5 \cdot 1 + 4 \cdot 3 & 5 \cdot 2 + 4 \cdot 4 \\ 6 \cdot 1 + 11 \cdot 3 & 6 \cdot 2 + 11 \cdot 4 \end{pmatrix} = \begin{pmatrix} 17 & 26 \\ 39 & 56 \end{pmatrix}$$

V tomto výjimečném případě $\mathbf{A} \cdot \mathbf{B} = \mathbf{B} \cdot \mathbf{A}$. Obecně to ale neplatí!

Příklad 3 — Součin matic různých rozměrů

Spočtěte $\mathbf{A} \cdot \mathbf{B}$, kde

$$\mathbf{A} = \begin{pmatrix} 2 & 3 & 0 \\ 0 & 2 & 1 \end{pmatrix}, \quad \mathbf{B} = \begin{pmatrix} 5 & 3 \\ 0 & 1 \\ -1 & 4 \end{pmatrix}$$
Krok 1: Ověříme rozměry

$\mathbf{A}$ je typu $(2, 3)$, $\mathbf{B}$ je typu $(3, 2)$. Počet sloupců $\mathbf{A}$ = 3 = počet řádků $\mathbf{B}$ — součin existuje a bude typu $(2, 2)$.

Krok 2: Počítáme po prvcích
$$c_{11} = 2 \cdot 5 + 3 \cdot 0 + 0 \cdot (-1) = 10 + 0 + 0 = 10$$ $$c_{12} = 2 \cdot 3 + 3 \cdot 1 + 0 \cdot 4 = 6 + 3 + 0 = 9$$ $$c_{21} = 0 \cdot 5 + 2 \cdot 0 + 1 \cdot (-1) = 0 + 0 - 1 = -1$$ $$c_{22} = 0 \cdot 3 + 2 \cdot 1 + 1 \cdot 4 = 0 + 2 + 4 = 6$$ $$\mathbf{A} \cdot \mathbf{B} = \begin{pmatrix} 10 & 9 \\ -1 & 6 \end{pmatrix}$$
Příklad 4 — Inverzní matice 2×2 pomocí vzorce

Určete inverzní matici k matici $\mathbf{A} = \begin{pmatrix} 3 & 4 \\ 5 & 7 \end{pmatrix}$ pomocí vzorce pro 2×2 matici.

Krok 1: Spočítáme determinant
$$\det \mathbf{A} = ad - bc = 3 \cdot 7 - 4 \cdot 5 = 21 - 20 = 1$$

Determinant je nenulový, takže inverzní matice existuje.

Krok 2: Aplikujeme vzorec
$$\mathbf{A}^{-1} = \frac{1}{1} \begin{pmatrix} 7 & -4 \\ -5 & 3 \end{pmatrix} = \begin{pmatrix} 7 & -4 \\ -5 & 3 \end{pmatrix}$$
Krok 3: Kontrola
$$\mathbf{A} \cdot \mathbf{A}^{-1} = \begin{pmatrix} 3 & 4 \\ 5 & 7 \end{pmatrix} \begin{pmatrix} 7 & -4 \\ -5 & 3 \end{pmatrix} = \begin{pmatrix} 21-20 & -12+12 \\ 35-35 & -20+21 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = \mathbf{E}_2 \quad \checkmark$$
Příklad 5 — Inverzní matice 3×3 pomocí GEM

Najděte inverzní matici k matici $\mathbf{A} = \begin{pmatrix} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 0 & 1 & 0 \end{pmatrix}$ metodou $(A \mid E) \to (E \mid A^{-1})$.

Krok 1: Sestavíme rozšířenou matici $(A \mid E_3)$
$$\left(\begin{array}{ccc|ccc} 0 & 0 & 1 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 \end{array}\right)$$
Krok 2: Vyměníme $R_1 \leftrightarrow R_2$ (chceme pivot 1 v levém horním rohu)
$$\xrightarrow{R_1 \leftrightarrow R_2} \left(\begin{array}{ccc|ccc} 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 \end{array}\right)$$
Krok 3: Vyměníme $R_2 \leftrightarrow R_3$
$$\xrightarrow{R_2 \leftrightarrow R_3} \left(\begin{array}{ccc|ccc} 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 1 & 0 & 0 \end{array}\right)$$

Na levé straně je již jednotková matice!

Krok 4: Odečteme výsledek
$$\mathbf{A}^{-1} = \begin{pmatrix} 0 & 1 & 0 \\ 0 & 0 & 1 \\ 1 & 0 & 0 \end{pmatrix}$$
Příklad 6 — Inverzní matice 3×3 s plnou eliminací

Najděte inverzní matici k $\mathbf{B} = \begin{pmatrix} 0 & -2 & 0 \\ 0 & 0 & 4 \\ 0 & 0 & 1/4 \end{pmatrix}$.

Krok 1: Analýza matice

V prvním sloupci jsou samé nuly — matice nemá v prvním sloupci žádný nenulový prvek pro pivot. To znamená, že při eliminaci nemůžeme dostat na pozici $(1,1)$ jedničku bez pomoci řádkových výměn. Jenže i po jakékoli výměně řádků bude první sloupec stále celý nulový.

Matice s celým nulovým sloupcem je singulární — její determinant je nulový.

Inverzní matice neexistuje.

Příklad 7 — Řešení maticové rovnice

Určete matici $\mathbf{X}$, pro kterou platí $\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \mathbf{X} = \begin{pmatrix} 3 & 5 \\ 5 & 9 \end{pmatrix}$.

Krok 1: Označíme a najdeme inverzi

Označme $\mathbf{A} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$ a $\mathbf{B} = \begin{pmatrix} 3 & 5 \\ 5 & 9 \end{pmatrix}$. Pak $\mathbf{A} \cdot \mathbf{X} = \mathbf{B}$, tedy $\mathbf{X} = \mathbf{A}^{-1} \cdot \mathbf{B}$.

Determinant: $\det \mathbf{A} = 1 \cdot 4 - 2 \cdot 3 = 4 - 6 = -2$.

$$\mathbf{A}^{-1} = \frac{1}{-2} \begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix} = \begin{pmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{pmatrix}$$
Krok 2: Vypočteme X = A^{-1} * B
$$\mathbf{X} = \begin{pmatrix} -2 & 1 \\ \frac{3}{2} & -\frac{1}{2} \end{pmatrix} \cdot \begin{pmatrix} 3 & 5 \\ 5 & 9 \end{pmatrix} = \begin{pmatrix} -6+5 & -10+9 \\ \frac{9}{2}-\frac{5}{2} & \frac{15}{2}-\frac{9}{2} \end{pmatrix} = \begin{pmatrix} -1 & -1 \\ 2 & 3 \end{pmatrix}$$
Krok 3: Kontrola
$$\mathbf{A} \cdot \mathbf{X} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} -1 & -1 \\ 2 & 3 \end{pmatrix} = \begin{pmatrix} -1+4 & -1+6 \\ -3+8 & -3+12 \end{pmatrix} = \begin{pmatrix} 3 & 5 \\ 5 & 9 \end{pmatrix} = \mathbf{B} \quad \checkmark$$

Cvičení k procvičení

Cvičení 1: Řešte maticovou rovnici $\mathbf{A} - 2\mathbf{X} - \mathbf{B} = 3\mathbf{E}_2$, kde $\mathbf{A} = \begin{pmatrix} 2 & -3 \\ -1 & 1 \end{pmatrix}$, $\mathbf{B} = \begin{pmatrix} 2 & 3 \\ 4 & 5 \end{pmatrix}$.

$\mathbf{X} = \frac{1}{2}(\mathbf{A} - \mathbf{B} - 3\mathbf{E}_2) = \begin{pmatrix} -3/2 & -3 \\ -5/2 & -7/2 \end{pmatrix}$.

Cvičení 2: Určete součiny matic, pokud existují:

a) $\begin{pmatrix} 0 & -1 \\ 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 2 & 3 \\ 0 & 2 \end{pmatrix}$; b) $\begin{pmatrix} 2 & 3 & 0 \\ 0 & 2 & 1 \end{pmatrix} \cdot \begin{pmatrix} 0 & 2 \\ 2 & 3 \\ 1 & 0 \end{pmatrix}$; c) $\begin{pmatrix} 2 & 3 & 1 \\ 4 & 5 & 0 \end{pmatrix} \cdot \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}$.

a) $\begin{pmatrix} 0 & -2 \\ 0 & 2 \end{pmatrix}$; b) $\begin{pmatrix} 6 & 13 \\ 5 & 6 \end{pmatrix}$; c) nelze definovat (rozměry nesedí: $(2 \times 3) \cdot (2 \times 2)$).

Cvičení 3: Určete součiny $\mathbf{A} \cdot \mathbf{B}$ a $\mathbf{B} \cdot \mathbf{A}$ a ověřte, zda platí $\mathbf{A} \cdot \mathbf{B} = \mathbf{B} \cdot \mathbf{A}$:

$\mathbf{A} = \begin{pmatrix} 2 & 5 \\ -1 & 2 \end{pmatrix}$, $\mathbf{B} = \begin{pmatrix} 3 & -5 \\ 1 & 2 \end{pmatrix}$.

$\mathbf{A} \cdot \mathbf{B} = \begin{pmatrix} 11 & 0 \\ -1 & 9 \end{pmatrix}$, $\mathbf{B} \cdot \mathbf{A} = \begin{pmatrix} 11 & 5 \\ 0 & 9 \end{pmatrix}$. Neplatí $\mathbf{A} \cdot \mathbf{B} = \mathbf{B} \cdot \mathbf{A}$.

Cvičení 4: Spočtěte $\mathbf{A} \cdot \mathbf{A}^T$ a $\mathbf{A}^T \cdot \mathbf{A}$ pro $\mathbf{A} = \begin{pmatrix} 4 & 3 & 0 \\ 7 & 0 & 5 \end{pmatrix}$.

$\mathbf{A} \cdot \mathbf{A}^T = \begin{pmatrix} 25 & 28 \\ 28 & 74 \end{pmatrix}$, $\mathbf{A}^T \cdot \mathbf{A} = \begin{pmatrix} 65 & 12 & 35 \\ 12 & 9 & 0 \\ 35 & 0 & 25 \end{pmatrix}$.

Cvičení 5: Určete mocniny matice $\mathbf{A} = \begin{pmatrix} a & b \\ 0 & c \end{pmatrix}$. Spočtěte $\mathbf{A}^2$ a $\mathbf{A}^3$.

$\mathbf{A}^2 = \begin{pmatrix} a^2 & ab + bc \\ 0 & c^2 \end{pmatrix}$, $\mathbf{A}^3 = \begin{pmatrix} a^3 & a^2b + abc + bc^2 \\ 0 & c^3 \end{pmatrix}$.

Cvičení 6: Určete inverzní matici k $\mathbf{A} = \begin{pmatrix} 2 & 0 \\ -1 & -2 \end{pmatrix}$ pomocí vzorce pro 2×2.

$\det \mathbf{A} = -4$, $\mathbf{A}^{-1} = -\frac{1}{4}\begin{pmatrix} -2 & 0 \\ 1 & 2 \end{pmatrix} = \begin{pmatrix} 1/2 & 0 \\ -1/4 & -1/2 \end{pmatrix}$.

Cvičení 7: Určete inverzní matici pomocí GEM k matici $\mathbf{A} = \begin{pmatrix} 5 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 4 \end{pmatrix}$.

$\mathbf{A}^{-1} = \begin{pmatrix} 1/5 & 0 & 0 \\ 0 & -1/2 & 0 \\ 0 & 0 & 1/4 \end{pmatrix}$.

Cvičení 8: Určete matici $\mathbf{X}$, pro kterou platí $\begin{pmatrix} 3 & -1 \\ 5 & -2 \end{pmatrix} \cdot \mathbf{X} \cdot \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix} = \begin{pmatrix} 14 & 16 \\ 9 & 10 \end{pmatrix}$.

$\mathbf{X} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}$.

Cvičení 9: Určete sloupcový vektor $\vec{x}$ řešení soustavy $\mathbf{A} \cdot \vec{x} = \vec{b}$ pomocí inverzní matice $\mathbf{A}^{-1}$:

$\begin{pmatrix} 5 & -8 \\ 5 & 4 \end{pmatrix} \cdot \vec{x} = \begin{pmatrix} 0 \\ 6 \end{pmatrix}$.

$\vec{x} = \mathbf{A}^{-1}\vec{b} = \begin{pmatrix} 0{,}8 \\ 0{,}5 \end{pmatrix}$.

Shrnutí

Klíčové vzorce a pojmy

  • Matice typu $(m, n)$: $m$ řádků, $n$ sloupců
  • Součet: $(\mathbf{A}+\mathbf{B})_{ij} = a_{ij} + b_{ij}$ (jen matice stejného typu)
  • Násobení skalárem: $(\alpha\mathbf{A})_{ij} = \alpha \cdot a_{ij}$
  • Součin: $(\mathbf{A}\mathbf{B})_{ij} = \sum_k a_{ik}b_{kj}$ (počet sloupců $\mathbf{A}$ = počet řádků $\mathbf{B}$)
  • Transpozice: $(\mathbf{A}^T)_{ij} = a_{ji}$
  • Inverze 2×2: $\mathbf{A}^{-1} = \frac{1}{ad-bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}$
  • Inverze pomocí GEM: $(\mathbf{A} \mid \mathbf{E}) \xrightarrow{\text{GEM}} (\mathbf{E} \mid \mathbf{A}^{-1})$
  • Maticová rovnice: $\mathbf{A}\mathbf{X} = \mathbf{B} \Rightarrow \mathbf{X} = \mathbf{A}^{-1}\mathbf{B}$
Časté chyby
  • Předpokládáš, že $\mathbf{A}\mathbf{B} = \mathbf{B}\mathbf{A}$ — obecně neplatí!
  • Násobíš matice s nekompatibilními rozměry
  • Při inverzi maticové rovnice násobíš ze špatné strany
  • Zapomeneš zkontrolovat, zda je determinant nenulový před výpočtem inverze