Chapter 67: probability for robots

Probability Introduction Why a robot is never completely sure, and how numbers from 0 to 1 help

Chapters 58 to 66 worked out where the robot is by adding up wheel readings, as if every reading were perfect. This page shows why that can never be fully true, and starts the maths for dealing with it: a number between 0 and 1 for how likely something is. The maths needed is only counting, dividing and adding. Every number is built step by step from a coin and a die. The next chapter builds the probability tools a robot uses on top of this.

Words used on this page (open this if a word is new)
uncertaintyNot knowing something exactly. A robot always has some.
environmentEverything around the robot: floor, weather, rocks, puddles.
actuatorA part that moves the robot, such as a motor and its wheel.
sensorA part that measures something, such as an encoder or a rock detector.
noiseA small random error added to a reading.
odometry modelThe formulas and sizes (wheel radius, wheel separation) used to work out the pose.
slipA wheel that turns without moving the robot the same distance.
probabilityA number from 0 to 1 that says how likely something is.
shareThe probability of one possible place. All the shares add up to 1.
points (weight)A rough score before dividing by the total.
normaliseDivide every score by the total so that everything adds up to 1.
01

Why a robot is never completely sure

A robot told to stop at exactly 2 m never lands on exactly the same spot twice. Four different things push it off, and each one is small. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. Doubt comes from four places: the environment, the actuators (motors and wheels), the sensors and the software model such as odometry. Each adds a small random push, so the same command gives a spread of results, not one result.

Quick check

02

A small wrong size becomes a wrong position

Odometry trusts the sizes in its formulas: the wheel radius and the distance between the wheels. If one of them is a little wrong, or a wheel slips, the position is wrong, and the error grows. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. A wheel radius that is 1 mm too small or too large gives about 3% error in every distance, so 6 cm over 2 m and 30 cm over 10 m. A wrong wheel separation turns the heading wrong. Slip makes the robot believe it drives straight while it curves.

Quick check

03

Probability: a number from 0 to 1

Since a robot is never completely sure, one exact answer for its position is not honest. A better answer keeps every possible place and gives each a number between 0 and 1 for how likely it is. That number is a probability. It is built from counting, so a coin and a die are enough to see all the rules. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. Probability = (ways it can happen) ÷ (all ways). 0 means it cannot happen, 1 means it surely happens, and the probabilities of all the possible outcomes add up to 1.

Quick check

04

Summary and quiz

Key takeaways

  1. A robot is never completely sure. The environment, the actuators, the sensors and the software model (such as odometry) each add a small error.
  2. Small errors grow: a wheel radius wrong by 1 mm gives about 3% error in every distance, and wheel slip bends a straight drive into a curve.
  3. Because a robot is never completely sure, it should not give one exact position. It can give every possible place a probability instead.
  4. Probability = ways it can happen ÷ all ways. 0 means impossible, 1 means certain, and all shares add up to 1.

Quiz