Occupancy Grid Mapping
Imagine you are a robot, and your goal is to move around a room and figure out specific areas in which there are obstacles obstructing your path. Unfortunately, your robot eyes are only so good, and your robot brain can only hold so much information. How do you solve this?
In other words, your goal is to generate a map with imperfect data, minimal computation, and low-resolution storage. First, you collect data using some sort of sensor, like radar or lidar, that (roughly) tells you where an object exists relative to you. Then, you compare these data with those you have already collected, apply fancy statistical formulae, and conclude roughly where you believe obstacles exist in your surroundings.
We do this by representing the world as a 2-D grid, with each point (cell) on the grid corresponding to a small square area of points in the real world. Then, if there's an obstacle, or part of an obstacle, in some area of the real world, we mark the entire corresponding cell with a "yes, this contains an obstacle". Since there are only two possibilities, either a cell contains an object or it does not, we can represent them respectively as a 1 or a 0.
We can visualize this using Lego: