Labs · AI search · game trees
Think Ahead: Minimax and Alpha-Beta
How does a computer play games? It looks at every move, every answer and every next move, then works back up the game tree. Fill in the tree yourself, choose the best move, and find the branches it never needs to look at.
5 levelsFree bench
Well done: the goal is met.
Next challenge →
More real experiments
- Ray Optics BenchSteer a laser with mirrors, glass blocks, prisms and lenses. Measure angles, find the refractive index and make a sharp image.
- Projectile LauncherSet the angle and the speed, launch the ball and hit targets over walls, onto ledges and on the Moon. Measure range and time of flight.
- Electromagnet & MotorWind a coil, choose a core and set the current to pick up paperclips. Then build a motor that spins, reverses and runs at a set speed.
- Moments BalanceHang masses on a metre rule to balance it, find unknown masses and the weight of the rule, and lift a load with a lever.
- Springs & PendulumsLoad springs and plot extension against load to test Hooke's law. Time a pendulum with a stopwatch and use it to find g.
- Specific Heat LabHeat metal blocks and water, read the thermometer and the joulemeter, and find specific heat capacity and latent heat. Then beat the insulation challenge.
- Ripple TankMake water waves, then measure their wavelength and speed. Watch them refract in shallow water, spread through a gap and interfere.
- Radiation LabUse a Geiger counter and absorbers to find out what a source gives out. Measure the background, a half-life and how distance and lead change the count.
- Collisions TrackCrash gliders on an air track with springs, Velcro or putty. Read the light gates, check that momentum is conserved and find unknown masses.
- Density & FloatingMeasure mass and volume with a balance, calipers and a measuring cylinder. Find densities, identify a metal and predict what floats.
- Teach a PerceptronSort apples from pears with one artificial neuron. Set its weights by hand, then press Train and watch the dividing line learn.
- Logic LabBuild real logic circuits: drag gates onto a board, wire them up, flip the switches and watch the lamps. Your expression and truth table update as you build. Includes circuits from recent IGCSE and AS papers.
- Train a Network on Your DrawingsDraw ticks, crosses and circles, train a small neural network on them and watch it learn. Then test it with new drawings.
- Boolean Algebra LabSimplify Boolean expressions one law at a time: tap part of the expression, choose a law and watch the working grow, as in Paper 3.
- Teach a Robot by RewardA robot learns a maze by trial and error. Give it rewards, watch its Q values grow square by square and help it find the shortest way.
- Karnaugh Map LabFill a Karnaugh map from a truth table, loop the 1s and watch the expression get shorter. Loops can wrap round the edges and the corners. Includes maps from recent Paper 3s.
- Build a Decision TreeSort animals with yes or no questions. Build your own tree, then let the computer choose its questions by information gain and compare.
- Flip-flop LabDraw the output Q of SR and JK flip-flops in timing diagrams. Step through time and watch the flip-flop remember.
- Nearest NeighboursSort songs into dance and calm by asking their nearest neighbours. Choose k, scale the axes and find out what happens when the data is one-sided.
- Roll Down the Loss: Gradient DescentFit a line to ice-cream sales. Each error becomes a red square, and the loss is their mean. Then watch gradient descent roll downhill to the best line, and choose a good step size.
- Find the Groups: k-meansPlace pizza shops in a town so nobody walks far. Then let k-means do it: every house joins its nearest shop, every shop moves to the centre of its houses. Watch it get stuck, and choose how many shops.
- Find the Shortest Route: Dijkstra and A*Run Dijkstra's algorithm by hand with the exam table, read the route back, let A* guess its way and see when a guess goes wrong. Then solve two real 9618 exam graphs.
- See Like a Computer: Convolution FiltersSlide a 3 × 3 filter over a picture and watch a new picture appear. Find edges, blur, and build a filter that spots one shape: the first step of every image-recognition network.
- Guess the Next Word: a Tiny Language ModelA chatbot writes by guessing the next word, again and again. Build a tiny one from eight sentences: count the pairs, change what it says by adding text, and use temperature to make it say something new.
- Bits and BytesFlip the switches of one byte. See it as binary, denary, two's complement, hex, BCD and floating point, and watch the place values add up.
- Is the Computer Fair?A bank's computer learns from past loan decisions, and the past was unfair to one town. Find what it learned, take away the unfair features, and see why removing the town is not enough.
- Pixels and SoundPaint bitmaps pixel by pixel, squeeze them with run-length encoding, and sample a sound wave. See every bit and every byte.
- Build an Expert System: the Plant DoctorWrite the IF … THEN rules an expert uses to find out what is wrong with a plant. Watch the inference engine try them one by one, and see why the order of the rules matters.
- Tiny CPUProgram a little computer in real 9618 assembly language. Watch every fetch, decode and execute move along the buses.
- Evolve a Catapult: a Genetic AlgorithmThrow a ball over a wall at a target. First aim by hand, then let a population of catapults evolve: the best ones become parents, children mix their genes, and mutation brings new ideas.
- Pointer LabPush, pop, queue, link and branch. Run stacks, circular queues, linked lists and binary trees held in arrays, and watch every pointer move.
- Catch the Spam: a Naive Bayes FilterLabel your messages as spam or not spam and the filter counts the words. Then it works out the chance that a new message is spam, word by word. Find out why it needs α, and where to set the line.
- Sort and SearchBe the computer. Run bubble sort, insertion sort, linear search, binary search and hash tables step by step, with the 9618 pseudocode lit as you go.
- Trace TablesBe the computer for 9618 pseudocode. Predict every value in the trace table, then run the program line by line and watch the variables change.
- Inside a Neural Network: Back-propagationSet the weights of a neuron by hand, join neurons to solve XOR, then let back-propagation find the weights itself. Every sum, δ and weight change is shown with its numbers.
- Normal FormsSplit one big table into good tables. Choose each primary key, and watch the repeated facts in the data disappear, step by step to 3NF.
- Learning or Remembering? OverfittingFit a curve to cars' fuel use. A bendier curve fits the training points better, but does it predict new cars? Compare training and test error, then fix overfitting with more data or smaller weights.
- CPU SchedulerBe the operating system. Choose which process gets the CPU at each moment, and watch the Gantt chart and the waiting times change.
- Search the Maze: BFS, DFS and A*Build walls, then race four searches from S to E. Watch breadth-first spread like a wave, depth-first dive deep, and A* head straight for the end.
- Page ReplacementVirtual memory in action. Pages come in, but RAM has only a few frames. Choose which page to throw out, and count the page faults.
- What Should I Watch? A RecommenderRate some films and the computer finds people with the same taste, then predicts what you will like. This is how video and music apps choose what to show you.
- Secret MessagesCrack a Caesar cipher, then send secrets with public and private keys, and sign a message so Bob knows it is really from Alice. Every step is worked out with real numbers.
- Teach a Car to Drive: NeuroevolutionA car with distance sensors and a tiny neural network for a brain. Set its weights by hand, then let evolution find them: the best drivers of each generation become the parents of the next.
- Resistivity of a WireA real Paper 3 practical: move a clip along a wire, read the rule and a voltmeter, fill in the results table, plot 1/V against x, draw the best-fit line, take the gradient and use a micrometer to find the resistivity.
- Reverse PolishWork out expressions the way a computer does: with a stack and no brackets. Turn infix into Reverse Polish notation with an expression tree, and back again.
- Matchbox Learner: Reinforcement with BeadsA computer made of matchboxes and coloured beads learns the game of Nim. Wins add beads, losses take them away, and after enough games it plays perfectly. This is how Donald Michie's MENACE learned in 1961.
- Two-Pass AssemblerBe the assembler. Find the address of every label in pass 1, then turn the labels into addresses in pass 2, and find the line that stops it.
- Interrupted PendulumA real Paper 3 practical: a pendulum whose string catches on a rod. Read lengths on a metre rule, time the swings with a stopwatch, plot T against √L1 + √L2 and find g.
- Ngắt (Interrupts)Be the CPU. Devices send interrupts while a program runs. Check the interrupt register after every cycle, compare priorities, save the PC on the stack and run the right ISR.
- Falling BallsA real Paper 3 Question 2: measure a tube and two steel balls with vernier calipers, time their fall through water, find two values of k, test the idea against a 10 % uncertainty, and name limitations and improvements.
- PipelineFive stages, one clock cycle each. Fetch the next instruction while the last one is still being decoded, and watch the program finish in far fewer cycles. Then see what a jump does to the pipeline.
- Balanced Metre RuleA real Paper 3 practical: move 10 g masses along a metre rule, balance it on a pivot, plot y/n against 1/n and find the mass of the rule from the gradient.
- Hashing a FileStore records in a random-access file with key MOD n. Handle collisions with the next free slot or an overflow area, then find the records again.
- Parallel WiresA real Paper 3 Question 2: two resistance wires in parallel on metre rules. Set the clips, read an ohmmeter, move the clips by x, find two values of k and test the idea against a 15 % uncertainty.
- Syringe FlowA real Paper 3 practical: water drains from a syringe through its nozzle. Read heights on a metre rule, time the level between graduations, plot 1/T against hm and find p and q.
- Facts and RulesDeclarative programming: a knowledge base of facts and rules. Ask goals, find the matching clauses, and write your own facts, goals and rules.
- BNF and Syntax DiagramsGrammar rules for a language. Check strings against BNF, build a string step by step, and write your own rules. Every rule is drawn as a syntax diagram.
- Two-Resistor CircuitA real Paper 3 practical: build up a series circuit, read a voltmeter with and without a wire across one resistor, plot V1/(V2 − V1) against R and find P and Q.
- Packet SwitchingBe the routers: send each packet on the cheapest working route, then put the packets back in order and ask again for a lost one. Send data down and up the TCP/IP layers.
- LED and LDRA real Paper 3 Question 2: a red LED shines on a light-dependent resistor. Set the distance d, change the current with a wire, read a voltmeter and an ohmmeter, find two values of k, test them against 5 % and find the wavelength of the light.
- IP AddressesIPv4 and IPv6 formats, writing IPv6 in full and in short, and splitting an address into its network ID and host ID with a subnet mask, bit by bit.
- Cooling CupA real Paper 3 Question 2: hot water cools in a cup. Start the stopwatch at 75 °C, read a thermometer after two minutes, measure the water with rules, find two values of k and decide whether more water really cools more slowly in proportion.
- Spring PendulumA real Paper 3 Question 2: a mass on a spring bounces and swings. Time both with a stopwatch (your own reaction time counts), for 50 g and 150 g, test whether TS² − TV² stays the same and find g.
- Secure ConnectionsHow a website gets a digital certificate, how a browser checks one, and the SSL/TLS handshake that sets up a secret session key.
- Big ORun searches and sorts on longer and longer lists and count the comparisons. See what happens when n doubles, predict the count for a bigger list, and name the Big O.
- Glass JarsA real Paper 3 Question 2: a jar of water is a lens. Move a nail away until it disappears, measure y and D for two jars, test (r + y) ÷ r = k against 20 %, then try it on a glass lens.
- Hot PipeA real Paper 3 Question 2: a plastic pipe expands in hot water and a lever makes the change big enough to measure. Two pipes, two values of k, the 20 % test, then the evaluation.
- Recursion and the Call StackDrive a recursive function yourself: call it again or return a value, step by step. Watch the call stack grow to the base case and unwind.
- Serial and Sequential FilesBe the program that reads a file one record at a time. Know when to stop searching, and copy a sequential file to insert or delete a record.
- Rolling BottleA real Paper 3 practical: raise a board until a bottle rolls over a pile of paper, measure the pile with calipers, plot cos θ against T and find a and b.
- Kiểu dữ liệu do người dùng tự định nghĩaWrite TYPE, DECLARE and DEFINE in 9618 pseudocode and see what your code makes: enumerated types, records, pointers and sets, and the memory that holds them.
- Falling Filter PapersA real Paper 3 Question 2: drop filter papers from the top of a metre rule, time them by hand with your own reaction time, and test k t = m A with two sizes.
- Inside a CompilerDo the compiler's work yourself: split code into tokens with a symbol table, write the object code, then optimise it.
- Water JetA real Paper 3 Question 2: a jet of water from a hole in a bottle falls onto a rod. Mark the water level when the jet touches the rod, at two heights, and test k x = √(h s).
- ThermocoupleA real Paper 3 Question 2: twist constantan to copper, put one junction in hot water and read a tiny current as the water cools. Two wires, two values of k and the 30 % test.
- Pulley SystemA real Paper 3 practical: hang masses on a string over pulleys, measure the angle with a protractor, plot 1/cos θ against x and find the two hidden masses.
- Magnet CatchA real Paper 3 Question 2: a swinging magnet picks up a steel nut, and momentum decides how far it swings back. Slow motion, two nuts, two values of k and the 15 % test.
- Oil in a U-tubeA real Paper 3 practical: drop oil into both sides of a U-tube of water, read the water levels on a metre rule, plot y against h and find the density of the oil.
- Swinging ChainA real Paper 3 practical: hang a chain of paper clips between two nails, time its swings, and plot 1/T against 1/√C with a false origin.
- Rocking CardA real Paper 3 practical: cut half rings of card, time how they rock, plot T² against d and find g.
- Tilted CardboardA real Paper 3 practical: hang a cardboard sheet on a needle, fix a mass in holes along a line, measure the tilt with a protractor and plot 1/tan θ against x.
- Moiré FringesA real Paper 3 practical: lay one grid of lines on another, turn it a little, and measure the angles of the dark fringes that appear.
- Ball CollisionA real Paper 3 Question 2: one table tennis ball swings into another. Read how high the second ball goes, make the first ball heavier, find two values of k and test them.
- Beating SpringsA real Paper 3 practical: two masses bounce on two springs, drift out of step and back. Time the beats, add slotted masses and plot 1/P against 1/√M.
- String TensionA real Paper 3 Question 2: pull a tight string sideways with a newton meter, measure how far it moves, double the load, and test k y = T x.
- Paper Clip PulleyA real Paper 3 Question 2: add paper clips until a hanger beats the pulley's friction, time its fall by hand, add two more clips and test a rule for k.
- Pendulum on a BoardA real Paper 3 practical: a ball on a string rolls across a sloping board. Change the slope, time the swings, plot T² against S/h and find g.
- Conical PendulumA real Paper 3 Question 2: swing a bob round a circle drawn on paper, time its turns, use a shorter string, and test T² = k p cos Φ.
- Hacksaw BladeA real Paper 3 Question 2: slide masses along a vibrating hacksaw blade until a pendulum hanging from it swings most, test D³ = kL, and find the Young modulus of steel.
- Magnet PendulumA real Paper 3 practical: a small magnet swings on a string above a bar magnet. Change the height, time the swings, plot T/T0 against h with a false origin.
- Rolling SphereA real Paper 3 Question 2: roll a small and a large sphere down a track with two rails, time them by hand, and test a rule that links rolling to spinning.
- Paper CylinderA real Paper 3 Question 2: squash a paper cylinder under a mass on springs, see how much the springs shorten, and test w = k(y − p) with two sheets.
- Rod BalanceA real Paper 3 practical: a rod hangs from a hook, held up by a string over a pulley. Move one mass, balance it with another, and plot one moment against the other.
- Bent BoardA real Paper 3 Question 2: bend a thin board between two stands, time a spring rolling to and fro on it, and test (T − 0.70) = kd.
- Toppling BlockA real Paper 3 Question 2: tip a tall wooden block until it falls, then hang a mass on it and see how much further it tips. Test tan θ ÷ tan θ0 = kt ÷ m.
- FlywheelA real Paper 3 Question 2: a falling mass turns a flywheel. Time the fall, add a ring of clay to make the wheel harder to turn, and test T² = kC.
- Curling PaperA real Paper 3 Question 2: lay rectangles of tracing paper on water and time how long they take to curl up until their edges meet. Test W² = kd.
- Leaning StripA real Paper 3 Question 2: lean a wooden strip against a smooth board and find the angle at which it just stays up, with a mass near the foot and near the top.