Mathematics and Algorithms for GPU-Based Graphics and Compute

A Rigorous Treatment with Applications — Diiv’s Custom 36-Week Course

This website is an open course I’m building during weekends where I have free time. It will likely take 1–2 years to complete but hopefully sooner.

AI was used to generate the weekly lesson titles and lesson plan summaries in the syllabus. Everything else — all lesson notes, exercises, coding projects, and proofs — is written entirely by me with no AI assistance, since the goal is to learn or re-learn the material and that can only happen by producing my own content. I did use AI to help scaffold this website’s structure/skeleton.

All proofs are done by hand on paper first. The handwritten proofs are then converted into LaTeX using AI (OpenAI or Claude) so I can focus on the actual mathematics and let the AI handle the tedious typesetting.

My full-time work is in distributed systems and mobile device management which is always going to be my main priority, so this is my hobby outside of work project.

Full Syllabus · Lessons


Prerequisites

  • Multivariable calculus (college level)
  • Introductory discrete mathematics
  • Basic probability theory

Course Description

This course presents a mathematically rigorous and systems-oriented introduction to GPU-based computing, with applications in computer graphics, scientific computing, machine learning, and coding theory. It develops the theoretical foundations underlying modern GPU systems, including linear algebra, real and functional analysis, probability and stochastic processes, numerical methods, signal processing, optimization, information theory, and abstract algebra.

Emphasis is placed on the interplay between mathematical structure and efficient parallel implementation. Core topics include linear transformations and spectral methods, numerical stability and conditioning, parallel algorithms such as reduction and scan, Fourier analysis and convolution, Monte Carlo methods, convex optimization, and finite field arithmetic for error-correcting codes. These concepts are reinforced through hands-on projects implemented using modern GPU programming techniques, integrating both graphics and general-purpose compute workloads.

Three secondary enrichment threads run through the course: algorithmic analysis and design (divide-and-conquer, randomized algorithms, linear programming, greedy algorithms, and arithmetic algorithms via Dasgupta); the theory of computation (formal languages, complexity classes, NP-completeness, and decidability via Sipser); and applied probabilistic estimation (Bayes filters, particle filters, Gaussian uncertainty, and MAP optimization via Thrun, Burgard & Fox’s Probabilistic Robotics). These threads appear as supplementary readings, extra proofs, and exercises at points where they naturally reinforce the main material — they do not replace it.

By the end of the course, students will have constructed a unified understanding of the mathematical principles and algorithmic patterns that drive high-performance GPU systems, along with practical experience building rendering pipelines, compute kernels, and applied systems that bridge theory and implementation.


Course Structure

8 phases across 36 weeks:

Phase 0 · Weeks 1–4 — Foundations: GPU + Linear Algebra + Analysis

Vector spaces, linear maps, matrix multiplication, eigenvalues. GPU basics: triangle rendering, transformation kernels, and matrix multiply.

Phase 1 · Weeks 5–8 — Probability + Functional Thinking

Probability spaces, random variables, covariance, spectral decomposition. Normed vector spaces and linear operators. PCA and covariance kernels. Secondary enrichment: Gaussian uncertainty, covariance ellipses, and uncertainty propagation (Probabilistic Robotics).

Phase 2 · Weeks 9–12 — Geometry + Graphics Math

Coordinate systems, curves, surfaces, curvature, illumination models. Camera systems, mesh transforms, Lambert/Blinn-Phong shading, texture mapping.

Phase 3 · Weeks 13–16 — GPU Algorithms + Numerical Stability

Parallel reduction, prefix scan, sorting networks, tiled matrix multiply. Floating-point error, conditioning, and memory hierarchy analysis. Secondary enrichment: divide-and-conquer sorting and mergesort correctness (Dasgupta); time complexity basics (Sipser).

Phase 4 · Weeks 17–20 — Signals + Fourier + Complex Analysis

Discrete convolution, DFT/FFT, sampling theory, Monte Carlo rendering. LTI systems, the Nyquist theorem, path tracing.

Phase 5 · Weeks 21–24 — Probability Deep Dive

Law of large numbers, variance reduction, Markov chains. Monte Carlo integration, importance sampling, random walks. Secondary enrichment: Bayes filters, histogram localization, particle filters, and sequential Monte Carlo (Probabilistic Robotics).

Phase 6 · Weeks 25–28 — Optimization + Information Theory

Convex sets and functions, gradient descent, duality theory, entropy and KL divergence. SGD, constrained optimization, information-theoretic kernels. Secondary enrichment: linear programming and LP duality (Dasgupta); NP-completeness and polynomial-time reductions (Sipser); Huffman coding and greedy algorithms (Dasgupta); MAP estimation and least-squares localization (Probabilistic Robotics).

Phase 7 · Weeks 29–32 — Abstract Algebra + Coding Theory

Groups, rings, finite fields, field extensions. Reed–Solomon codes, polynomial arithmetic, GF(2ⁿ) kernels. Secondary enrichment: Euclidean algorithm, fast modular exponentiation, and arithmetic algorithms (Dasgupta).

Phase 8 · Weeks 33–36 — Systems + Capstone

GPU profiling, integrated graphics and compute pipelines, final system build and optimization. Secondary enrichment: time and space complexity, theory vs. measurement (Sipser); decidability and NP-completeness capstone reflection (Sipser).


Reference Books

These are the texts behind the scenes that inform my lecture notes. You don’t need them for the course.

Linear Algebra - Linear Algebra Done Right — Sheldon Axler

Real Analysis - Elementary Analysis: The Theory of Calculus — Kenneth A. Ross

Probability - Introduction to Probability — Bertsekas & Tsitsiklis

Numerical Linear Algebra - Numerical Linear Algebra — Trefethen & Bau

Functional Analysis - An Introductory Course in Functional Analysis — Bowers & Kalton

Geometry - 3D Math Primer for Graphics and Game Development — Dunn & Parberry - Elementary Differential Geometry — Pressley

Computer Graphics - Fundamentals of Computer Graphics — Shirley & Marschner

Topology - Introduction to Topology — Mendelson

Signal Processing - Discrete-Time Signal Processing — Oppenheim & Schafer - Signals and Systems — Oppenheim, Willsky & Nawab

Complex Analysis - Complex Analysis — Ahlfors / Bak & Newman

Optimization - Convex Optimization — Boyd & Vandenberghe

Information Theory - Elements of Information Theory — Cover & Thomas

Abstract Algebra - A Book of Abstract Algebra — Pinter

Algorithms - Algorithms — Dasgupta, Papadimitriou & Vazirani

Theory of Computation - Introduction to the Theory of Computation — Sipser

Probabilistic Robotics - Probabilistic Robotics — Thrun, Burgard & Fox

Measure Theory - Measure, Integration & Real Analysis — Sheldon Axler

Scientific Computing - Numerical Python: Scientific Computing and Data Science Applications with NumPy, SciPy and Matplotlib — Robert Johansson

GPU Programming - Metal by Tutorials — Begbie & Horga (Kodeco) - Mastering Graphics Programming with Vulkan — Castorina & Sassone - GPU Programming with C++ and CUDA — Paulo Motta