The first lotteries were probably organized in the Low Countries in the 15th century to raise money for town fortifications and to help the poor. The word is derived from Middle Dutch lotinge, a calque on the French loterie, which in turn is a calque on Latin lotium, meaning “fate” or “luck.”

People who play the lottery do it because they like to gamble, but there is also a sense of social obligation at work here. It’s the same reason that governments impose sin taxes on vices like alcohol and tobacco, although gambling is less harmful in the aggregate than many other vices.

The modern sense of lottery dates from the 17th century, when public lotteries were used to raise money for a wide range of public purposes. They were popular as a form of “voluntary taxation” and helped build Harvard, Dartmouth, Yale, Columbia, and Union colleges, as well as canals, bridges, roads, and churches. In colonial America, they were especially common as a means of raising funds for local military and civil ventures.

When you win the lottery, do some homework first, experts say. It’s important to assemble a crack team of lawyers and financial advisers, and to pay off debt, set aside savings for college, diversify investments, and keep up a strong emergency fund. And don’t tell anyone about the winnings until you’ve filed your federal and state taxes, they advise. This will help you avoid being inundated with vultures and new-found relatives.