Matrices are the Legos of the Universe
“Dividing mathematics into linear and non-linear is like dividing the world into banana and non-banana.” — Google Gemini
In this video, we explore using Scilab and ChatGPT o1 to turn Python or R code into pure mathematics.
Introductory Notation
Vector: A column vector \( \mathbf{v} \in \mathbb{R}^n \) is written as:
\[ \mathbf{v} = \begin{pmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{pmatrix} \]Matrix: An \( m \times n \) matrix \( A \) is:
\[ 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} \]Matrix-Vector Multiplication:
\[ A\mathbf{x} = \begin{pmatrix} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n \\ \vdots \\ a_{m1}x_1 + \cdots + a_{mn}x_n \end{pmatrix} \]Fibonacci Matrix & Golden Ratio
The Fibonacci sequence appears naturally from powers of a simple 2×2 matrix:
\[ F = \begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix} \]Then:
\[ F^n = \begin{pmatrix} F_{n+1} & F_n \\ F_n & F_{n-1} \end{pmatrix} \]where \( F_n \) is the nth Fibonacci number.
The eigenvalues of \( F \) are the golden ratio \( \phi = \frac{1 + \sqrt{5}}{2} \) and its conjugate \( \hat{\phi} = \frac{1 - \sqrt{5}}{2} \).
As \( n \to \infty \), the ratio \( \frac{F_{n+1}}{F_n} \to \phi ≈ 1.61803 \) (the golden ratio).
Proof sketch: The characteristic equation of \( F \) is \( \lambda^2 - \lambda - 1 = 0 \\\), whose roots are exactly \( \phi \) and \( \hat{\phi} \). Diagonalizing \( F \) shows the powers grow according to \( \phi^n \).
R Code & Scilab
Full source available on GitHub:
You can run this code using R and RStudio. Scilab is also excellent for numerical linear algebra experiments.