Linear Algebra I

Vectors in R2 and R3

Year 1 · Semester IILast updated

Operations

  1. Addition
  2. Subtraction
  3. Scalar Multiplication

Length of v⃗\vec v:

v⃗=(x,y,… )⇒∥v⃗∥=x2+y2+…\vec v = (x, y,\dots)\Rightarrow \|\vec v\|=\sqrt{x^2+y^2+\dots}
∥c⋅v⃗∥=∣c∣⋅∥v⃗∥\|c\cdot\vec v\|=|c|\cdot\|\vec v\|

Dot Product

In Rn\R^n:
let v⃗=(v1,v2,…,vn)\vec v=(v_1,v_2,\dots,v_n)
let u⃗=(u1,u2,…,un)\vec u=(u_1,u_2,\dots,u_n)
v⃗⋅u⃗=((v1⋅u1)+(v2⋅u2)+⋯+(vn⋅un))\vec v\cdot\vec u = ((v_1\cdot u_1) + (v_2\cdot u_2)+\dots+(v_n\cdot u_n))

For any v⃗\vec v: v⃗⋅v⃗=x2+y2=∥v⃗∥2\vec v\cdot \vec v=x^2+y^2=\|\vec v\|^2
∥v⃗∥=v⃗⋅v⃗\|\vec v\|=\sqrt{\vec v\cdot\vec v}

Properties

If u⃗,v⃗,w⃗\vec u, \vec v, \vec w are vectors in R2\R^2 or R3\R^3 and kk is a scalar, then:

  • u⃗⋅v⃗=v⃗⋅u⃗\vec u\cdot\vec v=\vec v\cdot\vec u
  • u⃗⋅(v⃗+w⃗)=u⃗⋅v⃗+u⃗⋅w⃗\vec u\cdot(\vec v+\vec w)=\vec u\cdot\vec v+\vec u\cdot\vec w
  • k(u⃗⋅v⃗)=(ku⃗)⋅v⃗=u⃗⋅(kv⃗)k(\vec u\cdot\vec v)=(k\vec u)\cdot\vec v=\vec u\cdot(k\vec v)
  • v⃗⋅v⃗>0 if v⃗≠0⃗ and v⃗⋅v⃗=0 if v⃗=0⃗\vec v\cdot\vec v\gt0\text{ if }\vec v\not=\vec0\text{ and }\vec v\cdot\vec v=0\text{ if }\vec v=\vec0

Angle between vectors

The angle θ\theta between u and v is defined as the angle ≤ 180° formed by u and v when their tails coincide.
The angle is calculated as follows:

cos(θ)=u⃗⋅v⃗∥u⃗∥⋅∥v⃗∥cos(\theta) = \frac{\vec u\cdot\vec v}{\|\vec u\|\cdot\|\vec v\|}

Example:
Proof is at 23:04
What if θ\theta is 0°? well, cosθ=1cos\theta = 1 , so there ya go. If θ\theta is 180°, cosθ=−1cos\theta=-1, and there ya go too.
Conclusion: vectors are ⟂   ⟺  \iff their dot product is zero. These are called orthogonal vectors.

Cross Product

  • Only defined in R3\R^3

  • Output is a vector, not a scalar

  • Definition:
    Let u⃗\vec u = <x1,y1,z1><x_1, y_1, z_1>, v⃗\vec v = <x2,y2,z2><x_2, y_2, z_2>. Then,

    u⃗×v⃗=<(y1⋅z2−y2⋅z1),(x2⋅z1−z1,⋅z2),(x1⋅y2−x2⋅y1)>\vec u\times\vec v = <(y_1\cdot z_2 - y_2\cdot z_1), (x_2\cdot z_1 - z_1,\cdot z_2), (x_1\cdot y_2-x_2\cdot y_1)>
    A faster way to calculate it, (and the "normal way") is as follows.
    1. Write out u⃗\vec u above v⃗\vec v in a 2×32\times3 matrix:

      [x1y1z1x2y2z2]\begin{bmatrix} x_1 & y_1 & z_1 \\ x_2 & y_2 & z_2 \end{bmatrix}
    2. (for k = 1, 2, 3): Calculate the determinant of 2x2 matrix remaining by ignoring kthk^{th} column, this becomes the kthk^{th} component of the cross product

    3. The middle component (k=2)(k=2) of u⃗×v⃗\vec u \times \vec v is the negative of determinant calculated in step 2. (No changes for k=1,k=3k=1, k=3)

  • Corollaries:

    1. If u, v have same or opposite directions (i.e., v⃗=c⋅u⃗∣c∈R\vec v = c\cdot\vec u\mid c \in \R , then parallelogram they form is degenerate with area of 0, hence: If the length of the crossproduct is 0, the crossproduct is the zero vector)
    2. Area of Triangle ABC is half area of parallelogram formed by u and v, hence, area=12∥u⃗×v⃗∥area = \frac12\|\vec u\times\vec v\|

Representing Lines and Planes

  • Lines in R2\R^2:
      • A new way to obtain this equation:
        Let (x,y)(x, y) be any point on ℓ\ell. Since ℓ\ell goes through origin, (x,y)(x, y) is also a direction vector of ℓ\ell.
        • i.e. Direction of ℓ\ell = direction of vector (x,y)(x, y).
      • Using considerations of slope, the vector (−2,1)(-2, 1) is orthogonal to any vector in direction of ℓ\ell.
        • We call (−2,1)(-2, 1) a normal vector to ℓ\ell.
      • Hence, (−2,1)⋅(x,y)=0  ⟹  −2x+y=0(-2, 1)\cdot(x, y) = 0 \implies -2x+y=0 (see diagram)
        • Meaning, n⃗⋅(x,y)=0 ∣ ∀(x,y)∈ℓ\vec n\cdot(x, y) = 0 \space | \space \forall (x, y) \in \ell
How to represent a line in R2\R^2.
  1. Get direction vector v⃗\vec v of l by subtracting 2 points on ℓ\ell (because l might not go through the origin).

  2. If slope of line = m, Normal vector n⃗\vec n = (1,−1m)(1, -\frac1m) or any multiple of this.

  3. Line equation is: n⃗⋅(x,y)=0\vec n\cdot(x,y) = 0, and when unwrapped, looks like this:

    <nx,ny>⋅<x,y>=0  ⟹  (nx⋅x)+(ny⋅y)=0<n_x,n_y>\cdot<x, y> = 0 \implies (n_x\cdot x) + (n_y\cdot y) = 0
  • Planes in R3\R^3:
    • The set of directions ⟂ to a given vector in R3\R^3 is a plane.
      • Ex. If (a,b,c)=(0,0,1)(a, b, c) = (0, 0, 1) [z-axis], then “perpendicular directions” are (x,y)(x, y) - plane: (x,y,0)(x, y, 0)
      • {(0,0,1)⋅(x,y,0)∣x,y∈R}\lbrace (0, 0, 1)\cdot(x,y,0)\mid x,y\in\R\rbrace
    • Conclusion: ax + by + cz = 0 describes a plane through origin, to which <a, b, c> is a normal vector.
      • For any vector (x,y,z)(x, y, z) in this plane, (a,b,c)⋅(x,y,z)=0(a,b,c)\cdot(x,y,z) = 0
    • General planes in R3\R^3:
      • Let plane P1P_1 be a plane through the origin with a normal vector of (2, 1, 3).
      • Equation of P1P_1 is 2x+y+3z=02x+y+3z = 0.
      • Let plane P2P_2 be parallel to P1P_1, just shifted so it goes through (6,1,−3)(6, 1, -3).
      • What’s the equation of P2P_2?
        • Let v⃗\vec v be one direction vector on P2P_2.
        • Let (x,y,z)(x, y, z) be any point in P2P_2.
        • v⃗=(x−6,y−1,z+3)\vec v = (x-6, y-1, z+3). (just because it’s a direction)
        • The normal vector to P1=the normal vector to P2\text{The normal vector to } P_1 = \text{the normal vector to }P_2
        • This is because P2P_2 is parallel to P1P_1.
        • Equation is: (x−6,y−1,z+3)⋅n⃗=0  ⟹  ⋯  ⟹  2x+y+3z=4(x-6, y-1, z+3)\cdot\vec n = 0 \implies \dots \implies 2x+y+3z=4
        • Note the similarities between equations of parallel planes
          P1P_1: 2x+y+3z=02x+y+3z = 0
          P2P_2: 2x+y+3z=42x+y+3z = 4

      • Conclusion: Any plane in R3\R^3 has equation of ax+by+cz=dax+by+cz=d, where (a,b,c)(a, b, c) is a normal vector to the plane.
        • Ex: Find equation of plane with normal of (−1,4,2)(-1, 4, 2) going through the point (0, 1, -3)
          • Use the normal vector to get a general equation: −x+4y+2z=d-x+4y+2z=d
          • Then, plug in our point (0,1,−3)(0, 1, -3) to find d:
            • −1(0)+4(1)+2(−3)=−2-1(0)+4(1)+2(-3) = -2
          • Putting it all together, we get: −x+4y+2z=−2-x+4y+2z=-2
  • Lines in R3\R^3
    • A line in R3\R^3 cannot be described using a single equation. Instead, we describe it parametrically - that is, we describe it as a set of points using a parameter (usually t).

    • If ℓ\ell goes through origin and v⃗\vec v is any point on ℓ\ell (in example, v⃗=(3,−2,4)\vec v=(3,-2,4)), then ℓ\ell consists exactly of all scalar multiples of v⃗\vec v. ⇒\Rightarrow ℓ={t⋅v⃗∣t∈R}\ell=\{t\cdot\vec v\mid t\in\R\}. This is the parametric form.

    • Cool, but what about lines not through the origin?

      • If v⃗\vec v is a direction vector of ℓ\ell, then every point on ℓ\ell is of form P+t⋅v⃗P+t\cdot\vec v for some t∈Rt\in\R.
      • Hence, ℓ={(2,1,−4)+t⋅v⃗∣t∈R}\ell=\{(2,1,-4)+t\cdot\vec v\mid t\in\R\}
      • We find v⃗\vec v by subtracting 2 points on line:
      v⃗=Q−P=(5,−1,−5)⇒ℓ={(2,1,−4)+t⋅(5,−1,−5)∣t∈R}={(2+5t,1−t,−4−5t)∣t∈R}\begin{aligned} \vec v &= Q-P\\&= (5,-1,-5)\Rightarrow\\ \ell &=\{(2, 1, -4) + t\cdot(5,-1,-5)\mid t\in\R\}\\ &=\{(2+5t,1-t,-4-5t)\mid t\in\R\} \end{aligned}
    • In summary

      1. Line in R3\R^3 through origin:
        • ℓ={t⋅u⃗∣t∈R}\ell=\{t\cdot\vec u\mid t\in\R\}
      2. Line in R3\R^3 not through origin:
      • ℓ={u⃗+t⋅v⃗∣t∈R}\ell=\{\vec u+t\cdot\vec v\mid t\in\R\}
      • where u⃗\vec u is any direction vector of ℓ\ell.
      • Usually, u⃗\vec u is found by subtracting 2 points on ℓ\ell
  • Summary
    • Cartesian Representation (equation):
      • Line in R2\R^2: ax+by=cax + by = c
      • Plane in R3\R^3: ax+by+c=dax+by+c=d
        • normal vector n⃗\vec n is orthogonal to all direction vectors in plane
    • Parametric representation (set of points):
      • Line (in Rn∣n⩾2\R^n\mid n\geqslant 2): ℓ={u⃗+t⋅v⃗∣t∈R}\ell=\{\vec u+t\cdot\vec v\mid t\in\R\}
        • where u⃗\vec u is any point on ℓ\ell and v⃗\vec v is a direction vector of ℓ\ell.
        • Neither u⃗ or u⃗\vec u\text{ or }\vec u is unique (because any scalar multiple of a direction vector is also a direction vector)
        • If ℓ\ell goes through the origin, then u⃗=(0,0,0)\vec u=(0, 0, 0), and adding it has no effect. Therefore, it can be written as: ℓ={t⋅u⃗∣t∈R}\ell=\{t\cdot\vec u\mid t\in\R\}
  • Another way to represent a line in R3\R^3:
    • Two non-parallel planes in R3\R^3 intersect at a line.
    • Each point on this line must satisfy the equations of both planes.
    • In example in diagram, any (x, y, z) on ℓ\ell must be a solution of the system {x+y+z=2−x+2y−2z=1\left\{\begin{aligned}x+y+z&=2\\-x+2y-2z&=1\end{aligned}\right.
    • Conversely, any solution of the system is a point on ℓ\ell.

Tirgulim [Incomplete]

Given 4 points, prove using vectors that the points form a parallelogram

A=(2,−4,−3)A=(2,-4,-3), B=(7,2,7)B=(7,2,7), C=(4,5,9)C=(4,5,9), D=(−1,−1,−1)D=(-1,-1,-1)

  • To prove that a quad. ABCD is a parallelogram, show that one pair of opposite sides are both parallel and equal in length.
  • Let v⃗=AB‾ and let u⃗=CD‾\text{Let }\vec v = \overline {AB}\text{ and let }\vec u = \overline{CD}
  • We need to show that v⃗\vec v and u⃗\vec u have the same direction and Length
  • ABCD‾\overline{ABCD} is a parallelogram iff v⃗=u⃗\vec v = \vec u.
Find a vector orthogonal to 2 given vectors

Very easy, all you have to do is take the Cross Product of the 2 vectors. This will yeild an orthogonal vector.

Given 2 vectors of equal length and the angle between them, find a related angle

If the angle between v⃗\vec v and u⃗\vec u is 30°, calculate the angle between u⃗+3v⃗ and 4u⃗=2v⃗\vec u + 3\vec v\text{ and }4\vec u = 2\vec v

  • We know the angle will use the following formula:

    cos⁡θ=(u⃗+3v⃗)⋅(4u⃗−2v⃗)∣∣u⃗+3v⃗∣∣⋅∣∣4u⃗−2v⃗∣∣=4∣∣u⃗∣∣2+10(u⃗⋅v⃗)−6∣∣v⃗∣∣2(u⃗+3v⃗)⋅(u⃗+3v⃗)⋅(4u⃗−2v⃗)⋅(4u⃗−2v⃗)\cos\theta=\frac{(\vec u + 3\vec v)\cdot (4\vec u - 2\vec v)}{||\vec u + 3\vec v|| \cdot ||4\vec u - 2\vec v||}\newline\newline=\frac{4{||\vec u||}^2+10(\vec u\cdot\vec v)-6{||\vec v||}^2}{\sqrt{(\vec u+3\vec v)\cdot(\vec u+3\vec v)}\cdot\sqrt{(4\vec u - 2\vec v)\cdot(4\vec u - 2\vec v)}}
  • Denote nn as the length of u⃗ and v⃗\vec u \text{ and }\vec v

  • Ok I can’t type all this out. It’s complicated.

  • You can find the rest in the recordings, I don’t think I’m going to continue with the Tirgulim.