The history and evolution of lotteries