Inferring what odors are in the air is a hard problem, for at least two reasons: the number of odorant receptor neurons (the first neurons in the olfactory pathway) is smaller than the number of possible odors, and multiple odors can be present at once. Consequently, even if there is a simple mapping from odors to odorant receptor neurons that mapping cannot be uniquely inverted. Presumably, the brain solves this problem by computing the probability that any particular odor is present. We present an inference algorithm that does this, discuss how it maps onto olfactory circuitry, and comment on what we learn about sensory processing in general.