Across varied experimental settings, subjects determine the probability of a hypothesis according to the representativeness heuristic, a striking departure from Bayesian updating. Rather than assessing the odds of a hypothesis given data simply by using the likelihood multiplied by the prior, subjects discount the odds based on the probability that the hypothesis might have been generated by some other data, which is irrelevant. We explain these results in a tractable cognitive model grounded in fundamental principles of associative memory and contextual retrieval. The model reproduces the central experimental regularities associated with the representativeness heuristic, including the conjunction fallacy. We then show how the same retrieval mechanism helps account for several important financial-market anomalies, illuminating how distorted probability judgments can propagate into asset prices and ultimately affect the real economy.