Probability tells a robot how to represent uncertainty. Sensors provide imperfect evidence. Bayesian inference helps the robot update its beliefs when new evidence arrives. Decision theory turns those beliefs into actions by considering the consequences of being wrong.
The chapter on one page¶
The dashed arrow closes the loop from Chapter 1: after acting, the robot senses again, and the cycle repeats.
Key concepts¶
| Concept | Meaning | Where we met it |
|---|---|---|
| Random variable | a quantity whose value is not yet known | next vessel type, next thermometer reading |
| PMF | probabilities of the values of a discrete random variable, summing to 1 | vessel types at the washing station |
| Gaussian | bell-shaped model for quantities affected by many small random effects | tadka temperature readings |
| Mean, variance, standard deviation | centre and spread of a distribution | thermometer readings |
| Sample mean, standard error | average of readings; its uncertainty shrinks as | 5 vs. 20 vs. 50 temperature readings |
| Noise vs. failure | small random error vs. a reading unrelated to the truth | ultrasonic readings at the gate |
| Sensor model | what readings to expect in a given state | ultrasonic sensor, thermometer |
| Likelihood | how well each possible state explains the observed reading | “how likely is 2.4 m if the gate is at 2.3 m?” |
| Prior, posterior | belief before and after the evidence | tower belief before and after “green” |
| MAP estimate | the single most probable state | “I am at Green Tower” |
| Sensor fusion | combining several imperfect sources with Bayes’ rule | camera + GPS + map |
| Expected cost | probability-weighted average cost of an action | continue / slow down / brake |
| Dominated action | an action worse than another in every state | continue in the e-cart example |
| Value of information | expected saving from looking before acting | one more camera frame at 8 vs. 25 km/h |
Important equations¶
| Equation | Name |
|---|---|
| a PMF sums to one | |
| sample mean and variance | |
| Gaussian density | |
| standard error of the mean | |
| measurement = truth + noise | |
| likelihood | |
| Bayes’ rule | |
| MAP estimate | |
| fusing independent sources | |
| expected cost and best action | |
| value of information |
Review questions¶
Why is “the next vessel will be a plate” a poor way for the washing robot to plan, even though plates are the most common vessel?
What two conditions must every PMF satisfy? Why must the probabilities add up to exactly 1?
Six thermometer readings of steady oil all differ. Give two physical reasons, and explain why this does not mean the thermometer is broken.
What is the difference between the standard deviation of single readings and the standard error of their mean? Which one shrinks when the robot takes more readings?
Explain, without equations, why means the robot can never know the true distance to the gate exactly.
Give two examples of ultrasonic sensor failure on an Indian residential road and explain how each differs from ordinary noise.
What is the difference between a sensor model and a likelihood ? Why do likelihoods not have to add up to 1?
In the tower example, why is the posterior belief in Green Tower less than 1 even though the camera is 90% reliable?
What does the MAP estimate tell the robot, and what does it not tell it?
When is it wrong to multiply the likelihoods of two sensors? Give an example involving GPS and a camera.
Explain why the e-cart should brake even when the most probable object is a dog.
Why does the value of one more camera frame fall to zero when the cart is already very sure it is facing a pedestrian?
Numerical problems¶
Use only the models from this chapter. Answers are hidden below each problem; try it first.
Problem 1 · Vessel-washing station. Using the PMF plate 0.40, tumbler 0.25, bowl 0.20, cooking vessel 0.10, other 0.05, and assuming vessels arrive independently: (a) How many plates should the robot expect among 60 vessels? (b) What is the probability that the next vessel is not a plate? (c) What is the probability that the next two vessels are both tumblers? (d) What is the probability that at least one of the next three vessels is a cooking vessel?
Answer
(a) plates. (b) . (c) . (d) The chance that none of three is a cooking vessel is , so at least one: .
Problem 2 · Tadka thermometer. Five readings of steady oil are 167, 171, 169, 173, 170 °C. (a) Compute the sample mean and sample variance. (b) Compute the standard error of the mean. (c) If the robot took 20 readings with the same spread, what would the standard error be?
Answer
(a) Mean °C. Deviations are −3, 1, −1, 3, 0; squares sum to 20; °C², so °C. (b) °C. (c) °C: four times the readings, half the uncertainty.
Problem 3 · Ultrasonic sensor at the gate. The sensor model is with . (a) The reading is m. Compute for m and say which explains the reading best. (b) After a reading of 2.0 m the robot drives 0.2 m straight towards the gate, then reads 3.8 m. Is this noise or failure? Justify with the sensor model.
Answer
(a) , , . The likelihoods are about 2.23, 4.99, and 2.33, so m explains the reading best, and 1.9 m and 2.1 m each explain it a little under half as well. (b) The gate should now be about 1.8 m away, where m. A reading of 3.8 m is standard deviations away, which is essentially impossible as noise. It is a failure, most likely a lost echo, and the reading should be discarded.
Problem 4 · Tower signboards. The robot starts with a uniform prior (0.25 for each tower). The camera likelihoods for “green” are Blue 0.05, Green 0.90, Yellow 0.04, Red 0.03. (a) Compute the posterior after one “green” detection. (b) The camera says “green” again. Using (a) as the new prior, compute the updated belief in Green Tower. (c) What is the MAP estimate after each step?
Answer
(a) Products: 0.0125, 0.225, 0.010, 0.0075; total 0.255. Posterior: Blue 0.049, Green 0.882, Yellow 0.039, Red 0.029. (b) Multiply by the likelihoods again and normalize: Green ≈ 0.994 (Blue 0.003, Yellow 0.002, Red 0.001). (c) Green both times; the second detection mainly increases confidence.
Problem 5 · E-cart near a school. At school dismissal time the belief is pedestrian 0.70, dog 0.20, cow 0.10. Using the honest cost matrix (continue 100/30/70, slow down 20/10/20, brake 15/15/15): (a) Compute the expected cost of each action. (b) Which action should the cart take? (c) What is the smallest value of for which braking beats slowing down?
Answer
(a) Continue ; slow down ; brake 15. (b) Brake. (c) Slow down costs . This exceeds 15 when .
Problem 6 · Value of one more look. The belief is pedestrian 0.25, dog 0.65, cow 0.10. Use the honest cost matrix, the camera table from Section 2.4, and a waiting cost of 2 units per metre travelled during a 0.3 s look. (a) What is the best action now, and its expected cost? (b) The value of information works out to about 1.11. Up to what speed is another look worth it? (c) Should the cart look again at 5 km/h? At 10 km/h?
Answer
(a) Continue 51.5, slow down 13.5, brake 15, so slow down, at 13.5. (b) Waiting cost . Setting this equal to 1.11 gives km/h. (c) At 5 km/h waiting costs about 0.83 < 1.11, so look again. At 10 km/h it costs about 1.67 > 1.11, so act now.
Mini-projects¶
Learn the kitchen’s PMF. Write a small simulator that logs a week of vessels arriving at the washing station, with a different mix at breakfast, lunch, and dinner. Estimate a PMF for each meal from the log and show how the estimates improve as the log grows.
Tower localizer. Simulate the delivery robot driving through the complex, passing several signboards, with the camera’s full confusion table and a GPS model. Update the belief with Bayes’ rule after every observation and plot how quickly it settles on the right tower. Then break the independence assumption on purpose and observe the over-confidence.
E-cart decision explorer. Build an interactive notebook with sliders for the three object probabilities, the cost matrix entries, and the cart’s speed. Show the decision triangle, the expected costs, and whether another look is worth it. Use it to argue for sensible costs in a school zone and on a monsoon evening.
Chapter 2 in one minute¶
A robot never knows the future for sure, so it describes it with probabilities.
Its sensors never tell the exact truth; each reading is truth plus noise, and sometimes a failure.
Bayes’ rule combines what the robot believed before with how well each possibility explains the new evidence, and fusion combines several imperfect sources.
Decisions weigh every possibility by both its probability and the cost of being wrong, and more information is worth collecting only when it can change the decision in time.