---
title: "MML Book Exercises rešavanje"
author: "Zoran Ovcin"
date: "2025-11-22"
output: html_document
---

\def\R{\mathbb{R}}
\def\Z{\mathbb{Z}}

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

Ovde rešavamo zadatke iz [MML Book](https://mml-book.github.io/)

## MML-book Chapter 2. Linear Algebra, Exercises 

Koristićemo R i **matlib** biblioteku.
```{r}
library(matlib)
```
Tekst je u formatu Rmd (R markdown) i može se knit aplikacijom pretvoriti u html (ili pdf) dokument.

### 2.1

a. Jeste Abelova grupa.
* Zatvorenost: Neka su $x, y \in \R \backslash \{ -1 \}$. Pretpostavimo da je $a \star b = -1 \;\Leftrightarrow\; a b + a + b = -1 \;\Leftrightarrow\; a ( b + 1 ) = -1 ( b + 1 )$.<br>
Poslednja jednakost je moguća samo ako je $a = -1$ ili $b = -1$, dakle, zatvorenost važi.  
* Asocijativnost:
$( a \star b ) \star c = (a b + a + b) \star c = a b c + a c + b c + a b + a + b + c$
$a \star ( b \star c ) = a \star (b c + b + c) = a b c + a b + a c + a + b c + b + c$<br>
Vidimo da asocijativnost važi.
* Neutralni element je $0$: $0 \star b = b$, $a \star 0 = a$.
* Inverzni element: $a \star a' = a a' + a + a' = 0 \;\Leftrightarrow\; a' ( a + 1) = -a \;\Leftrightarrow\; a' = -a / ( a + 1 )$, što može da se izračuna za sve elemente iz $\R \backslash \{ -1 \}$.
* Komutativnost: očigledna.

b. Rešenja su: $x \in \{ -3, 1 \}$.<br>
* $3 \star x \star x = 3 \star ( x^2 + 2 x ) = 3 x^2 + 6 x + 3 + x^2 + 2 x = 4 x^2 + 8 x + 3 = 15 \;\Leftrightarrow\;$ <br> $4 x^2 + 8 x - 12 = 0 \;\Leftrightarrow\; x \in \{ -3, 1 \}$.

### 2.2

Za $k = 0, 1, \ldots, n-1,\; k \in \overline{k}$. Skup $\Z_n = \{ \overline{0}, \overline{1}, \ldots, \overline{n-1} \}$ predstavlja ostatke pri deljenju sa $n$. Operacije $\oplus$ i $\otimes$ su sabiranje i množenje po modulu $n$.

a. Jeste Abelova grupa:
* Zatvorenost: Pošto za svako $k \in \Z$ jedini mogući ostaci pri deljenu sa $n$ su predstavljeni u $\Z_n$, zatvorenost je očigledna.<br>
* Asocijativnost sledi iz asocijativnosti sabiranja:<br>
$( \overline{a} \oplus \overline{b} ) \oplus \overline{c} = ( \overline{a + b} ) \oplus \overline{c} = \overline{( a + b ) + c} = \overline{ a + ( b + c )} = \overline{a} \oplus ( \overline{b + c} ) = \overline{a} \oplus ( \overline{b} \oplus \overline{c} )$
* Neutralni element je $\overline{0}$: $\overline{0} \oplus \overline{k} = \overline{0 + k} = \overline{k} = \overline{k + 0} = \overline{k} \oplus \overline{0}$.
* Inverzni element: za $\overline{k}$, inverzni element je $\overline{n - k}$, jer  $\overline{k} \oplus \overline{n - k} = \overline{k + n - k} = \overline{n} = \overline{0}$.
* Komutativnost: očigledna.

```{r E02.02}
#########
#  2.2  #
#########

# b
matrix(1:4,ncol=1) %*% matrix(1:4,nrow=1) %% 5
```
b. Očigledno je zatvorena operacija, asocijativnost i komutativnost slede, kao i kod $\oplus$ iz asocijativnosti i komutativnosti množenja u skupu $\Z$. Isto, neutralni element za množenje je $\overline{1}$.<br> Iz tablice se vidi da svaki element ima inverzni: $1^{-1} = 1, 2^{-1} = 3, 3^{-1} = 2, 4^{-1} = 4$.

c. U skupu $\Z_8$ važi $\overline{4} \otimes \overline{2} = \overline{4 \cdot 2} = \overline{8} = \overline{0}$, tako da $( \Z_8 \backslash \{ 0 \}, \otimes )$ nije ni grupoid.

d. $( \Z_n \backslash \{ 0 \}, \otimes )$ je Abelova grupa $\Leftrightarrow$ n je prost broj. Dokaz:<br>
Komutativnost, asocijativnost i neutralnost $\overline{1}$ za $\otimes$ proizilaze iz  osobina grupoida $( \Z \backslash \{ 0 \}, \cdot )$.<br>
Ako $n$ nije prost broj, $n = m \ k$, onda $( \Z_n \backslash \{ 0 \}, \otimes )$ nije grupoid jer $\overline{m} \otimes \overline{k} = \overline{n} = \overline{0}$.<br>
Neka je $n$ prost broj i neka $\overline{m} \in \Z_n  \backslash \{ 0 \}$ i neka $m \in \{ 0, 1, \ldots, n - 1 \}$. Brojevi $n$ i $m$ su uzajamno prosti, na osnovu Bezuove teoreme (Bézout's identity) postoje $x, y \in \Z$ tako da $x \ n + y \ m = 1$. Onda je $\overline{y} = \overline{m}^{-1}$, jer 
$$ \overline{y} \otimes \overline{m} = \overline{y \ m} = \overline{- x \ n + 1} = \overline{1} = \overline{m \ y} = \overline{m} \otimes \overline{y}.$$

### 2.3

Ako u grupoidu sa neutralnim elementom za podskup važi zatvorenost operacije i nalaženja inverznog elemeta, onda je taj podskup u odnosu na restrikciju operacije grupa. Zatvorenost operacije:
$$\begin{bmatrix} 1 & x_{1} & y_{1}\\ 
                0 &    1  & z_{1}\\
                0 &    0  & 1 \end{bmatrix}
\begin{bmatrix} 1 & x_{2} & y_{2}\\ 
                0 &    1  & z_{2}\\
                0 &    0  & 1 \end{bmatrix} =
\begin{bmatrix} 1 & x_{1} + x_{2} & x_{1} \ z_{2} + y_{1} + y_{2}\\ 
                0 &            1  & z_{1}+z_{2}\\
                0 &            0  & 1 \end{bmatrix}$$
Zatvorenost traženja inverznog elementa:<br>
$$\begin{bmatrix} 1 & x & y\\ 
                  0 & 1 & z\\
                  0 & 0 & 1 \end{bmatrix}
\begin{bmatrix} 1 & -x & x \ z - y \\ 
                0 &  1 & -z        \\
                0 &  0 & 1 \end{bmatrix} = 
\begin{bmatrix} 1 & 0 & 0 \\
                0 & 1 & 0 \\
                0 & 0 & 1 \\\end{bmatrix} =
\begin{bmatrix} 1 & -x & x \ z - y \\ 
                0 &  1 & -z        \\
                0 &  0 & 1 \end{bmatrix}
\begin{bmatrix} 1 & x & y\\ 
                0 & 1 & z\\
                0 & 0 & 1 \end{bmatrix}$$
Komutativnost ne važi

### 2.4

Pomnožiti matrice, ako je moguće.
```{r E02.04}
#########
#  2.4  #
#########

# a
# Ne mogu se pomnožiti

# b
A = matrix(c(1:9), ncol = 3, byrow = T);
B = matrix(c(1,1,0,0,1,1,1,0,1), ncol = 3, byrow = T); B
A%*%B

# c
B%*%A

# d
A = matrix(c(1,2,1,2,4,1,-1,-4), ncol = 4, byrow = T); A
B = matrix(c(0,3,1,-1,2,1,5,2), ncol=2, byrow = T); B
A%*%B

# e
B%*%A

```

### 2.5

```{r E02.05}
#########
#  2.5  #
#########

# a

A = matrix(c(1,2,2,5,1,5,-1,2,-1,-7,1,-4,-1,-5,3,2),ncol=4); A
b = c(1,-2,4,6); b
gaussianElimination(A,b)

# Matrica $A$ i proširena matrica $A|b$ nemaju isti rang, sistem je nemoguć

# b

A = matrix(c(1,1,2,-1,-1,1,-1,2,0,0,0,0,0,-3,1,-2,1,0,-1,-1), ncol = 5); A
b = c(3,6,5,-1); b
gaussianElimination(A,b) -> Ab1 ; Ab1
Ab2=rbind(Ab1[1:2,],-(1:6==3),Ab1[3,],-(1:6==5)); Ab2

```
Rešenje sistema su svi vektori
${\boldsymbol x} = [3,0,0,-1,0]^T + x_3 [0,0,1,0,0]^T + x_5 [ 1,2,0,1,1 ]^T$, $x_3, x_5 \in \R$.

### 2.6

```{r E02.06}
#########
#  2.6  #
#########

A=matrix(c(0,1,0,0,1,0,0,0,0,1,1,0,0,1,0,0,0,1), ncol = 6, byrow = TRUE); A
b=c(2,-1,2); b
gaussianElimination(A,b) -> Ab1 ; Ab1

Ab2=rbind(-(1:7==1),Ab1[1,],-(1:7==3),Ab1[2:3,],-(1:7==6)); Ab2

```
Rešenje sistema su svi vektori
${\boldsymbol x} = [0,2,0,-1,0,0]^T + x_1 [1,0,0,0,0,0]^T + x_3 [0,0,1,0,0,0]^T + x_6 [0,1,0,1,-1,-1]^T$, $x_1, x_3, x_6 \in \R$.

### 2.7

```{r E02.07}
#########
#  2.7  #
#########

A = matrix(c(6,4,3,6,0,9,0,8,0), ncol = 3, byrow = TRUE); A
A = A - 12 * diag(3); A
A = rbind(A,c(1,1,1)); A
b = c(0,0,0,1); b
gaussianElimination(A,b) -> Ab1 ; Ab1
```
Rešenje:
${\boldsymbol x} = [0.375,0.375,0.250]^T = [3/8, 3/8, 2/8]^T$.

### 2.8

```{r E02.08}
#########
#  2.8  #
#########

# a
A = matrix(c(2,3,4,3,4,5,4,5,6), ncol = 3, byrow = T); A
A = cbind(A,diag(3)); A
gaussianElimination(A) -> A1; A1
# Nema inverznu, rang matrice je 2

# b
A = matrix(c(1,0,1,0,0,1,1,0,1,1,0,1,1,1,1,0), ncol = 4, byrow = T); A
A0 = cbind(A,diag(4)); A0
gaussianElimination(A0) -> A1; A1
A1 = A1[,5:8]; A1
A %*% A1
library(xtable)
print(xtable(A1, digits = 0), floating=FALSE, tabular.environment="bmatrix", hline.after=NULL, include.rownames=FALSE, include.colnames=FALSE)
```
Rešenje:
$A^{-1} = \begin{bmatrix}
0 & -1 & 0 &  1\\
-1 &  0 & 0 &  1\\
 1 &  1 & 0 & -1\\
 1 &  1 & 1 & -2
 \end{bmatrix}$.

### 2.9

a. Da. span $( [1,1,1]^T, [0,1,-1]^T ) = \lambda [1,1,1]^T + \mu^3 [0,1,-1]^T, \lambda, \mu \in \R$ 
b. Ne. Nije grupa.
c. Da ako i samo ako $\gamma = 0$.
d. Ne. (Homogenost!)

### 2.10

```{r E02.010}
#########
#  2.10 #
#########

# a
A = matrix(c(2,-1,3,1,1,-2,3,-3,8), ncol = 3); A
gaussianElimination(A)

# b
A = matrix(c(1,2,1,0,0,1,1,0,1,1,1,0,0,1,1), ncol = 3); A
gaussianElimination(A)
```

a. Linearno zavisni: ${\boldsymbol x}_3 = 2 {\boldsymbol x}_1 - {\boldsymbol x}_2$
b. Linearno nezavisni, rang $([ {\boldsymbol x}_1, {\boldsymbol x}_2, {\boldsymbol x}_3]) = 3$.

### 2.11

```{r E02.11}
#########
#  2.11 #
#########

A = matrix(c(1,1,1,1,2,3,2,-1,1), ncol = 3); A
y = c(1,-2,5)
gaussianElimination(A,y)->A1; A1
```

${\boldsymbol y} = -6 {\boldsymbol x}_1 + 3 {\boldsymbol x}_2 + 2 {\boldsymbol x}_3$.

### 2.12

```{r E02.12}
#########
#  2.12 #
#########

A = matrix(c(1,1,-3,1,2,-1,0,-1,-1,1,-1,1), ncol = 3); A
gaussianElimination(A)

B = matrix(c(-1,-2,2,1,2,-2,0,0,-3,6,-2,-1), ncol = 3); B
gaussianElimination(B)

C = cbind( A[,1:2], -B[,1:2]); C
gaussianElimination(C) -> C1; C1
C2 = rbind(C1[1:3,],-(1:4==4))

D=matrix(round(-9*C2[,4]),ncol = 1); D

C %*% D

(C[,1:2] %*% D[1:2,])
(C[,1:2] %*% D[1:2,])/6
(C[,3:4] %*% -D[3:4,])
(C[,3:4] %*% -D[3:4,])/6
```

$U_1 \cap U_2 = \mbox{span} ( [4, -1, -2, -1]^T )$

### 2.13

```{r E02.13}
#########
#  2.13 #
#########

A = matrix(c(1,1,2,1,0,-2,1,0,1,-1,3,1),ncol=3); A
gaussianElimination(A)

A=matrix(c(3,1,7,3,-3,2,-5,-1,0,3,2,2),ncol=3); A
gaussianElimination(A)

```
$U_1 \cap U_2 = \mbox{span}\: ( [ 1, 1, -1 ]^T)$.

# 2.14 

```{r E02.14}
#########
#  2.14 #
#########

A = matrix(c(1,1,2,1,0,-2,1,0,1,-1,3,1), ncol = 3); A
gaussianElimination(A)

B = matrix(c(3,1,7,3,-3,2,-5,-1,0,3,2,2),ncol=3,byrow = F); B
gaussianElimination(B)

C = cbind( A[,1:2],-B[,1:2]); C
gaussianElimination(C)

D=matrix(c(3,1,1,0), ncol = 1); D

C %*% D

C[,1:2] %*% D[1:2,]

```
$U_1 \cap U_2 = \mbox{span}\: ( [ 3, 1, 7, 3 ]^T)$.

# 2.15

a. $F$ je podprostor jer jer skup rešenja homogenog sistema. $G$ je podprostor jer je $G = \mbox{span}\: ( [ 1, 1, 1 ]^T, [-1, 1, -3]^T )$.
b. Neka $[ x, y, z ]^T \in F \cap G$. Onda $x = a - b, y = a + b, z = a - 3 b$.<br>
$x + y - z = 0 \;\Leftrightarrow\; a - b + a + b - ( a - 3 b ) = 0 \;\Leftrightarrow\; a = - 3 b  \;\Leftrightarrow\; x = - 4 b, y = - 2 b, z = - 6 b$
Dakle, $F \cap G = \mbox{span} ( [2, 1, 3]^T )$
c. Nađimo prvo bazu $F$ koristeći $-1$-trik:
```{r E02.15}
#########
#  2.15 #
#########

# c. 
A=rbind(c(1,1,-1),-(1:3==2),-(1:3==3)); A
B=cbind(c(1,1,1),c(-1,1,-3)); B
C=cbind(A[,2:3],-B); C
gaussianElimination(C)->C1; C1
C2 = rbind(C1[1:3,],-(1:4==4))
D = C2[,4]
C %*% D
A[,2:3] %*% D[1:2]
A[,2:3] %*% D[1:2]/2
```
$F \cap G = \mbox{span}\: ( [ 2, 1, 3 ]^T)$.

# 2.16

a. Da. $\forall f, g \in L^1( [ a, b ] ), \ \forall \lambda, \psi \in \R \int_a^b ( \lambda f ( x ) + \psi g ( x ) ) dx = \lambda \ \int_a^b f ( x ) dx + \psi  \int_a^b g ( x ) dx$.
Vektorski prostor $L^1( [ a, b ] )$ je beskonačno-dimenzionalni vektorski prostor nad $\R$.

b. Da. $\forall f, g \in C^1, \forall \lambda, \psi \in \R, \forall x \in \R \ ( \lambda f ( x ) + \psi g ( x ) )' = \lambda f' ( x ) + g' ( x )$. $C^1$ i $C^0$ su beskonačno-dimenzionalni vektorski prostori nad $\R$.

c. Ne. $\Phi ( 0 ) = 1$.

d. Da. Na osnovu distributivnosti množenja matrica i osobina množenja matrice skalarom.

e. Da. Na osnovu distributivnosti množenja matrica i osobina množenja matrice skalarom.
Ova transformacija predstavlja rotaciju za ugao $\theta$ u $\R^2$.

# 2.17

```{r E02.17}
#########
#  2.17 #
#########

A=matrix(c(3,2,1,1,1,1,1,-3,0,2,3,1), ncol = 3, byrow = T); A
gaussianElimination(A)->A1; A1
```
* $A_{\Phi} = \begin{bmatrix} 3 & 2 & 1 \\ 1 & 1 & 1 \\  1 & -3 & 0 \\ 2 & 3 & 1 \\   \end{bmatrix}$
* rk $(A_{\Phi})$ = 3
* $\mbox{ker} (\Phi) = \{ 0 \}, \mbox{Im} (\Phi) = \mbox{span} ( [1,0,0,0]^T, [0,1,0,0]^T, [0,0,1,0]^T )$, $\mbox{dim} ( \mbox{ker} (\Phi) ) = 0, \mbox{dim} ( \mbox{Im} (\Phi) ) = 3$.

# 2.19

```{r E02.19}
#########
#  2.19 #
#########

A=matrix(c(1,1,1,1,-1,1,0,0,1), ncol = 3); A
B=matrix(c(1,1,1,1,2,1,1,0,0), ncol = 3); B
inv(B) %*% A %*% B
```
$\tilde{A}_{\Phi}  = \begin{bmatrix} 6 & 9 & 1 \\  -3 & -5 & 0 \\  -1 & -1 & 0 \\  \end{bmatrix}$

# 2.20

Neka su $V$ i $W$ konačnodimenzionalni vektorski prostori. Neka su $B = ( b_1, \ldots, b_n )$ uređena baza od $V$ i $C = ( c_1, \ldots, c_m )$ uređena baza od $W$. Neka je $A_{\Phi}$ matrica linearne transformacije $\Phi : V \rightarrow W$ u odnosu na baze $B$ i $C$.

Neka su $\tilde{B} = ( \tilde{b}_1, \ldots, \tilde{b}_n )$ uređena baza od $V$ i  $\tilde{C} = ( \tilde{c}_1, \ldots, \tilde{c}_m )$ uređena baza od $W$.
Neka su matrice $S = [ \tilde{b}_1, \ldots, \tilde{b}_n ]$ i $T = [ \tilde{c}_1, \ldots, \tilde{c}_m ]$.

Onda se matrica linearne transformacije $\Phi$ u odnosu na baze $\tilde{B}$ i $\tilde{C}$ dobija formulom $\tilde{A}_{\Phi} = T^{-1} A_{\Phi} S$.

```{r E02.20a}
#########
#  2.20 #
#########

# a
B1 = matrix(c(2,1,-1,-1), ncol = 2); B1
gaussianElimination(B1)

B2 = matrix(c(2,-2,1,1), ncol = 2); B2
gaussianElimination(B2)
```
Vidimo da je $\mbox{rk} ( [ {\boldsymbol b}_1, {\boldsymbol b}_2 ] ) = \mbox{rk} ( [ {\boldsymbol b}'_1, {\boldsymbol b}'_2 ]) = 2$, znači da su i $B$ i $B'$ baze od $\R^2$.

Neka je $\mbox{id}_{\R^2}$ identična linearna transformacija. $\mbox{id}_{\R^2} : {\boldsymbol x} \mapsto {\boldsymbol x}$.

Onda su matrice $[ {\boldsymbol b}_1, {\boldsymbol b}_2 ]$ i $[ {\boldsymbol b}'_1, {\boldsymbol b}'_2 ]$ matrice transformacije $\mbox{id}_{\R^2}$ u odnosu na standardnu bazu i redom bazu $B$ i $B'$.

Vektor ${\boldsymbol x}$ izražen u bazi $B$ kao, recimo, ${\boldsymbol x} = 2 {\boldsymbol b}_1 + 3 {\boldsymbol b}_2 =  \begin{bmatrix}  2 \\ 3 \\  \end{bmatrix}_B$ se u standardnoj bazi dobija kao $[ {\boldsymbol b}_1, {\boldsymbol b}_2 ] \begin{bmatrix}  2 \\   3 \\   \end{bmatrix} = \begin{bmatrix} 2 & -1 \\   1 & -1 \\   \end{bmatrix} \begin{bmatrix}  2 \\   3 \\   \end{bmatrix} = \begin{bmatrix}  1 \\ -1 \\  \end{bmatrix}$.

Obrnuto, ako je ${\boldsymbol x} = \begin{bmatrix}  1 \\ -1 \\  \end{bmatrix}$ vektor u standardnoj bazi i želimo da ga prikažemo u bazi $B$, onda dobijamo ${\boldsymbol x} = \begin{bmatrix}  2 \\ 3 \\  \end{bmatrix}_B$. Račun: $\begin{bmatrix} 2 & -1 \\   1 & -1 \\   \end{bmatrix}^{-1} \begin{bmatrix}  1 \\  -1 \\   \end{bmatrix} =  \begin{bmatrix} 1 & -1 \\   1 & -2 \\   \end{bmatrix} \begin{bmatrix}  1 \\  -1 \\   \end{bmatrix} = \begin{bmatrix}  2 \\ 3 \\  \end{bmatrix}$.

```{r E02.20b}
#########
#  2.20 #
#########

# b
P1=inv(B1) %*% B2; P1
```

Kad želimo da nađemo matricu promene iz baze $B$ u bazu $B'$, onda tražimo prikazivanje identične transformacije u odnosu na baze $B$ i $B'$:
$P_1 = \begin{bmatrix} 2 & -1 \\   1 & -1 \\   \end{bmatrix}^{-1} \begin{bmatrix} 1 & 0 \\ 0 & 1 \\   \end{bmatrix} \begin{bmatrix} 2 & 1 \\   -2 & 1 \\   \end{bmatrix} = \begin{bmatrix} 1 & -1 \\   1 & -2 \\   \end{bmatrix} \begin{bmatrix} 2 & 1 \\   -2 & 1 \\   \end{bmatrix} = \begin{bmatrix}  4 & 0 \\ 6 & -1 \\  \end{bmatrix}$

```{r E02.20c}
#########
#  2.20 #
#########

# c
P2 = matrix(c(1,2,-1,0,-1,2,1,0,-1), ncol = 3); P2
det(P2)
```
Neka je matrica $P_2 = [ {\boldsymbol c}_1, {\boldsymbol c}_2 , {\boldsymbol c}_3 ]$.

Pošto je $\mbox{det} P_2 \neq 0$, $C$ jeste baza, jer je punog ranga. Upravo matrica $P_2$ je matrica promene iz baze $C$ u standardnu bazu $C'$.

```{r E02.20d}
#########
#  2.20 #
#########

# d
AB = matrix(c(1,1,1,-1,0,2,1,-1,1,3), ncol = 5); AB
ABG = gaussianElimination(AB); ABG
A = t(ABG[,3:5]); A
```

$\Phi ( {\boldsymbol b}_1 + {\boldsymbol b}_2 ) = \Phi ( {\boldsymbol b}_1 ) + \Phi ( {\boldsymbol b}_1 ) = \phantom{2 c_1 - } \; c_2 + c_3$<br>
$\Phi ( {\boldsymbol b}_1 - {\boldsymbol b}_2 ) = \Phi ( {\boldsymbol b}_1 ) - \Phi ( {\boldsymbol b}_1 ) = 2 c_1 - c_2 + 3 c_3$

Primenom Gausovih transformacija:<br>
$\Phi ( {\boldsymbol b}_1 ) = \phantom{-} c_1 \phantom{ + 3 c_2 } +          2  c_3$<br>
$\Phi ( {\boldsymbol b}_2 ) =          -  c_1           + c_2      - \phantom{2} c_3$

Dobijamo da je $A_{\Phi} = \begin{bmatrix} 1 & -1 \\ 0 & 1 \\   2 & -1 \\   \end{bmatrix}$ matrica transformacija $\phi$ u odnosu na uređene baze $B = ( {\boldsymbol b}_1,  {\boldsymbol b}_2 )$ i $C = ( {\boldsymbol c}_1, {\boldsymbol c}_2, {\boldsymbol c}_3 )$.

```{r E02.20e}
#########
#  2.20 #
#########

# e
A1 = P2 %*% A%*% P1; A1
```

Koristimo formulu $\tilde{A}_{\Phi} = T^{-1} A_{\Phi} S$, gde je $T^{-1} = P_2$ (dobijeno pod c) i $S= P_1$ (dobijeno pod b).

```{r E02.20f}
#########
#  2.20 #
#########

# f
x = matrix(c(2,3), ncol=1); x
# (i)
P1 %*% x
# (ii)
A %*% P1 %*% x
# (iii)
P2 %*% A %*% P1 %*% x
# (iv)
A1 %*% x
```
