← Presentations

Working examples you can run.

Each example includes imports and generated data. Working code and tests are included. No program imports another lesson's example.

Download the legacy coding bundle · Setup and command reference

Sixteen programs use only Python's standard library. Five ML programs require PyTorch; PINN also uses NumPy and Matplotlib. All were executed from isolated temporary directories.

Run your first example

python3 -m venv .venv
source .venv/bin/activate
python python_101.py
python python_101.py --self-test

# For ML examples:
python -m pip install -r requirements.txt
python cnn.py
python cnn.py --self-test

Use Python 3.10+. On Windows PowerShell, activate with .venv\Scripts\Activate.ps1. ML demos run on CPU; no network dataset download is needed.

Programming foundations

Python 101 — Basics for a New Bee

How do we turn CSV records into a useful command-line summary?

python python_101.py
python python_101.py --self-test

6 checks passed · Python standard library

The Science of Programming — Explained Simply

How can a contract determine the loop we should write?

python science_of_programming.py
python science_of_programming.py --self-test

660 checks passed · Python standard library

Weakest Preconditions — Explained Simply

Which starting states let a program finish with the required result?

python weakest_preconditions.py
python weakest_preconditions.py --self-test

533 checks passed · Python standard library

The Science of Programming — A Practical Python Playbook

How do we implement and check loops with precise boundary behavior?

python science_of_programming_python.py
python science_of_programming_python.py --self-test

2304 checks passed · Python standard library

Neural networks and learning

PyTorch 101 — From Tensors to Training

Can gradients learn the unknown slope and intercept of a line?

python pytorch_101.py
python pytorch_101.py --self-test

5 checks passed · torch>=2.2

Neural Networks and CNNs — From First Principles

Can shared local filters learn to distinguish vertical and horizontal bars?

python cnn.py
python cnn.py --self-test

6 checks passed · torch>=2.2

How LLMs Work — A Tech Talk

Can a small model learn next-character prediction while being unable to see future targets?

python llm_tech_talk.py
python llm_tech_talk.py --self-test

5 checks passed · torch>=2.2

Adaptive Neural Infrastructure with Memory Accumulation

Can we select experts, accumulate state, and keep memory scoped to a user?

python adaptive_neural_infra.py
python adaptive_neural_infra.py --self-test

8 checks passed · torch>=2.2

Physics-Informed Neural Networks

Train a heat-equation PINN, inspect its loss components, and compare against the exact solution.

python pinn_heat_equation.py --epochs 2500
python pinn_heat_equation.py --self-test

4 checks passed · torch, numpy, matplotlib

PINN for software engineers

Tokens, rules, and a real PINN

Use 192 generated Python programs for next-token training. Compare a grammar penalty with an inference mask.

The second lab learns a decay equation without sensor records.

Computation and algorithms

Automata Theory — DFA, NFA & Regular Expressions

Can a small state machine recognize a pattern one symbol at a time?

python automata_theory.py
python automata_theory.py --self-test

510 checks passed · Python standard library

Context-Free Grammars & Pushdown Automata

How does a stack or parsing table recognize nested structure?

python cfg_pda.py
python cfg_pda.py --self-test

254 checks passed · Python standard library

Turing Machines & Undecidability

How can a head and a transition table transform a binary number?

python turing_machines.py
python turing_machines.py --self-test

257 checks passed · Python standard library

P vs NP & NP-Completeness

How do we check a SAT witness and preserve satisfiability in a graph reduction?

python p_vs_np.py
python p_vs_np.py --self-test

42 checks passed · Python standard library

Lambda Calculus — Computation from Functions Alone

Can function application compute while preserving which binder a variable belongs to?

python lambda_calculus.py
python lambda_calculus.py --self-test

6 checks passed · Python standard library

Randomized Algorithms — Probability as a Tool

Which guarantees come from correctness, and which depend on random choices?

python randomized_algorithms.py
python randomized_algorithms.py --self-test

389 checks passed · Python standard library

Information and compression

Entropy & Shannon's Source Coding Theorem

Can a prefix code reduce the average bits needed for a skewed source?

python entropy_source_coding.py
python entropy_source_coding.py --self-test

14 checks passed · Python standard library

Channel Capacity & Error-Correcting Codes

How does structured redundancy correct a single flipped bit?

python channel_capacity_codes.py
python channel_capacity_codes.py --self-test

131 checks passed · Python standard library

KL Divergence, Cross-Entropy & Machine Learning

How do model probabilities turn into a stable loss and gradient?

python kl_cross_entropy.py
python kl_cross_entropy.py --self-test

14 checks passed · Python standard library

Kolmogorov Complexity — The Information in One Object

What can a short description show that a compressor's output length cannot?

python kolmogorov_complexity.py
python kolmogorov_complexity.py --self-test

1005 checks passed · Python standard library

Compression in Practice — Arithmetic Coding, LZ & Beyond

Can we encode data compactly and decode it exactly?

python compression_in_practice.py
python compression_in_practice.py --self-test

29 checks passed · Python standard library

Functional composition

Monads in Python — With the Math

How can we compose successful steps while keeping missing values or errors explicit?

python monads_python.py
python monads_python.py --self-test

38 checks passed · Python standard library

Captured outputs and numerical results are in verification.json. Tests cover finite cases and complement mathematical reasoning; they are not universal proofs.