This project contains three small Lua programs that connect math concepts to practical programming.
- File:
mandelbrot.lua - What it does: prints an ASCII visualization of a simplified Mandelbrot set in the terminal.
- Core idea: each character position is mapped to a complex number, and iterative divergence determines the symbol intensity.
Run:
lua mandelbrot.lua- File:
matrix_sum.lua - What it does: adds two 3x3 matrices and prints the original matrices and the result.
- Core idea: element-wise addition using nested loops and table indexing.
Run:
lua matrix_sum.lua- File:
fibonacci.lua - What it does: computes Fibonacci in two ways (recursive and iterative), then compares call count and execution time.
- Core idea: recursion demonstrates exponential growth in repeated work, while iteration demonstrates a more efficient linear approach.
Run:
lua fibonacci.lua
lua fibonacci.lua 40- Understand how iterative formulas create fractal structures.
- Apply matrix addition from linear algebra in code.
- Compare recursive and iterative algorithm behavior in Fibonacci.
- Observe how implementation choice impacts performance.