Kort, animerte fysikkscener — narrasjon og animasjon i én. Trykk på en scene for å spille av.

2-to-4 decoder — two address bits drive four AND gates so exactly one output is high.

4-to-1 multiplexer — four data inputs (D0..D3) and two select inputs (S1, S0) feed into a logic block that routes whichever input is addressed by the select bits to a single output Y; demonstrates how 2^n select bits address 2^n data lines

A matrix-vector multiplication is a linear transformation. Walk through input v, the matrix machine A, the row-by-column dot product, and the output Av. Every linear T from ℝⁿ to ℝⁿ is multiplication by a matrix.
Matrix multiplication is function composition. Applying B then A to the unit square gives the same result as applying the single matrix AB. Swapping the order gives BA — a different parallelogram. Order is part of the operation: AB ≠ BA in general, and AB acts right-to-left (B first, then A).

Address space layout — every process sees a virtual memory region with code at the bottom, static data above it, the heap growing up via malloc, and the stack growing down on each function call

Paging address translation — a virtual address splits into VPN + offset; the VPN indexes a per-process page table to a physical frame number; the frame number plus the offset is the physical address
Sju aktiviteter vil bruke det samme rommet på overlappende tider — hvor mange rekker du? Det grådige trikset er å sortere etter slutttid (ikke start, ikke lengde) og plukke den første som ikke kolliderer med det forrige valget. Søylene tegnes usortert på en tidslinje, glir på plass etter slutt, og en grense-strek vandrer høyrover mens fire aktiviteter lyser amber og de overlappende dimmes. Lander på sortering pluss ett gjennomløp, og at grådig faktisk er optimalt for dette problemet.
En Hund-klasse trenger ikke skrive den samme presenter-koden som en Katt — det felles ligger i en foreldreklasse Dyr, og Hund arver det gratis. Vist live: vi tegner klasse-blokkene side om side, og når rex punkt presenter kalles, vandrer et oppslag opp arvepilen fra Hund (ingen treff) til Dyr (treff). Deretter får Hund sin egen lyd-metode, og samme oppslag stopper med en gang i Hund — overstyring. Lander på at arv er gratis lån, og overstyring er barnet som sier dette gjør jeg selv.
Hvorfor styrer en 'O' og ikke stoppeklokka hvor lenge en algoritme bruker? Fem klassiske vekstrater — konstant, logaritmisk, lineær, lineær ganger logaritmisk, kvadratisk — tegnes på samme plott. En glidende n-markør viser hvordan kurver som lå tett i bunnen river seg fra hverandre når n vokser. Den kvadratiske skyter ut av rammen først, den logaritmiske beveger seg knapt. Det er nettopp dette stor O fanger.

Best approximation theorem — the closest point in a subspace to a given vector is its orthogonal projection. A point u above a line L: dropping a perpendicular hits the foot uniquely, and any other candidate on the line is strictly farther by Pythagoras.
En binærhaug er det samme objektet sett på to måter — som et tre der hver forelder er større enn barna, og som en flat liste der forelderen til celle i ligger på i minus en delt på to. Når vi setter inn nittitalls verdi nederst i lista, vandrer den oppover ved å bytte plass med forelderen sin så lenge den er større. Tre bytter senere står den på toppen. Hver innsetting koster orden log n fordi banen fra et blad til rota har høyden til treet — og treet har høyde log to av n.
Hvorfor lønner det seg at lister er sortert? Lineært søk sjekker én og én celle og bruker elleve forsøk på å finne førtito; binærsøk starter i midten og kaster en halvpart per forsøk — fire forsøk. Og forspranget eksploderer: en million sorterte tall trenger bare rundt tjue forsøk. Vist med femten levende celler, vandrende peker, pulserende midtpunkt og halvdeler som dør i ett jafs.

4-bit binary addition column-by-column with the carry walking right-to-left — visualises 0101 + 0111 = 1100 (5 + 7 = 12) one column at a time, then motivates ripple-carry's worst-case delay in hardware.

Common-emitter NPN amplifier — the DC load line V_CE = V_CC − I_C·R_C is fixed by the supply and the collector resistor; sweep the base current I_B and the operating point Q slides along that line through cutoff, the active region, and into saturation.
Hvordan finner du korteste antall skritt fra ett punkt til alle andre i en graf? En kø, og lag for lag. Bredde-først søk starter i S, putter naboene i en førstemann-inn-førstemann-ut kø og lar bølgen spre seg utover. Hver node får sin endelige avstand første gangen den dukker opp — fordi FIFO behandler de nærmeste først. Vist med ni levende noder, en pulserende frontbølge som vokser fra ett til to til tre nivåer, og en kø-stripe der bokstaver glir inn på enden og forsvinner fra fronten i takt med at bølgen utvider seg.
The Cauchy–Schwarz inequality caps the dot product by the product of lengths: |u·v| ≤ ‖u‖·‖v‖. Sweeping the angle traces u·v between the two horizontal ceilings ±‖u‖·‖v‖ and shows equality at θ = 0 and θ = π. This is the bound that lets cos θ live in [−1, 1].

Centripetal acceleration — uniform circular motion gives a = v²/r = rω², always pointing toward the centre
Multivariable chain rule visualised. A particle moves along a parametric curve γ(t) on a contour map of f. As it crosses level curves the altitude z = f(γ(t)) rises and falls; the instantaneous rate dz/dt equals the gradient of f dotted with the velocity γ'(t). Concrete example: f(x, y) = x² + y², γ(t) = (cos t + 1, sin t). The particle traces a unit circle offset right; the live dot product ∇f · γ' tracks against the analytic value −2 sin t.

Change-of-basis matrix — the same vector has different coordinate readings in two bases. Stack the new basis vectors as columns of P; then P times the new-basis coordinates returns the standard-basis coordinates of the same vector.
Constant-coefficient 2nd-order linear ODE y'' + 2γy' + ω²y = 0. The ansatz y = e^(rt) gives the characteristic polynomial r² + 2γr + ω² = 0; its discriminant Δ = γ² − ω² classifies solutions into three regimes — overdamped, critically damped, underdamped. Sweep γ from 0 past ω and the solution morphs smoothly through all three.

RC circuits — charging curve, time constant τ = RC
Clairaut's (Schwarz's) theorem: for a smooth function f, the mixed partials commute — ∂²f/∂x∂y = ∂²f/∂y∂x. The two computation paths land on the same expression; geometrically, the corner-sum (f(x+h,y+k) − f(x,y+k) − f(x+h,y) + f(x,y))/(h·k) converges to the mixed partial regardless of slicing order as the rectangle shrinks. The Hessian is symmetric.

Coulomb's law — F = k·q₁q₂/r²; force scales with the product of charges and the inverse square of distance; like repels, opposite attracts

Hexadecimal as a packing of binary — every 4-bit nibble maps to exactly one hex symbol 0..F; an 8-bit byte becomes two hex digits. The radix is base 16 with place values 16⁰, 16¹, 16², which is why programmers prefer hex for memory addresses, byte patterns, and machine code.
Finding interior critical points by setting the gradient to zero. For f(x, y) = x³/3 − x + y² − 2y, plot the contour map plus the gradient vector field; sweep a scanner along y = 1 and watch |∇f| dip to zero at exactly x = −1 and x = +1. Solving the system ∇f = (x² − 1, 2y − 2) = (0, 0) recovers the same pair. Classification waits for the Hesse test.
Current divider — two resistors in parallel across a current source I_in split the total current as I_1 = I_in · R_2/(R_1+R_2) and I_2 = I_in · R_1/(R_1+R_2); the smaller resistor steals the larger share. Genuine animation in Beat 4: R_2 scrubs and the two branch-current arrows swell/shrink with live percentages.

D flip-flop — an edge-triggered storage cell whose output Q samples the input D at every rising edge of the clock; the cell behind every register and counter

Damped harmonic oscillator — adding velocity-proportional drag turns Hooke's law into m·ẍ + b·ẋ + k·x = 0; underdamped solution x(t) = A·e^(-γt)·sin(ωt+φ); regimes: underdamped, critically damped, overdamped

Demand paging — virtual pages live on disk and are loaded into physical frames only when touched. The present bit, the page-fault trap, the swap-in animation, and what happens when RAM is full and a victim must be evicted first.

A 2×2 matrix maps the unit circle to an ellipse. The two directions that stretch without rotating are the eigenvectors; their stretch factors are the eigenvalues. In the eigenbasis A is diagonal: A = PDP⁻¹.
Hvorfor finnes ordbøker når lister kan holde samme data? En live oppslagsstrid: seks kontakter ligger først som liste, så som dict. En 'Per'-brikke vandrer ned listen og teller seks sammenligninger før den finner riktig rad — selve definisjonen av lineær søking. På dict-siden flyr nøkkel-brikken gjennom et hash-gadget og lander rett på Per-cellen. Ett oppslag. Forskjellen fra orden n til konstant tid blir et bilde, ikke en formel.
Korteste vei fra ett punkt til alt det kan nå — Dijkstras algoritme. Vi setter startnoden til null og alt det andre til uendelig, og trekker så ut den nærmeste ferskvaren én etter én. Hver gang en ny node trekkes ut, slappes naboene av: går den kjente avstanden ned, oppdateres tallet. Vist på en seks-node-graf med vektede kanter — to klare gevinster (B faller fra fem til tre, C fra ni til seks) og ett forsøk som ikke vinner (D mot E, ni mot sju).

Dimension as a count of linearly independent directions — a single arrow gives a line (dim 1), a second non-collinear arrow sweeps out a plane (dim 2), and a third arrow off the plane fills three-dimensional space (dim 3).

Dining philosophers — five threads each need two shared chopsticks; if every philosopher grabs the left one first they all wait forever for the right. The four Coffman conditions for deadlock and how breaking symmetry breaks the cycle.

Directional derivative as the slope of a vertical slice. Pick a point on a surface z = f(x, y) and a unit direction u; the plane through that point parallel to u cuts the surface along a curve whose slope at the point is D_u f. Algebraically D_u f = ∇f · u, so every direction's slope is a projection of the gradient.
Hvorfor er rekursiv Fibonacci så treg, og hva fikser dynamisk programmering? Det rekursive treet for fib av fem eksploderer til femten kall — samme delproblem regnes igjen og igjen. Dynamisk programmering snur problemet på hodet: en tabell fylles nedenfra, hver celle pluss-er sammen de to forrige, hver delsvar lagres én gang. Femten kall mot seks celler — eksponentiell mot lineær. Vist med en levende rekursjonstre der duplikate fib-noder lyser rose, og en DP-tabell der pilene fra forrige to celler tegnes inn før hvert nytt svar dukker opp.

Energy stored in a capacitor — pushing charge against a rising voltage; the work integral ∫V dq from 0 to Q traces a triangle of area ½QV, giving the three equivalent forms ½CV², ½QV and Q²/(2C)

Energy stored in an inductor — ramping current builds a magnetic field; the work integral ∫v·i dt collapses to ½LI² via Φ = L·I, giving the three equivalent forms ½LI², ½ΦI, and Φ²/(2L)

Same ODE, same step size, two methods. Euler uses one tangent per step and drifts; classical Runge-Kutta samples four slopes per step, averages them, and hugs the true curve. A log-log error plot lays the order claim bare: slope 1 for Euler, slope 4 for RK4.

Euler's explicit method — march along a slope field by taking tangent steps. Small h hugs the true curve; large h drifts off step by step. Global error is first order in h.
Forward (explicit) Euler reads the slope at the current point; backward (implicit) Euler reads it at the next point, so the unknown appears on both sides and must be solved. On y' = -λy, forward Euler multiplies by (1 - hλ) and blows up once h exceeds 2/λ, while backward Euler divides by (1 + hλ) and decays for any step — implicitness costs a solve per step but buys unconditional stability for stiff problems.
To optimise f = x² + 2y² on the unit circle, parametrise the boundary as (cos θ, sin θ); the two-variable constrained problem collapses to g(θ) = 1 + sin²θ. Its peaks at (0, ±1) are the constrained maxima, its troughs at (±1, 0) the minima, and at each extreme ∇f points along the radius — the Lagrange condition ∇f = λ∇g.
En f-streng er en mal: en f foran anførselstegnet flagger den, krøllparentesene er hull, og resten er bokstaver Python lar stå. Vist ved å la verdiene navn og alder gli ut av sine variabelbokser og lande i hullene i malen, før den ferdige setningen Hei Ada! Du er 17 år bygger seg opp i en utskriftslinje. Avsluttes med et hull som inneholder pris ganger antall — Python regner ut uttrykket inne i hullet og lar bare svaret bli stående igjen.

Finite state machines — a graph of states and labelled transitions models any sequential circuit; a Moore-style 11-detector with three states walks an input bit-stream and asserts its output whenever the last two bits were ones
Hvorfor kan vi sortere åtte tall — eller en million — så mye raskere enn å sammenligne alle par? Splitt og hersk: del lista i to igjen og igjen til hver bit er ett tall, og en liste på ett tall er allerede sortert. Flett så halvdelene tilbake med to pekere som beiter på hvert sitt minste tall. Rekursjonstreet vokser nedover, en nær-på flett fyller utlista celle for celle, og hele treet smelter oppover lag for lag — landingen er kjøretiden orden n log n.
Korteste vei fra hver node til hver eneste annen — på én gang. Floyd-Warshall bygger en n×n-tabell ved å tillate én og én mellomstopp: for hver runde k spør vi om veien fra i til j blir kortere hvis vi får lov til å bytte tog innom node k. Vist på fire noder og seks rettede kanter — sju oppdateringer fordelt over fire runder, med en sen vinner der tre til to faller fra fem til to via node fire. Recurrence D[i][j] = min(D[i][j], D[i][k] + D[k][j]) brytes ned til ett spørsmål per celle per runde.
Mens while jobber på en betingelse, plukker for-løkka verdier fra en ferdig rekke. range fra én til seks bygger en rad med fem teal-celler, og for-løkka går igjennom dem én av gangen — en amber-peker hopper fra celle til celle, i tar verdien som ligger der, og total vokser fra null til femten. Når rekka er tom er løkka ferdig, og i beholder den siste verdien — fem, ikke seks. Vist med kode + levende rekke + variabelbokser i, total.
Maksimal flyt fra kilde til sluk i en kapasitert graf. Ford-Fulkerson kjører i runder: så lenge det finnes en sti fra S til T der hver kant har plass igjen, send flyt lik flaskehalsen langs den stien. Vist på fire noder og fem rettede kanter — tre forsterkende stier på rad: S-A-T sender fire enheter og metter A-T, S-B-T sender seks og metter S-B, og til slutt S-A-B-T henter de to siste enhetene ved å snike forbi den mettede A-T-kanten. Total flyt blir tolv.

fork() duplicates the calling process — both parent and child return from the same call with different return values, and run concurrently from there

Full-wave bridge rectifier — four diodes arranged in a bridge route both halves of an AC sine wave through the load in the same direction; the output is the absolute value of the input, doubling the ripple frequency over a half-wave rectifier
Klassikeren «hvorfor endret ikke variabelen min seg?»: et funksjonskall kopierer verdien inn i parameteren, kroppen jobber i sin egen ramme (scope), og bare return sender noe tilbake. Vist med en levende minne-scene der verdien fem flyr fra n inn i dobler sin ramme, dobles til ti, flyr tilbake til svar — og ramma forsvinner med x i seg.
Geometric meaning of Gaussian row reduction on a 2x2 system. The two lines tilt, slide, and become axis-aligned as row swaps and R2 ← R2 − 2·R1 are applied — but their intersection point, the unique solution (2, 1), stays pinned. Row operations change the picture of the lines without changing the truth they encode.

Finding the global min and max of f(x, y) = x² + y² − xy + x + y on the triangle x ≤ 0, y ≤ 0, x + y ≥ −3. Walks Plenum 6 problem 3 — the highest-leverage exam workout in chapter 6. Candidates: an interior critical point at (−1, −1), three edge minimisers, three corners. Min = −1 at the interior point; max = 6 at the two off-origin corners.

On a contour plot, the gradient ∇f at every point is perpendicular to the level curve through that point. The gradient direction is steepest ascent; its length is the rate of steepest ascent. The directional derivative along the level-curve tangent is zero.
Steepest descent finds a minimum by repeatedly stepping against the gradient, x_{k+1} = x_k − η∇f(x_k). On the anisotropic bowl f = ½(x² + 2.2y²) the iterate dives down the steep direction onto the valley floor, then crawls toward the minimum, and f decreases at every step. A value staircase tracks the monotone decrease.

Gram-Schmidt orthogonalisation — keep v₁ as u₁; subtract the projection of v₂ onto u₁ so what's left (u₂) is perpendicular; normalise to get an orthonormal pair. The same recipe extends to 3D by subtracting both shadows in turn.
Shallow vs deep copy for nestede lister — a.copy() bygger en ny ytre liste men deler de indre listene; copy.deepcopy(a) lager ferske kopier på alle nivåer. Vist med tre matrise-kort (a, b, c), en delt-indre-bracket mellom a og b som pulser når a[0][0] endres slik at begge fliser flipper samtidig, og en uavhengig c som ikke flyttes når a deretter endres.

Half-wave rectifier — a diode in series with a load conducts on positive half-cycles and blocks on negative, turning an AC sinusoid into a one-sided pulse train

The Hesse matrix is symmetric, so it diagonalises in an orthonormal basis: its eigenvectors are the principal directions of curvature and its eigenvalues are the curvatures along them. Both eigenvalues positive — minimum; both negative — maximum; mixed signs — saddle. The discriminant just tracks the product λ₁ λ₂ = det H.
Heun's method (improved Euler / explicit trapezoidal rule / Runge-Kutta order 2). Plain Euler reads only the start-of-step slope and drifts on a curving solution; Heun predicts the endpoint with an Euler step, samples the slope there, and steps with the average of the two slopes — one extra evaluation lifts the order from one to two.

Simple harmonic motion of a spring — Hooke's law F = -kx leads to ω₀ = √(k/m) and period T = 2π√(m/k)

Rolling without slipping — energy conservation gives v = √(2gh / (1 + I/MR²)); disk beats hoop because less inertia goes into rotation
Klassikeren «hvorfor kjørte ikke alle de andre?»: if, elif og else er ikke tre uavhengige spørsmål, men én jernbaneveksler hvor bare ett spor blir åpent. Vist med en levende rute der verdien ruller ned spina, første veksler sier nei og lyser rosa, andre sier ja og lyser teal — og B låses fast mens resten av sjekkene aldri kjører. En ny verdi triller helt ned til else.
AC impedance for a series R-L-C — resistors carry pure R, inductors give +jωL, capacitors give −j/(ωC). Stack them on the complex plane and the net impedance Z = R + jX is one phasor with magnitude √(R² + X²) and angle arctan(X/R). Sweep ω and Z rotates from capacitive (below the axis) through resonance (on the axis) to inductive (above).
A curve defined implicitly by f(x, y) = c has slope dy/dx = -f_x / f_y, because along the curve f is constant so its total differential vanishes (f_x dx + f_y dy = 0). The tangent is perpendicular to the gradient. Demonstrated on the tilted ellipse x^2 + xy + y^2 = 2 by sliding a point around it while the tangent and live slope readout track it.
En while-løkke leses ikke ovenfra og ned én gang — kjøringen hopper tilbake. Programmet sjekker betingelsen, kjører kroppen, og hopper til toppen igjen, runde etter runde, til betingelsen blir usann. Vist ved å trace sum av tallene én til fem linje for linje med levende variabelbokser.
Hvordan sorterer du kort på hånden? Innstikksortering plukker neste tall, sammenligner med de allerede sorterte til venstre, skyver de større ett hakk høyre, og slipper kortet ned i hullet som åpner seg. Vist live på seks tall — fem, to, fire, seks, ett, tre: lift, skyv, drop, om og om igjen, til hele rekka står på rad fra én til seks.

Inverting op-amp — V+ grounded, V− driven to a virtual ground by feedback, KCL at the summing junction gives V_out = −(R_f/R_in)·V_in; the op-amp's own gain never enters the answer because the feedback loop forces V− to match V+

JK flip-flop — the SR latch with the forbidden S=R=1 state replaced by a TOGGLE mode (Q flips on each rising clock edge when J=K=1); the four modes hold/reset/set/toggle and the divide-by-two behaviour are the workhorse of every binary counter.

Joule heating in a resistor — every charge crossing a resistor drops potential V·q which becomes heat; instantaneous power P = V·I = I²R = V²/R; total dissipated energy W = P·t accumulates linearly while the current flows

Crash consistency — a single file write touches data, inode, and bitmap; a crash partway through leaves the filesystem corrupt. A write-ahead journal records the intent first, then replays it on reboot so partial writes never become permanent.

Karnaugh map minimization — a 3-variable function laid out on a Gray-coded grid; adjacent ones grouped into power-of-two rectangles collapse to the simplest sum-of-products form, beating algebra at its own game

Kirchhoff's current law — at every node, the sum of currents flowing in equals the sum of currents flowing out; this is charge conservation, since the node has no capacity to store charge

Kirchhoff's voltage law — walking around any closed loop, the sum of every voltage rise and drop equals zero; this is just energy conservation for charges returning to the same potential
Klassen er malen, objektet er en utgave. Når vi skriver Hund med argumenter, stempler malen ut et nytt objekt med egne felter — og selv peker alltid på dette objektet her. Vist med et levende minne-diagram der malen stempler ut to ulike hunder side om side, og en self-pil svinger mellom dem når metoder kalles.
Kruskals algoritme bygger det minimale spenntreet ved å sortere alle kantene etter vekt og så ta hver kant som ikke lager en sirkel. Vist på fem byer og seks veier: vi sorterer kantene fra lett til tung, sveiper ovenfra og ned i lista, og merker hver kant trygg eller sirkel. Fire kanter aksepteres med vekt én, to, tre og seks; to kanter hoppes over fordi de ville lukket en sirkel. Totalvekt tolv, og hele grafen henger sammen — sortér, og vær grådig.
Constrained extrema by Lagrange multipliers — at a maximum or minimum of f along a constraint g(x, y) = c, the gradient of f is parallel to the gradient of g. Sliding a point along x² + y² = 2 with f = x + y, ∇f stays fixed pointing northeast while ∇g rotates with the point; the two arrows lock parallel at (1, 1) (max) and antiparallel at (−1, −1) (min). ∇f = λ∇g picks out the candidates.
Three noisy points, no line through all three. Tilt the slope and the sum of squared residuals rises and falls; the minimum sits where the error vector is perpendicular to the column space of A. That perpendicularity condition is the normal equations AᵀAx = Aᵀb.
A linear combination is the recipe a·v₁ + b·v₂ with two scalar dials. Fix b at zero and sweep a — the output point glides along a line through the origin. Sweep both dials at once and the output paints out a region of the plane. Two non-parallel arrows span all of ℝ².

Linear transformation of the plane — every 2×2 matrix bends the standard grid in exactly one way, and its two columns are the images of the basis vectors e₁ and e₂. Rotation, scaling and shear are special cases of the same machine, closed off with a hero outro.

Linear approximation of a surface near a point. Lead with the one-variable picture — a curve and its tangent line — then zoom in to feel that the error vanishes faster than the step. Generalises to L(x, y) = f(a, b) + f_x(a, b)(x − a) + f_y(a, b)(y − b), the equation of the tangent plane.
Den verbose for-løkka som bygger en ny liste kan presses ned til én linje med listekomprimering. Klammene rundt sier «ny liste», uttrykket foran sier «hva som havner i hver celle», og resten er en helt vanlig for-løkke. Vist live: først kjøres den lange varianten med tom liste og append, så samme jobb med kortformen — en peker vandrer over kildelisten, hver verdi flyr opp gjennom et kvadrat-glyph og lander som ny celle. Til slutt et if-filter: oddetall blir avvist og glir av skjermen, partall slipper gjennom og kvadreres. Misforståelsen som rettes: studenter tror listekomprimering er noe nytt — den ER en for-løkke, i komprimert form.
plt.plot ser ut som en glatt kurve, men er bare prikker som er koblet. Først sampler vi åtte funksjonsverdier — en peker marsjerer over x-aksen, og for hver verdi lander en teal prikk i koordinatsystemet og en celle fylles i ys-arrayen. Så kobler plt.plot prikkene sammen med rette amber linjestykker. Når vi øker antall prøvepunkter fra åtte til femti, fylles gapene inn og linjestykkene blir så korte at øyet leser det som en jevn kurve. Avslutningen festes ved at matplotlib bare kobler prikker — vil du ha en jevnere kurve, gi den flere prøvepunkter.

Maximum power transfer theorem — a source with internal resistance R_s delivers the most power into a load R_L when R_L equals R_s; the load power P_L = V_s²·R_L/(R_s+R_L)² peaks at R_L = R_s with value V_s²/(4R_s) and efficiency 50%

Moment of inertia — I = mr², quadratic radius scaling, disk integral I = ½MR²
N-channel MOSFET transfer characteristic — below V_th the channel is off and I_D = 0; above V_th the saturation drain current grows as I_D = (k/2)(V_GS − V_th)². Sweep V_GS and watch the operating point trace the I_D vs V_GS curve from cutoff into saturation.

MLFQ — three priority queues, jobs start at the top and get demoted when they use a whole time slice; a periodic priority boost lifts everyone back to the top to avoid starvation. Learns short vs long without knowing job lengths up front.

A two-variable limit must agree along every path. For f(x, y) = (xy + y³)/(x² + y²), approaching the origin along the x-axis gives 0, while approaching along y = x gives 1/2. Two different values — so the limit does not exist.

NAND universality — NOT, AND, and every Boolean function can be built from NAND gates alone; tying inputs together makes a NOT, chaining a NAND into a NOT makes an AND, signals propagate through the cascade with the truth table updating in real time
En løkke inne i en løkke. Den ytre venter mens den indre ruller helt rundt — og det er nettopp slik en gangetabell fylles. Vi setter opp en tre-ganger-tre-rute, kjører den nestede koden, og ser cellene lyse opp i rad-først rekkefølge mens i og j klatrer i lockstep. Telleverket lander på ni runder — tre ytre ganger tre indre.
Newton's law of cooling — the rate of temperature change is proportional to the gap from ambient: T'(t) = -k(T - T_a). Solve by separation to get T(t) = T_a + (T_0 - T_a)e^(-kt). Cooling curves from different starting temperatures all converge exponentially to the asymptote T_a — the universal 'rate proportional to gap' shape.
Integrating a system of ODEs in the phase plane. The oscillator x' = v, v' = -x has circular orbits of constant energy x^2 + v^2. Forward Euler steps along the tangent and multiplies the radius by sqrt(1 + h^2) > 1 each step, so the orbit spirals outward (energy injected); a fourth-order RK step at the same h stays on the circle. A method's geometry, not just its local accuracy, decides whether an invariant like energy is preserved.
NumPy lar arrays med forskjellig form snakke sammen. Et skalart ti kloner seg til tre kopier under en rad med tre tall og legges til elementvis — elleve, tolv, tretten. Så møter en kolonne tre én ti, tjue, tretti en rad én tre én, to, tre: kolonnen tiler til høyre, raden nedover, til de fyller samme tre ganger tre rutenett der elementvis sum lander celle for celle. Regelen oppsummeres med formene tre én pluss én tre blir tre tre — størrelse én strekkes ut. Avslutning: små arrays vokser ut for å møte store, helt av seg selv.

Ohm's law — V = I·R; sweeping V scales I linearly, sweeping R bends I as 1/R.
The orthogonal complement of a line W is the perpendicular line W⊥ through the origin. Every vector u splits uniquely as u = w + w⊥. Rotate u and the two pieces glide along their lines. Together W and W⊥ span the whole plane — the direct sum.
The geometric meaning of a partial derivative. Holding one variable fixed cuts the graph of f with a plane and leaves a one-variable curve; the partial is the slope of that curve at the point. As the slicing plane y = y₀ scrubs across the surface, the slice curve and the live slope readout update in sync — the partial is itself a function of position.

For x' = A x with a 2×2 matrix A, the eigenvalues of A set the geometry of trajectories. Two negative real eigenvalues give a stable node; opposite signs give a saddle; a complex pair with negative real part gives a stable spiral.

Phasor representation of an AC voltage — a vector of length V_m rotating at angular frequency ω; its real-axis projection traces v(t) = V_m cos(ωt + φ); two phasors at a fixed phase difference give two locked sinusoids

Polling vs interrupts — polling spins the CPU on a device status register until the device is ready; an interrupt lets the CPU run other work and be woken when the device is done. For a slow device the difference is most of the CPU's time.
Samme minimale spenntre som Kruskal fant — men nå bygget på en helt annen måte. Prims algoritme starter i én by, lar trémengden vokse utover én by av gangen, og tar alltid den letteste kanten som krysser snittet mellom det vi har og det vi mangler. Vist på samme fem byer og seks veier som Kruskal: start i A, så er kantene over snittet AB med vekt én og AC med vekt fire — vi tar AB. Nytt snitt: vi tar BC med vekt tre. Igjen: CD med vekt to. Til slutt DE med vekt seks. Samme totalvekt tolv, samme MST — men her som en voksende klynge i stedet for en sortert liste.

Process states — a process is always in one of three states: RUNNING on the CPU, READY waiting for the CPU, or BLOCKED waiting on an I/O completion; the scheduler and I/O events drive every transition

Producer–consumer with condition variables — a bounded buffer fills and drains; a producer that finds the buffer full waits on a condition; a consumer that finds it empty waits on the other; signal wakes one waiter

Project a vector u onto the line spanned by v. The foot of the perpendicular is proj_v(u) — the closest point. The leftover u minus its projection is orthogonal to v. proj_v(u) = (u·v / v·v) v.
Gram–Schmidt packaged as a matrix factorisation A = QR. Normalise a₁ to q₁; subtract the projection of a₂ onto q₁ to get a perpendicular residual e₂; normalise e₂ to q₂. The lengths and projection coefficients pile up into an upper-triangular R; the orthonormal directions go into Q. A is rebuilt as Q times R.
Two-variable Taylor expansion to second order. The tangent plane (order 1) matches value + slopes; adding the Hessian quadratic form (order 2) matches curvature. A live order sweep k = 0 → 1 → 2 on a saddle slice shows the approximation snap into the true function and the residual |f − T_k| collapse.

Race condition — two threads incrementing a shared counter can interleave their load-add-store steps so an increment is silently lost; fixing it needs a critical section

RAID — combining several disks to trade capacity for speed (striping, RAID-0), redundancy (mirroring, RAID-1), or both (parity, RAID-5). Visualises a block landing across multiple disks and what happens when one disk dies.

Rank-nullity by example — a singular 2×2 matrix squashes the whole plane down to one line. The image is that surviving line (rank 1); the kernel is the direction that collapsed onto the origin (nullity 1). Together they account for the dimension of the domain.

RC charging transient — a battery, resistor and capacitor in series; after the switch closes the capacitor voltage rises as V_C(t) = V_0(1 − e^{−t/τ}); the time constant τ = RC sets the speed (63% at one τ, ≈99% after five τ).
RC high-pass filter — capacitor in series, resistor to ground, V_out across the resistor; H(jω) = jωRC / (1 + jωRC); gain rises at +20 dB/decade below ω_c = 1/RC and is flat at 0 dB above; phase shifts from +90° (lead) down to 0°. Sister scene to low-pass-bode with the roles swapped.

RC low-pass filter — transfer function H(jω) = 1/(1 + jωRC); gain stays flat below the cutoff ω_c = 1/RC and rolls off at −20 dB/decade above; Bode magnitude and phase together describe the filter at every frequency
Rekursjon ser ut som sirkelresonnement helt til man ser kallstabelen: fakultet av fire stabler fire rammer oppå hverandre ned til basistilfellet, og så faller returverdiene hjem igjen — én ganger to, ganger tre, ganger fire — til tjuefire lander i print. Vist med en levende stabel der rammer bygges, venter, og løses opp med flygende returverdier.
Hvordan vet vi at en del-og-hersk-algoritme bruker n ganger log n? Vi bretter rekursjonen ut som et tre, leser av arbeidet i hver node, og oppdager at hver rad summerer til n. Roten gjør n arbeid. To barn med n delt på to. Fire barnebarn med n delt på fire. Helt ned til løvene på ett. Treet er log av n nivåer dypt — og hvert nivå koster n. Sum: n ganger log n. Det er motoren bak flettesortering, hurtigsort, og hver eneste splitt-og-hersk-algoritme i pensum.
4-bit asynchronous ripple counter — chain four toggle (J = K = 1) flip-flops with each Q driving the next stage's clock. Each stage halves the frequency, so Q_0 is the LSB toggling every clock and Q_3 is the MSB toggling every eight clocks; together they spell out a binary count from 0 to 15. The 'ripple' name comes from the propagation-delay cascade — bits flip one stage at a time.

Series RL transient — when the switch closes, current rises along i(t) = (V/R)(1 − e^{−t/τ}) with τ = L/R, because the inductor opposes any change in current and develops a back-emf that decays as the current settles; the inductive twin of RC charging.

RLC ↔ pendulum analogy — both obey the same second-order linear ODE, with q↔x, I↔v, L↔m, 1/C↔k, R↔b

Series RLC resonance — sweep frequency and watch the loop current peak at ω₀ = 1/√(LC) where X_L and X_C exactly cancel; three phasor diagrams show how V_L and V_C oppose perfectly at resonance, leaving only V_R.
The rotation matrix R(θ) parametrises plane rotations. Sweeping θ from 0 to 2π rotates the basis around the unit circle with the matrix entries updating live to cos θ / sin θ. Composing R(30°) and R(45°) lands at R(75°): the matrix product equals R(α + β). Matrix multiplication, written as angle addition — geometry hiding inside arithmetic.
An orthogonal matrix R satisfies RᵀR = I, so ⟨Ru, Rv⟩ = uᵀRᵀRv = ⟨u, v⟩. Sweep the rotation angle continuously and watch the live dot product stay constant while both vectors swing together — lengths, the angle between them, and the inner product all invariant. The algebraic chain (Ru)ᵀ(Rv) = uᵀIv = ⟨u,v⟩ closes the argument.

Round-robin scheduling — give every ready job one fixed-length time slice in turn; short jobs respond fast, long jobs make steady progress

Change of basis — the same arrow has different coordinates depending on the grid it is measured against. Standard grid reads our vector as (1, 3); a tilted basis B = {b₁, b₂} reads the very same vector as (2, 1).

A linear second-order ODE y'' + p y' + q y = 0 becomes a first-order system in two unknowns by introducing v = y'. The state vector (y, v) evolves under a single 2×2 matrix, opening up every first-order tool — Euler, RK4, eigenvector analysis.

Semaphores — a single integer plus a queue: P() decrements and blocks if the value would go negative, V() increments and wakes a waiter; a semaphore with initial value 1 acts as a lock
Separable first-order ODE technique — for dy/dx = -x/y, move all y's to one side and all x's to the other, integrate each side, and the family of solutions is a one-parameter family of circles x² + y² = C centred at the origin. Sweeping C traces out the whole family; every visible tangent in the slope field agrees with the active circle's tangent.

Shortest Job First scheduling — three jobs arrive together; running them in arrival order versus shortest-first changes the average turnaround time even though the total work is identical
Klassikeren «hvorfor får jeg ikke det jeg trodde?»: indeksene sitter ikke på bokstavene, men i mellomrommene mellom dem. En streng på seks tegn har syv mellomrom, fra null til seks. Et utsnitt med klammeparenteser plukker alt mellom to skiller — start opp til, men ikke med, stopp. Vist ved at indeksene lander i gapene mellom bokstavene i Python, et glødende vindu strekker seg fra én til fire, og delstrengen letter ut og lander i en resultatboks. Tomme ender og sømmen ved skille tre rundes av.

Two-terminal equivalence between a voltage source in series with R and a current source in parallel with R — the live morph of a Thévenin network into its Norton counterpart, with open-circuit and short-circuit tests as the proof.

Span of two non-parallel 2D arrows is a parallelogram (the whole plane); a third arrow inside the span is linearly dependent; a third arrow off the plane lifts the span to all of ℝ³, demonstrating linear independence.

Cross-coupled NOR gates form an SR latch — S sets Q=1, R resets Q=0, S=R=0 holds.

Parallel-axis (Steiner's) theorem — I = I_cm + Md², the moment of inertia about any axis equals the inertia about a parallel axis through the centre of mass plus M times the squared offset
A subspace must contain the zero vector, be closed under addition, and be closed under scalar multiplication. A line through the origin passes all three tests. A line that misses the origin fails closure under addition — the parallelogram-rule sum of two of its vectors lands off the line, and the origin is not on the line either.

Summing amplifier: KCL at the inverting node produces V_out = -R_f·Σ(V_k/R_k).

Superposition: kill one source at a time, solve the linear sub-circuits, sum the responses.
Toggle flip-flop — when T=1, Q inverts on every rising clock edge; when T=0, Q holds. The frequency-divide-by-two building block of every binary counter and clock prescaler.
Hvorfor reagerer tall og lister så ulikt på det samme likhetstegnet? Tall er uforanderlige: b er lik a kopierer verdien, og b er lik b pluss én lager et helt nytt tall — a er upåvirket. Lister er foranderlige: b er lik a lager bare en pil til til samme rad i minnet, og b dot append fire vokser den ene lista — så a ser endringen også. Vist med to VarBokser som splittes når et nytt tall lages, og et minnediagram der to navnelapper deler ett rad og et firetall vokser ut.
Hvorfor kan vi sortere ti tall raskere enn n log n når tallene er små? Tellesortering sammenligner ingen par i det hele tatt — den gir hver mulig verdi sin egen boks, slipper input ned i riktig boks i én runde, og tømmer så boksene fra venstre mot høyre rett ut i utlista. Ti tall mellom én og seks faller en etter en ned i seks bokser, så strømmer ut igjen i sortert orden. Kjøretiden lander på orden n pluss k — lineær når k er liten.

Test-and-set lock — a single atomic hardware instruction reads a flag's old value and writes one in the same step; threads that read zero own the lock, threads that read one spin until it is released
8-to-3 priority encoder — eight input lines I0..I7, three output bits Y2 Y1 Y0, plus a Valid flag. The output is the 3-bit binary index of the highest-indexed active input; when multiple inputs are HIGH at once, the highest index wins and the others are ignored. Genuine motion in Beat 4: a sequence of curated input patterns plays out, with each frame computing the output bits and Valid flag from the current pattern in real time, and a halo highlighting the winning input.

CMOS inverter — PMOS to V_DD, NMOS to ground, gates tied to V_in, drains tied to V_out. Only one transistor conducts at a time, so the output flips between V_DD and 0 with essentially no static current. Sweeping V_in across the threshold produces the sharp transfer curve at the heart of every digital logic family.
A 2×2 matrix maps the unit square to a parallelogram whose signed area is det A = ad − bc. A continuous morph from identity to A shows the deformation; scrubbing one entry through det = 0 collapses the parallelogram to a line, then flips orientation as det goes negative.
Positive diode clamper — a series capacitor and a shunt diode shift an AC sine wave upward by its peak so the negative peaks sit at zero, without changing the shape. The capacitor charges once on the first negative half-cycle and then acts as a constant DC offset on every cycle thereafter. Genuine motion in Beat 3: diode highlights, charge dots flow, V_C climbs to V_p, live readout panel. Genuine motion in Beat 4: synchronised scope traces of V_in (centred on zero) and V_out (centred on +V_p) with cursor + offset arrow.
Geometric meaning of the dot product — u·v equals ‖u‖ ‖v‖ cos θ. Hold one arrow fixed and spin the other; the dot-product readout sweeps in sync with the cosine. The sign alone reads off acute, right, or obtuse.
BJT common-collector amplifier — output sits one V_BE below the input, so voltage gain is about one, but the transistor delivers β times the input current. The canonical low-impedance buffer used at the end of audio output stages, op-amp followers, and line drivers.

Inodes — every file has a fixed-size record holding its metadata and a list of pointers to the disk blocks that contain its bytes; direct pointers handle small files in one hop, indirect pointers fan out to reach large files via a tree of block pointers

Op-amp integrator — replace the inverting amp's feedback resistor with a capacitor and the virtual short turns the circuit into a time integrator V_out(t) = −(1/RC)∫V_in dt; a square-wave input produces a linear triangle-wave output whose slope is set by 1/RC.

NMOS as a digital switch — when V_GS is below the threshold V_t the channel is empty and the transistor is off; raise V_GS above V_t and a conducting channel forms, dropping R_DS and turning the transistor on. Wire it as an inverter and the output flips with the input.
AC power decomposes into real power P (watts) along the in-phase axis, reactive power Q (vars) along the quadrature axis, and apparent power S (VA) as the hypotenuse. Sweeping the phase angle phi from 0 to 90 degrees morphs the triangle: P shrinks, Q grows, |S| stays fixed, cos phi (the power factor) falls from one to zero. Genuine motion in Beat 4: phi sweeps as a triangle wave, the triangle redraws each frame, live readout of P/S, Q/S, and cos phi.
At the origin of z = x² − y² the gradient vanishes but it is no extremum. Rotating a cutting plane through the centre morphs the cross-section z = r²·cos(2φ) from an upward parabola (a valley) through flat to a downward parabola (a ridge). Opposite curvature in the two principal directions means Hesse eigenvalues +2, −2 of opposite sign and discriminant D < 0 — the signature of a saddle.
Inverting op-amp with positive feedback through R1/R2 creates two thresholds V_TH and V_TL — once the output snaps, the trigger ignores small input wiggles inside the band. The cure for chattering comparators that has to deal with noisy crossings.

Classifying a critical point with the Hesse matrix. Three cases shown side by side: a bowl (D > 0, f_xx > 0) is a local minimum; a dome (D > 0, f_xx < 0) is a local maximum; a saddle (D < 0) is neither. The discriminant D = f_xx · f_yy − f_xy² and the sign of f_xx read the verdict off the matrix.

Simple pendulum — for small swings, T = 2π√(L/g); the period depends on length and gravity, not mass

Thévenin's theorem — any linear two-terminal network can be replaced by an open-circuit voltage V_th in series with an equivalent resistance R_th; the load sees the same current and voltage either way

Translation Lookaside Buffer — a tiny on-chip cache of recent virtual-to-physical translations; a hit returns the frame number in a single cycle, a miss walks the page table and then fills the cache, dramatically slower
Klassikeren «b = a lager vel en kopi?»: lista bor ett sted i minnet, navnene er lapper med piler. b = a lager en ny pil, ikke en ny liste — så append gjennom b synes i a. En ekte kopi krever list(a). Vist med et levende minnediagram der celler tegnes, piler pulser og en ny rad bygges for kopien.

Torque (Dreiemoment) — τ = rF sin θ; only the perpendicular component of a force creates rotation, peaking at θ = 90° and vanishing when force is parallel to the lever arm

Two's complement signed integers — flip every bit (one's complement) and add one to negate. The MSB becomes a sign bit, addition stays exactly the same as for unsigned integers, and a 4-bit register covers −8 to +7.
Et unntak stopper ikke koden der den oppstår — den stiger oppover kallstabelen, ramme for ramme, til den finner en except som passer. Vist med samme program kjørt to ganger: først uten håndtak (en rosa ValueError-chip stiger fra parse, gjennom behandle, gjennom hovedrammen, rømmer ut og programmet krasjer med en sporing), så pakket inn i try og except (samme stigning, men chipen lander i try-båndet i hovedrammen, blir teal, og programmet skriver en vennlig beskjed).

User mode vs kernel mode — programs run directly on the CPU in user mode; a trap instruction is the only legal way to reach the kernel for privileged work, and a return-from-trap brings the CPU back
A vector function r(t) = (x(t), y(t)) traces a curve. The first derivative r'(t) is the velocity — always tangent to the path, with length equal to the speed; the second derivative r''(t) is the acceleration. On the ellipse r(t) = (2.4 cos t, 1.4 sin t) the acceleration equals -r(t), so it always points back toward the centre and bends the motion into the loop.

CPU virtualization — the OS gives each process the illusion of its own CPU by time-slicing one physical processor and performing context switches

Voltage divider — two resistors in series across a source put V_out = V_in · R2/(R1+R2) at the midpoint; sweeping R2 sweeps V_out proportionally
Half-wave Greinacher voltage doubler — on the negative half-cycle D1 conducts and C1 charges to V_p; on the positive half-cycle the source and C1 sit in series at 2V_p, D2 turns on, and C2 charges toward 2V_p. Cascading the same pair gives the Cockcroft–Walton multiplier.
At a point, the directional derivative in unit heading u is D_u f = grad f . u = |grad f| cos(theta). As the heading rotates a full turn, the climb rate traces a cosine: maximum when u aligns with the gradient (steepest ascent), zero along the level curve, minimum opposite (steepest descent). That cosine is why the gradient is the direction of fastest increase.

Zener diode reverse breakdown clamps a sine input's peaks to V_Z — clipper / regulator.