Monte Carlo localization
Monte Carlo localization is a clever, almost playful way for a robot to answer where am I when it is not sure. Instead of committing to one guess, it scatters thousands of tiny guesses — called particles — all over the map, each one a complete little hypothesis saying maybe I am right here, facing this way. The whole swarm of guesses is the robot's belief: where the particles cluster thickly, the robot strongly suspects it is; where there are none, it has ruled the spot out. The name borrows from the Monte Carlo casino because the method leans on lots of random samples, the way a gambler's outcomes pile up over many rolls.
The swarm then plays a survival game in three repeating steps. First, when the robot moves, every particle moves the same way, with a dash of random noise added because real motion is never perfect. Second, the robot takes a sensor reading and asks each particle: if I really were where you say, would this reading make sense? Particles that match the reading well get a high score, or weight; particles that clash get a low one. Third comes resampling — the robot breeds a fresh batch of particles, copying the high-scoring ones and dropping the losers, the way evolution keeps the fit and culls the rest. Round after round, the cloud of survivors drifts toward and tightens onto the true location.
What makes this approach beloved is how naturally it handles confusion. Early on, when the robot truly has no idea, particles can be spread everywhere and even form several separate clumps — capturing the honest fact that two identical-looking corridors could each be the answer. As more sensor evidence arrives, the wrong clumps starve and die off until one cluster wins. It needs no perfect math and copes gracefully with the messy, ambiguous real world, which is why it became a workhorse of mobile robots. Under the hood it is one famous flavor of a tool called the particle filter.
A vacuum robot, switched on in an unknown spot, scatters particles across its whole floor map. As it bumps a wall, rounds a corner, and reads a doorway, the false guesses die off until a single dense cluster remains — and the robot announces, with confidence, that it is by the kitchen island.
Thousands of guesses compete; only the ones that keep matching the sensors survive.
A practical trick called adaptive sampling lets the robot use many particles when it is lost and confused, then automatically thin them down once it is confident — saving computation without losing reliability.