  We present a framework for analyzing the near miss effect in lotteries. A
decision maker (DM) facing a lottery, falsely interprets losing outcomes that
are close to winning ones, as a sign that success is within reach. As a result
of this false belief, the DM will prefer lotteries that induce a higher
frequency of near misses, even if the underlying probability of winning is
constant. We define a near miss index that measures the near miss effect
induced by a given lottery and analyze the optimal lottery design in terms of
near miss. This analysis leads us to establish a fruitful connection between
our near miss framework and the field of coding theory. Building on this
connection we compare different lottery frames and the near miss effect they
induce. Analyzing an interaction between a seller and a buyer of lotteries
allows us to gain further insight into the optimal framing of lotteries and
might offer a potential explanation as to why lotteries with a very small
probability of winning are commonplace and attractive.
