Sister section
ComputationPath
CS theory adjacent to ML: computability, complexity, formal languages, proofs, and the limits of computation. These pages live next to the main TheoremPath curriculum but are not on its core ML spine. They earn their own home so the ML map can stay focused while the CS-theory record stays accurate.
Bits and Codes
How information is encoded as bits. Binary, character sets, compression, error correction, and floating-point arithmetic.
Binary and Bits
Why computers represent everything as bits, how integers are encoded in two's complement, and how hexadecimal compresses bytes for human use.
intro· 45 minCharacter Encodings: ASCII, UTF-8, Unicode
How text became bytes: from 7-bit ASCII to Unicode code points to UTF-8 variable-width encoding, with worked byte-level examples.
intermediate· 25 minCompression Fundamentals
Why text compresses but random bits do not. Entropy gives the floor, Huffman codes approach it, and LZ77 supplies the dictionary core of gzip.
intermediate· 45 minError Detection and Correction
Parity bits catch single flips, Hamming codes correct them, and CRCs catch burst errors in networks and storage. The Singleton and Hamming bounds say what is achievable.
intermediate· 40 minFloating-Point Representation (IEEE 754)
How real numbers fit in 32 or 64 bits: sign, exponent, mantissa, the implicit leading 1, NaN, infinity, denormals, and the precision tradeoffs that bite ML.
intro· 35 min
Logic Gates
How bits become logic. Boolean algebra, combinational and sequential circuits, NAND universality, and a working ALU from gates.
Boolean Algebra
The algebra of true and false: operators, identities, normal forms, Karnaugh maps, and the minimization step used before building gates.
intro· 40 minBuilding An ALU From Gates
How a chip-scale arithmetic-logic unit is assembled from 1-bit slices, carry chains, two's-complement subtraction, flags, and operation-select muxes.
intermediate· 35 minCombinational Circuits
Circuits whose outputs are pure functions of current inputs, from gates to adders, comparators, multipliers, delay, fan-out, and glitches.
intermediate· 45 minDecoders, Encoders, Multiplexers
Signal selectors for digital datapaths: decoders choose one line, multiplexers choose one value, and encoders compress active lines into indices.
intro· 40 minNAND Universality
Every Boolean function reduces to NAND gates alone. One gate type, one mask pattern, and in CMOS it costs fewer transistors than AND or OR.
intro· 30 minSequential Circuits and Flip-Flops
Memory in digital logic comes from feedback. This page builds SR latches, D latches, edge-triggered flip-flops, timing constraints, counters, shift registers, and finite-state machines.
intermediate· 45 min
CPU and Machine Model
How instructions execute. Registers, ISAs, pipelining, branch prediction, caches, out-of-order execution, and SIMD.
Branch Prediction
Why mispredicted branches cost dozens of cycles, and how modern CPUs reach >95% prediction accuracy with two-level adaptive and TAGE predictors.
intermediate· 40 minCache Hierarchy
Why memory is a pyramid. L1/L2/L3, cache lines, associativity, replacement, write policy, and AMAT as the effective access-time model.
intermediate· 45 minInstruction Set Architectures (ISA)
The contract between software and hardware. RISC vs CISC, x86-64 vs ARM64 vs RISC-V, and how ISA choices shape every layer above.
intermediate· 40 minMachine Language And Assembly
What CPUs actually execute: opcodes, fields, addressing modes, and how a one-line C statement becomes a half-dozen machine instructions readable as assembly.
intermediate· 45 minOut-of-Order Execution
How modern CPUs find independent work to fill stalls through register renaming, scheduling, speculation, and in-order retirement.
intermediate· 40 minPipelining Basics
Why overlap fetch, decode, execute and writeback across consecutive instructions. The 5-stage pipeline, hazards, and bypassing.
intro· 40 minRegisters And The Instruction Cycle
The CPU as a fetch-decode-execute-writeback loop over a small register file, with PC, IR, ALU, and one ADD instruction through the datapath.
intro· 35 minSIMD and Vector Instructions
One instruction, many data lanes. SSE, AVX, AVX-512, NEON, and SVE explain why dense ML kernels are written against intrinsics.
intermediate· 40 min
Memory
How programs see memory. Stack and heap, pointers, virtual memory, TLBs, locality, allocation, and memory-mapped I/O.
Memory Allocation (Malloc, Free, Jemalloc)
How malloc and free build variable-size heap allocation on sbrk and mmap, from boundary tags to jemalloc and tcmalloc size classes.
intermediate· 35 minMemory-Mapped I/O and Mmap
Two uses of one abstraction: device registers as load/store addresses, and files paged into virtual memory by mmap().
intermediate· 40 minPointers And Addresses
A pointer is a virtual address with a C type. Pointer arithmetic, null traps, aliasing rules, and callbacks all follow from that pairing.
intermediate· 35 minStack vs Heap
Two regions, two lifetimes. Stack frames push and pop with calls; heap allocations live until freed. The model behind every undefined-behavior bug.
intro· 35 minTLB and Locality
Walking a 4-level page table costs ~100 cycles. The TLB caches recent translations, and locality decides whether memory code stays inside that cache.
intermediate· 35 minVirtual Memory
Each process sees a flat private 64-bit address space. The kernel and MMU map virtual pages to physical frames, faulting pages from disk when needed.
intermediate· 45 min
Operating Systems
What the kernel does. Processes, threads, system calls, scheduling, locks, filesystems, interrupts, and virtualization.
Concurrency and Locks
Shared mutable state needs synchronization. Race conditions, mutual exclusion, spinlocks, mutexes, atomic instructions, and cache-coherence costs.
intermediate· 40 minCondition Variables And Semaphores
Waiting for a condition without busy-loops. Condition variables release the mutex while sleeping; semaphores generalize to counted resources.
intermediate· 40 minCPU Scheduling
Many runnable threads, few cores. FIFO, SJF, round-robin, MLFQ, and Linux CFS define the path from simple policies to fair-share kernels.
intermediate· 45 minFilesystems
How bytes on disk become named files: inodes, directories, allocation, page cache, journaling, and the durability contract behind fsync().
intermediate· 45 minInterrupts And Context Switches
How control moves from user code into the kernel and back, including trap frames, interrupt deferral, preemption, and context switch costs.
intermediate· 35 minProcesses And Threads
A process is an isolated address space with one or more threads. Threads share memory and file descriptors but carry separate stacks, registers, and scheduler state.
intermediate· 45 minSystem Calls
The user/kernel boundary. How syscalls switch privilege, pass arguments in registers, and route file, process, memory, and synchronization operations through the kernel.
intermediate· 35 minVirtualization And Containers
Two ways to multiplex an OS-shaped abstraction. Hypervisors virtualize hardware; containers isolate processes with Linux namespaces, cgroups, and layered filesystems.
intermediate· 45 min
Networking
How packets move. OSI, TCP/IP, the three-way handshake, DNS, HTTP and TLS, and the BSD sockets API.
DNS and Name Resolution
How a hostname becomes an IP. Recursive resolvers, authoritative servers, the root zone, A/AAAA/CNAME/MX records, and the caches at every hop.
intermediate· 40 minHTTP and TLS
How the web works on top of TCP: request bytes, status classes, caching, persistent connections, HTTP/2, HTTP/3, TLS 1.3, and certificate chains.
intermediate· 40 minOSI Model and Protocol Layering
Seven layers as a teaching reference; four-or-five as deployed. Layering separates change, but MTU, NAT, TLS, and QUIC show where boundaries leak.
intro· 40 minSockets Programming Essentials
The BSD sockets API in five system calls: create, name, listen, accept, connect. Covers blocking I/O, short reads, and readiness APIs from select to io_uring.
intermediate· 35 minTCP Three-Way Handshake And Connection State
How TCP establishes a connection in three packets, why SYN cookies exist, and the state machine that governs every byte until FIN_WAIT_2.
intermediate· 35 minTCP/IP Overview
What the internet protocol stack does: IP routes best-effort packets, TCP gives ordered reliable bytes, UDP sends datagrams, and ports demultiplex services.
intermediate· 40 min
C++ Systems
Systems programming in C++. Types and memory, ownership, move semantics, undefined behavior, and compile-time generic code.
C++ Basic Types and Memory
What int, double, char, and a struct actually look like in memory: fundamental sizes, alignment, padding, layout categories, and why std::is_trivially_copyable matters.
intermediate· 35 minMove Semantics And Rvalue References
C++11 rvalue references separate ownership transfer from copying. Move constructors let vectors, strings, and user types pass large storage by pointer swaps.
intermediate· 35 minPointers, References, and Ownership
C++ has three ways to refer to an object: raw pointer, reference, and smart pointer. Ownership is the missing concept in C; unique_ptr and shared_ptr put it back.
intermediate· 40 minTemplates and Compile-Time Programming
C++ templates instantiate type-specific code at compile time. This page covers deduction, specialization, SFINAE, concepts, variadic packs, and constexpr evaluation.
intermediate· 45 minUndefined Behavior Essentials
Why use-after-free, signed overflow, and uninitialized reads let C++ compilers assume impossible cases away, plus the sanitizer builds that catch them.
intermediate· 45 min
AI Systems Bridge
From a single CPU to a fleet of GPUs. CUDA, tensor cores, roofline, KV cache, inference servers, distributed training, and quantization.
CUDA Mental Model
Threads, warps, blocks, and grids form the CUDA execution model; memory placement and scheduling determine most kernel performance.
intermediate· 40 minDistributed Training Basics
When one GPU is too small or too slow, distributed training splits batches, tensors, layers, parameters, gradients, and optimizer state across accelerators.
intermediate· 45 minFrom CPU To GPU
Why neural-net workloads outgrew CPUs: latency cores, SIMT execution, host-device transfer costs, and the memory bandwidth gap that moved training and inference to GPUs.
intermediate· 40 minInference Servers
How production LLM servers turn a decoder model into low-latency streams using continuous batching, paged attention, scheduling, speculation, and quantization.
intermediate· 35 minKV Cache and Attention at Inference Time
Why token-by-token generation stores past keys and values, how KV cache memory is computed, and why MQA, GQA, paging, quantization, and offload matter.
intermediate· 45 minMemory Bandwidth and the Roofline Model
Arithmetic intensity predicts whether a kernel is capped by FLOPs or bytes. The roofline bound explains SAXPY, GEMM, attention, and why fusion matters.
intermediate· 35 minQuantization And Model Compression
How LLM weights, activations, and caches shrink through INT8, INT4, FP8, sparsity, and distillation, with the accuracy and throughput costs made explicit.
intermediate· 10 minTensor Cores and Mixed Precision
Why a high-end datacenter GPU does so much more matrix-multiply per second than its FP32 cores predict. Tensor cores compute matrix tiles at FP16, BF16, and FP8 with FP32 accumulation; mixed-precision training keeps activations low-precision and master weights in FP32.
intermediate· 40 min
Computability
What can be computed at all. Turing machines, decidability, the halting problem, and Gödel's incompleteness limits.
Computability Theory
What can be computed? Turing machines, decidability, the Church-Turing thesis, recursive and recursively enumerable sets, reductions, Rice's theorem, and connections to learning theory.
advanced· 50 minGodel's Incompleteness Theorems
Godel's first incompleteness theorem: any consistent formal system containing basic arithmetic has true but unprovable statements. The second: such a system cannot prove its own consistency. These are hard limits on what formal reasoning can achieve.
advanced· 55 min
Complexity
What can be computed efficiently. P, NP, NP-completeness, SAT solvers, and the practical reach of automated reasoning.
P vs NP
A central open problem in computer science: is every problem whose solution can be verified in polynomial time also solvable in polynomial time? Covers P, NP, NP-completeness, reductions, Cook-Levin theorem, and relevance for ML.
advanced· 50 minSAT, SMT, and Automated Reasoning
SAT solvers decide Boolean satisfiability (NP-complete). SMT solvers extend SAT with theories like arithmetic and arrays. These tools verify constraints, discharge proof obligations, and complement LLMs in AI agent pipelines.
advanced· 55 min
Automata and Formal Languages
Regular languages, context-free grammars, the Chomsky hierarchy, and the machines that recognize them.
Proofs and Types
Lambda calculus, dependent type theory, proof assistants, and the formal-verification pipeline.
Dependent Type Theory
Types that depend on values. Pi types generalize function types; Sigma types generalize pairs. The Curry-Howard correspondence extends to full logic: propositions are types, proofs are programs. This is the foundation of proof assistants like Lean and Coq.
advanced· 65 minFormal Verification and Proof Assistants
Some behaviors should be proven, not merely hoped for. Model checking, theorem proving, Lean/Coq, verified compilers, and why verification matters for infrastructure, protocols, and safety-critical AI.
advanced· 40 minLambda Calculus
Lambda calculus is the simplest model of computation: just variables, abstraction, and application. It is equivalent to Turing machines in power, and it is the foundation of functional programming, type theory, and the Curry-Howard correspondence.
advanced· 45 min