Skip to content
LumenaryAcademy

Lumenary Scientia

Lumenary CS

Computer science from a first program to the frontier of AI: algorithms, systems, software at scale, machine learning and how large models are built.

Lumenary CS is the second subject of Lumenary Scientia, free and open source like Lumenary Math. It starts with no experience at all and climbs, lesson by lesson, through data structures, algorithms and computer systems to the engineering practised at the largest technology companies and the research done at AI labs today.

Every lesson teaches with ideas first and code second. Code is in Python, and every block with a Run in browser button runs there, in a sandbox, with nothing to install. The runnable examples and the Python exercises are run by Lumenary's test suite, and a lesson says Code tested only when all of its code passed.

Alongside the main course, Programming languages has a course for each of the world's major programming languages, from Assembly to Zig, each from a first program to professional practice; and electives go deep into single fields, starting with Blockchains & Verifiable Computation. Lumenary CS's neighbours in Lumenary Scientia are Lumenary EE, for electrical engineering, and Lumenary Robotics.

Every lesson was drafted with AI assistance and is awaiting review by a human computer scientist. The text, exercises and code are original and licensed CC BY-SA 4.0 (code Apache-2.0). Where a lab, company or project has published the primary source — a paper, a design document, an engineering blog — the lesson links to it rather than retelling it.

AI-draftedAwaiting review by a computer scientist
  • Chloe · The Computer Scientist
    “What's the idea that makes it work?”
  • Margaret · The Experimenter
    “What happens when we run it?”
  • Gideon · The Verifier
    “Is it correct in every case?”

Beyond the main course

Start · 6 lessons

First programs

No experience needed, from about age 11. What a computer actually does, and your first programs in Python: values, decisions, loops, functions and collections, and how to find and fix mistakes.

  1. 1What a computer doesInstructions, algorithms, and your very first programs in Python. 45 min
  2. 2Values, variables and expressionsNumbers, text and true-or-false, and the names that let a program remember them. 50 min
  3. 3Decisions and loopsPrograms that choose what to do, and repeat work so that you don't have to. 55 min
  4. 4FunctionsName an idea once and use it everywhere. Parameters, return values, scope, and breaking a problem into pieces. 55 min
  5. 5Lists, strings and dictionariesMany values under one name. Sequences you can index and slice, tables you can look things up in, and sets. 60 min
  6. 6Finding and fixing mistakesReading error messages, hunting bugs calmly, and writing tests that catch mistakes before anyone else does. 55 min

Core · 8 lessons

Data structures and the cost of computation

How to measure what a program costs, and the structures every programmer reaches for: arrays and lists, stacks and queues, hash tables, trees, heaps and graphs.

  1. 7Measuring the cost of a programCounting steps, growth rates, the precise meaning of O, Ω and Θ, and why appending to a list is cheap on average. 75 min
  2. 8Recursion and divide and conquerFunctions that call themselves, the call stack that makes it work, and how to solve a problem by splitting it. 75 min
  3. 9Searching and sortingBinary search and why it is correct, the classic sorting algorithms, the n log n barrier, and how Python really sorts. 85 min
  4. 10Arrays, linked lists, stacks and queuesTwo ways to keep things in a row — side by side, or each holding the next one's hand — and the four structures nearly every program is built on. 60 min
  5. 11Hash tablesConstant-time lookup on average — how it works, what it assumes, and what happens when an attacker breaks the assumption. 60 min
  6. 12Trees and binary search treesHierarchies everywhere, sorted data kept sorted, and the difference between a tree of height 20 and one of height a million. 60 min
  7. 13Heaps and priority queuesAlways knowing what comes next — the smallest, the most urgent, the earliest — for the price of a logarithm. 55 min
  8. 14Graphs: representation and traversalRoads, dependencies and friendships — how to store a network, and the two basic ways to explore one. 70 min

Algorithms · 7 lessons

Algorithm design

The design techniques behind fast programs, from greedy choices and dynamic programming to shortest paths, string matching and randomness, and what to do when a problem is provably hard.

  1. 15Greedy algorithmsTake the step that looks best right now and never look back — when that is optimal, how to prove it, and how to spot when it is not. 60 min
  2. 16Dynamic programmingSolve each subproblem once and remember the answer — and learn the real skill, which is deciding what the subproblems should be. 75 min
  3. 17Shortest pathsFrom here to there at the least cost — Dijkstra, Bellman–Ford, Floyd–Warshall and A*, and how map services answer in milliseconds. 75 min
  4. 18Minimum spanning trees and union–findConnecting everything at the least cost, and a tiny data structure whose analysis meets one of the slowest-growing functions in mathematics. 65 min
  5. 19String algorithmsFinding a pattern in a text without wasted work, indexing text for many searches, and why "character" is a slippery word. 60 min
  6. 20Hard problems: P, NP and copingWhy some problems resist every clever idea, how reductions prove it, and what engineers do when the problem in front of them is NP-hard. 60 min
  7. 21Randomness in algorithmsCoin flips that defeat adversaries, samples from endless streams, and tiny sketches that answer big questions approximately. 60 min

Systems · 8 lessons

How computers work

Down through the layers: how data is encoded in bits, how logic gates become a processor, why memory has a hierarchy, what an operating system does, and how concurrency, networks, databases and compilers work.

  1. 22Representing data: bits and bytesHow integers, real numbers and the world's writing systems become patterns of ones and zeros, and the surprises each encoding hides. 60 min
  2. 23From logic gates to a processorHow switches become gates, gates become adders and memory, and a clock turns them into a machine that follows instructions. 65 min
  3. 24The memory hierarchyWhy the processor spends much of its time waiting, how caches hide the wait, and how to write code that the caches like. 55 min
  4. 25Operating systemsThe program that runs all the other programs: the kernel, processes, virtual memory, scheduling, files and permissions, with Linux as the example. 65 min
  5. 26ConcurrencyDoing many things at once without corrupting shared data: races, locks, deadlock, event loops, message passing, and Python's GIL. 65 min
  6. 27Networks: from packets to the webHow bytes cross the planet: layers, IP addresses and routing, TCP and UDP, DNS, HTTP and TLS, and what happens when you open a web page. 65 min
  7. 28DatabasesShared, durable, queryable state, and the guarantees that make it trustworthy. 75 min
  8. 29Languages, interpreters and compilersFrom characters to tokens to trees to running code, by building a small language end to end. 80 min

Engineering · 6 lessons

Building software that lasts

How professional software is built: version control, testing, design and types, security and applied cryptography.

  1. 30Version control with GitSnapshots, hashes and a graph of history — how Git works inside, and how teams work with it. 75 min
  2. 31Testing and correctnessJustified confidence that code does what it should, and the limits of every kind of evidence. 80 min
  3. 32Designing programsAbstraction, modules and interfaces — writing code that other people can understand and change. 80 min
  4. 33Types and functional programmingLetting the computer check your reasoning, and programming with values and functions. 80 min
  5. 34Security fundamentalsThinking like a defender — threat models, the classic vulnerabilities, and the habits that prevent them. 85 min
  6. 35Applied cryptographyHashes, MACs, ciphers and signatures — what each guarantees, how TLS combines them, and why you should not build your own. 85 min

Scale · 7 lessons

Systems at scale

The engineering of large services: distributed systems, replication and consensus, storage at scale, batch and stream processing, system design, reliability, and how to show all of it in a technical interview.

  1. 36Distributed systemsMany machines acting as one — and what failure, time and an unreliable network make impossible. 85 min
  2. 37Replication and consensusKeeping several copies of the same data in agreement while machines crash and messages arrive late. 80 min
  3. 38Storage at scaleHow data is laid out on disk, split across machines, copied for safety, and moved when the cluster changes. 80 min
  4. 39Batch and stream processingComputing over data too big for one machine, whether it sits still or never stops arriving. 75 min
  5. 40System designA method for designing large services, the building blocks they share, and two designs worked end to end. 85 min
  6. 41Reliability engineeringDeciding how reliable a service should be, noticing when it is not, and designing it to bend rather than break. 80 min
  7. 42Technical interviewsHow software engineering interviews generally work, a method for solving problems out loud, and the patterns worth practising. 90 min

ML · 5 lessons

Machine learning

Learning from data, from linear models and gradient descent to neural networks you build and train yourself, and the architectures that led to the transformer.

  1. 43Learning from dataModels as functions with parameters, losses that measure their mistakes, and gradient descent to reduce them — built from scratch with numpy. 85 min
  2. 44Neural networks and backpropagationStacking simple units into flexible functions, and computing every gradient in one backward sweep — built from scratch. 90 min
  3. 45Training in practiceOptimisers, schedules, regularisation, normalisation, evaluation and debugging — the craft that turns a network that could learn into one that does. 90 min
  4. 46Convolutions, sequences and embeddingsThree ways to build structure into a network — share weights across space, carry state through time, turn symbols into vectors — and the bottleneck that led to attention. 65 min
  5. 47Attention and the transformerScaled dot-product attention from scratch, the block built around it, and how to count a transformer's parameters and FLOPs. 75 min

Frontier · 8 lessons

The frontier of AI

How today's large models are built, trained, served, evaluated, understood and made safe: the working knowledge of an AI lab in 2026, with links to the labs' own papers and documentation.

  1. 48Language models: tokens, pretraining and scalingFrom raw text to a trillion-token training run — tokenisation, next-token prediction, sampling, data, scaling laws and mixture-of-experts. 80 min
  2. 49Accelerators and distributed trainingWhy models train on GPUs and TPUs, what limits those chips, and how one training run is spread across tens of thousands of them. 80 min
  3. 50Serving modelsPrefill and decode, the KV cache and its memory, batching, quantisation, speculative decoding, distillation — and what a token really costs. 75 min
  4. 51Post-trainingHow a next-token predictor becomes an assistant — supervised fine-tuning, preference learning, RL from human and AI feedback, RL with verifiable rewards, and cheap adaptation with LoRA. 80 min
  5. 52Reasoning models, tools and agentsThinking longer, voting, calling tools, retrieving knowledge and acting in loops — how models do multi-step work, and how it goes wrong. 80 min
  6. 53Evaluating modelsBenchmarks and their life cycle, contamination, error bars, human and model judges, red-teaming and dangerous-capability evaluations — and how to write an eval worth trusting. 75 min
  7. 54InterpretabilityLooking inside networks — probes, attention patterns, the residual stream, superposition, sparse autoencoders, circuits, patching and steering — and an honest account of what we still cannot see. 75 min
  8. 55AI safety and alignmentWhat it means for an AI system to do what we intend, the ways it can fail, and the technical and institutional work aimed at making it go well. 80 min

Further reading and resources