40 ๐ Linear Algebra - JulTob/Mathematics GitHub Wiki
๐ Linear Algebra
๐ Matrices, Vectors, Linear Transformations
- ๐ โSolve the matrix,โ transformations in 2D/3D, cryptography ciphers.
๐โ๐ฉ Eigenvalues & Eigenvectors
- ๐โ๐ฉโPopulation growthโ, or Markov chain re-interpreted.
๐ฅ Linear Systems
Linearity: When Stuff Scales Nicely
A system is linear if addition and multiplication work predictably. That means:
- If you sum two inputs, is like summing the outputs.
- If you scale an input, the output scales by the same factor.
graph LR
x@{ shape: dbl-circ, label: "๐" }
x --> fx
subgraph LinearSystem
style LinearSystem fill:darkred,stroke:tomato,stroke-width:2px
fx@{ shape: hex, label: "๐ป(๐)" }
end
graph LR
x@{ shape: dbl-circ, label: "๐" }
y@{ shape: dbl-circ, label: "๐" }
xy@{ shape: circ, label: "๐+๐" }
a@{ shape: dbl-circ, label: "โ"}
x --o a
y --o a
a --> xy
xy --> fxy
x --> fx
y --> fy
style a fill:silver ,stroke:#333,stroke-width:4px
subgraph Adding
style Adding fill:darkred,stroke:tomato,stroke-width:2px
fx@{ shape: hex, label: "๐ป(๐)" }
fy@{ shape: hex, label: "๐ป(๐)" }
fxy@{ shape: hex, label: "๐ป(๐+๐)" }
fxay@{ shape: hex, label: "๐ป(๐)+๐ป(๐)" }
fa@{ shape: dbl-circ, label: "โ"}
fxy <==> fxay
fx --o fa
fy --o fa
fa --> fxay
end
style fa fill:silver ,stroke:#333,stroke-width:4px
graph LR
x@{ shape: dbl-circ, label: "๐๐" }
x --> fx
subgraph LinearSystem
style LinearSystem fill:darkred,stroke:tomato,stroke-width:2px
fx@{ shape: hex, label: "๐ป(๐๐)" }
afx@{ shape: hex, label: "๐๐ป(๐)" }
fx <==> afx
end
For example, if you buy 2 apples for $1 each, the total cost is simply:
2ร1=2
And if you buy 3 apples instead, the cost is:
3ร1=3
Nothing unexpected happens: the relationship is straightforward. This makes linear functions incredibly useful in engineering, physics, and even art (perspective drawing relies on linear transformations!).
Conjuntos:
๐โ๐ธ
๐ Pertenece a ๐ธโ
Naturalesโค
Enterosโ
Fraccionalesโ
Realesโ
Complejos๐ธร๐น
Binรณmio:๏ฝ(๐,๐) | ๐โ๐ธ, ๐โ๐น๏ฝ
โยฒ=โรโ``๐ฃโโยฒ: {๐ฃ := (๐ฅ,๐ฆ); ๐ฅ,๐ฆโโ}
- Circunferencia:
๐ยฒ | ๐ฃ := (๐ฅ,๐ฆ); ๐ฅยฒ+๐ฆยฒ=๐
- Esfera:
๐ยณ | ๐ฃ := (๐ฅ,๐ฆ,๐ง); ๐ฅยฒ+๐ฆยฒ+๐งยฒ=๐
- Cilรญndro:
โยณ | ๐ฃ := (๐ฅ,๐ฆ,๐ง); ๐ฅยฒ+๐ฆยฒ=๐
Polinomios
โโฟ(โ) = { ๐โ+๐โ+๐โ+๐โ.+.๐โ | ๐แตขโโ }
Operaciones de conjuntos
- Uniรณn
๐ธโช๐น : {๐ฅ | ๐ฅโ๐ธ โ ๐ฅโ๐น}
- Intersection
๐ธโฉ๐น : {๐ฅ | ๐ฅโ๐ธ โ ๐ฅโ๐น}
- Complement
โ๐ธ: {๐ฅ | ๏ฟข๐ฅโ๐ธ }
- Relative Complement
๐นโ๐ธ: {๐ฅ | ๏ฟข๐ฅโ๐ธ โ ๐ฅโ๐น}
Greatest common divisor
if the gcd of (x,y) =1
then x and y are coprimes, or relative primes.
$gcd (12, 15) = 3$
Euclidean:
$n = qd + r$
$gcd(n,d) = gcd(d,r)$
Least common multiple
The smallest integer that divides by both
$if$ $x โฃ n โง y โฃ n$
$โ lcm(x,y) โฃ n$
$d โฃ x, y$
$โ d โฃ gcd(x,y)$
Greatest Common divisor: Jars ๐บ
You have two jars
One holds 3 litres
one holds 5
Is it possible to measure out 1 later of water?
Generally, what quantities is it possible to measure?
2(3)๐บ - 1(5)๐บ = 1 ๐ง
What can we do with the two jars =
$aยท3 + bยท5$
negatives is removing
$n( 2(3) - 5 ) = 3ยท2n -5ยทn = n$
We can repeat the process of adding two jars of 3L and extracting one of 5L.
In general
Given integers x and y, determine all possible values of the form
${ ax + by : a, b โ โค }$
Example
Consider two jars of 4L and 10L.
$4a + 10b$
We can only get even numbers.
proof:
$4a + 10b = 2$
or for any even number
$m(4a + 10b) = 4(am) + 10(bm) = 2m$
for
$a = -2$
$b = 1$
we see we can get any even number.
In general $ax + by$ is a linear combination.
The key is to know the smallest possible combination.
The greatest common divisor of two integers x and y in the smallest positive integer that is a linear combination of x and y
the set of linear combinations of x and y are the multiples of gcd(x,y)
${ ax + by : a, b โ โค }$
$=$
${ ๐ ยท gcd(x,y) : ๐ โ โค }$
As we have already seen, the answer is yes, we can measure 1 liter given 3-liter and 5-liter jars. Now we know the reason this is possible is that $gcd(3, 5) = 1$.
Linear Algebra
Vector Algebra
Addition
Vโ + Uโ = Wโ
โi ( w[i] = v[i] + u[i] )
Multiplication
Wโ = ๐Vโ
โi ( w[i] = ๐ยทv[i] )
Linear Combination
Addition and multiplication combined
๐Vโ + ๐Uโ = Wโ
โi ( w [i] = ๐ยทv[i] + ๐ยทu[i] )
๐,๐โโ
For any a and b of two vectors they can either fill a space or form a line
Vector Product
VโยทUโ = ๐
Length
||Vโ|| = โVโยทVโ
Zero Vector
๏ผโ:
๏ผ[i] = 0
๏ผโ is into every linear combination (๐,๐ = 0)
Linear components
๐Vโ : makes a line
๐Vโ + ๐Uโ : Makes a plane
๐Vโ + ๐Uโ + ๐Wโ : Makes a volume
etc
Ordinary Equations
A set of ordinary equations can be represented by a linear combination of vectors, or a Matrix Equation.
2๐ ๏ผ ๐ = 1
- ๐ ๏ผ 2๐ = 0
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ (2, -1) + ๐ (-1,2) = (1,0)
โโโโโโโโโโโโโโโโโโโโ
โก 2 -1โคโ๐โ = โก 1 โค
โฃ -1 2โฆโ๐โ = โฃ 0 โฆ
Dot Product
Vโ โ Uโ = ๐ฐ
๐ฐ = โ ๐ฏแตขร๐แตข
Length
||Vโ|| = โ Vโโ Vโ ]
Unit Vector
๐ฬ = Vโ โ |Vโ|
โ โ || ๐ฬ || = 1
In 2D
๐ฬ = (cos๐, sin๐)
Perpendicularity
Vโ โ Uโ = 0 โน Vโโ Uโ
โ โ โ โ โ โ โ โน ||Vโ||ยฒ ๏ผ ||Uโ||ยฒ = ||Vโ ๏ผ Uโ||ยฒ
Vโ โ Uโฬ = cos ๐
โ โ โ ๐ := smallest angle โก๐,๐cos ๐ =
Vโ โ Uโ
โโโโ
||Vโ|| || Uโ||
Schwarz Inequality
|Vโ โ Uโ| โค |Vโ| ร |Uโ|
Triangular Inequality
|Vโ + Uโ| โค |Vโ| + |Uโ|
Matrix times Vector
โก a11 a12โคโ๐โ = โ๐ยทa11 ๏ผ a12ยท๐โ
โฃ a21 a22โฆโ๐โ โ๐ยทa21 ๏ผ a22ยท๐โ
Matrix
: Vector of Vectors
Aโฃ = Aโโ
โโ
โกAโโโค
โขAโโโฅ
โขโขฐ โฅ
โฃAโโโฆ
โโโโโ
โกaโโ aโโ aโโ โฏ aโโโโค
โขaโโ aโโ aโโ โฏ aโโโโฅ
โขโขฐ โฎ โฎ โฑ โฎ โฅ
โฃaโโ aโโ aโโ โฏ aโโโโฆ
Matrix ร Vector
Aโฃ vโ
= (Aโโยท vโ , Aโโยท vโ , Aโโยท vโ , โฏ Aโโยท vโ )
Inverse
๐ดโฃ vโ = bโ
vโ = ๐ดโฃโปยน bโ
๐ดโฃโปยน ๐ดโฃ = ๐ผโฃ
๐ผโฃ = ( uโโ, uโโ, uโโ โฆ uโโ)
uโแตข = { 1 at i, 0 else)
Calculate Inverse
Transform ๐ดโฃ into ๐ผโฃ , then apply the same transformations into ๐ผโฃ . Thats the inverse.
โก1 2โคโก1 0โค
โฃ3 4โฆโฃ0 1โฆ
โโโโโโโโโโโโโโโโโโโ 2ยช - 3ยท1ยช
โก1 2โคโก 1 0โค
โฃ0 -2โฆโฃ-3 1โฆ
โโโโโโโโโโโโโโโโโโโ 1ยช + 2ยช
โก1 0โคโก-2 1โค
โฃ0 -2โฆโฃ-3 1โฆ
โโโโโโโโโโโโโโโโโโโโ -2ยช/2
โก1 0โคโก -2 1 โค
โฃ0 1โฆโฃ 1.5 -0.5โฆ
To Annulate a matrix with the inverse, apply matrices left to right (as presented)
Dependence
wโ is dependent if
wโ = ๐vโ + ๐uโ
A matrix has independent column is invertible and the solution is unique.
Solving Linear Equations
๐ดโฃ xโ = bโ
โง ๐ฅโ ๐โโ + โฏ + ๐ฅโ๐โโ = ๐โ
โจ โฎ โฎ
โฉ ๐ฅโ ๐โโ + โฏ + ๐ฅโ๐โโ = ๐โ
-- Example
โก1 -2โคโก๐ฅโค = โ 1 โ
โฃ3 2โฆโฃ๐ฆโฆ โ 11โ
Matrix Transpose
Bโฃ = Aโฃแต : { ๐แตขโฑผ = ๐โฑผแตข}
Gaussian method
Column 1. Use the first equation to create zeros below the first pivot.
Column 2. Use the new equation 2 to create zeros below the second pivot.
Columns 3 to n. Keep going to find all n pivots and the upper triangular U.
- A linear system
Aโฃ xโ=bโ
becomes upper triangularUโฃxโ=cโ
after elimination. - We subtract
โแตขโฑผ
timesequation j
fromequation i
, to make the(i, j)
entry zero. โจ3. The multiplier isโแตขโฑผ= entry to eliminate in row i : pivot in row j
- Pivots can not be zero!
- When zero is in the pivot position, exchange rows if there is a nonzero below it.โจ
- The upper triangular
Ux = c
is solved by back substitution (starting at the bottom). - When breakdown is permanent,
Ax = b
has no solution or infinitely many.
Rules of Matrices
Bโฃ(Aโฃ ๐ฅโ) = (BโฃAโฃ) ๐ฅโ
AโฃBโฃ = Cโฃ โ BโฃAโฃ = Cโฃ
Augmented Matrix
[๐ด | ๐]
Matrices do something
Aโฃ ๐ฅโ= ๐ฅโ
times column 1 + ยท ยท ยท + ๐ฅโ times column n.
And (Aโฃ๐ฅโ)แตข = โโฑผโโ ๐แตขโฑผ ๐ฅโฑผ
Identity matrix = Iโฃ
elimination matrix = Eโฃแตขโฑผ using โแตขโฑผ
exchange matrix = Pโฃแตขโฑผ.
Multiplying ๐ดโฃ xโ = bโ
by Eโฃโโ subtracts a multiple โโโ of equation 1 from equation 2.
The number -โโโ is the (2, 1) entry of the elimination matrix Eโโ
For the augmented matrix [Aโฃ bโ]
, that elimination step gives
[ EโฃโโAโฃ Eโฃโโbโ]
When Aโฃ multiplies any matrix Bโฃ, it multiplies each column of Bโฃ separately.
Aโฃโโโ ร Bโฃโโโ =
๏ผป Bอฬ
โ , Bอฬ
โ , โฏ Bอฬ
โ ]
โกAโโ;โค โก AโโยทBอฬ
โ , AโโยทBอฬ
โ ,โฏ, AโโยทBอฬ
โ;โค
โขAโโ;โฅ โข AโโยทBอฬ
โ , AโโยทBอฬ
โ ,โฏ, AโโยทBอฬ
โ;โฅ
โขโฎ ;โขโฅ โฎ |
โฃAโโ โฆ โฃAโโยทBอฬ
โ , AโโยทBอฬ
โ ,โฏ, AโโยทBอฬ
โ โฆ
=
Cโฃโโโ
Cแตขโฑผ := Aโแตขโ
Bโแตโฑผ
(AโฃBโฃ)Cโฃ = Aโฃ(BโฃCโฃ)
(AโฃBโฃ)๐ฅโ = Aโฃ๏ผBโฃ๐ฅโ๏ผ
Aโฃ(Bโฃ+Cโฃ) = AโฃBโฃ + AโฃCโฃ
(Aโฃ+Bโฃ)Cโฃ = AโฃCโฃ + BโฃCโฃ
Sqare Matrices
Aโฃยฒ = AโฃAโฃ
Aโฃโฟโบแต = Aโฃโฟ ยท Aโฃแต
(Aโฃโฟ)แต = Aโฃโฟโ แต
Invertion
AโฃโปยนAโฃ = Iโฃ = AโฃAโฃโปยน
detโจAโฃโฉ
Aโฃxโ๏ผ0โ โบ xโ๏ผ0โ
(AโฃBโฃ)โปยน = Bโฃโปยน Aโฃโปยน
AโฃAโฃโปยน๏ผIโฃ
Transpose
(Aโฃxโ )แต = xโแต Aโฃแต
(AโฃBโฃ)แต = Bโฃแต Aโฃแต
(Aโฃโปยน)แต๏ผ(Aโฃแต)โปยน
Aโฃ๐ฅโ โ
๐ฆโ = ๐ฅโ โ
Aโฃแต๐ฆโ
(Aโฃ+Bโฃ)แต = Aโฃแต + Bโฃแต
Symmetric.
IFF Sโฃ ๏ผSโฃแต
Orthogonal
IFF Qโฃโปยน๏ผQแต
Permutation matrix
has the rows of Iโฃ in any order.