Skip to content

Latest commit

 

History

History
190 lines (120 loc) · 4.99 KB

File metadata and controls

190 lines (120 loc) · 4.99 KB

Math Notes

First-principles math. External links live in resources.md. Linear-algebra ideas also support ../ai/notes.md and ../numpy/notes.md.

Contents

Algebra

  • Studies non-empty sets of mathematical objects together with algebraic operations

Algebra expression terms

Quantity

  • A measurable property of an object or system

Magnitude

  • The size or extent of a quantity

Scalar

  • Quantity that has magnitude only (no direction)

Geometry

Endpoint

  • A specific location (point)

Line segment

  • Straight path bounded by two distinct endpoints
  • Contains all points between them
  • A line extends infinitely in both directions — a segment does not

Radius (radii)

  • Line segment from the center of a circle or sphere to its perimeter

Vector

  • Quantity with both magnitude and direction
  • As a list of numbers: $[1,\ 3,\ 5,\ 10,\ 20]$
  • In physics diagrams: an arrow whose length is magnitude

Triangles

  • Closed 2D shape with three sides, three angles, three vertices
  • Interior angles sum to $180\degree$

Right triangle

  • Always has one $90\degree$ angle
  • Relative to angle $\theta$:
    • Opposite — side opposite $\theta$
    • Adjacent — side next to $\theta$ (not the hypotenuse)
    • Hypotenuse — side opposite the right angle (longest)

Sine, cosine, and tangent

  • Ratios of sides of a right triangle
  • For a fixed $\theta$, each ratio is independent of triangle size
Ratio Definition
Sine $\sin\theta = \dfrac{\text{opposite}}{\text{hypotenuse}}$
Cosine $\cos\theta = \dfrac{\text{adjacent}}{\text{hypotenuse}}$
Tangent $\tan\theta = \dfrac{\text{opposite}}{\text{adjacent}}$
  • Sine and cosine values lie in $[-1,\ 1]$

Pythagorean theorem

  • $a^{2} + b^{2} = c^{2}$ (right triangle; $c$ is the hypotenuse)

Dot product

  • Product of two vectors that yields a scalar:
    • $\mathbf{a}\cdot\mathbf{b} = |\mathbf{a}|,|\mathbf{b}|,\cos\theta$
    • $\theta$ — angle between the vectors

Cross Product

  • Stub — magnitude $|\mathbf{a}|,|\mathbf{b}|,\sin\theta$ and direction (right-hand rule) to be filled.

Circle

  • Set of all points in a plane at a fixed distance from a center
    • Radius — center to edge
    • Diameter — through the center, edge to edge
    • Circumference — distance once around
    • $\dfrac{\text{circumference}}{\text{diameter}} = \pi \approx 3.14159\ldots$
    • $C = \pi d = 2\pi r$

Area

  • $A = \pi r^{2}$

Area via “unrolling”

  • A circle can be rearranged into a shape whose area is easier to see (classic pizza / triangle argument), yielding the same $A = \pi r^{2}$

Special names

Name Meaning
Tangent Line that just touches the circle at one point
Secant Line that cuts the circle at two points
Chord Segment joining two points on the circumference
Arc Portion of the circumference

Slices

  • Sector — “pizza” slice (region bounded by two radii and an arc)
    • Quadrant — sector with a $90\degree$ central angle
  • Segment — region between a chord and its arc
  • Semicircle — half a circle

Equation

  • Circle not necessarily centered at the origin:
    • $(x - a)^{2} + (y - b)^{2} = r^{2}$
    • $(a,\ b)$ — center; $r$ — radius

Matrix

  • Rectangular array of numbers
    • Rows — horizontal: $[1,\ 5,\ 67,\ 7,\ 8]$
    • Columns — vertical entries
  • Size written $m \times n$ (rows × columns) — “down, then right”
  • Dimensions are set by row and column counts (e.g. $2\times 3$, $3\times 5$)

Element

  • Each entry is an element
  • Indexed by row and column subscripts: $M_{2,3}$ is row 2, column 3

Types of matrices

Identity matrix

  • $1$s on the main diagonal, $0$s elsewhere
  • Square ($n \times n$); written $I$
  • Acts like algebraic $1$: $A I = I A = A$

Diagonal matrix

  • Nonzeros only on the main diagonal

Scalar matrix

  • Diagonal matrix whose diagonal entries are all equal

Triangular matrix

  • Lower — zeros above the main diagonal
  • Upper — zeros below the main diagonal

Matrix scalar multiplication

  • Multiply every element by the same coefficient

Matrix multiplication

  • Binary operation: product of two matrices is another matrix
  • Result has as many rows as the first factor and as many columns as the second
  • Used in graphics for rotation, scaling, and translation
  • Also the core of attention-style scores in ../ai/notes.md

Tensor

  • Scalars, vectors, and matrices are tensors of increasing rank
  • Multiple matrices stacked form a 3D (rank-3) tensor

Rank

  • Number of dimensions (axes)
  • Adding another stacked “layer” of matrices increases rank

Euclidean geometry

  • Stub — axioms and metric structure to be filled.