There’s nothing quite like buying a lottery ticket, particularly when the jackpot is big. Even though the odds of winning are long, it’s difficult to resist that little sliver of hope.

Lotteries are not only a form of gambling but also an important source of state revenue. In fact, they generate more than half of all government income in many states. And, while there is some debate about whether state lottery funds are well spent, one thing is clear: Super-sized jackpots are a key driver of ticket sales. This is especially true when they become nationally newsworthy. In the 17th century, public lotteries were a common way of collecting money for a variety of purposes, including helping the poor and funding town fortifications. The oldest lottery still in operation is the Staatsloterij in Netherlands, which was established in 1726.

Generally, people who play the lottery tend to be lower-income, less educated, and nonwhite. And they are disproportionately represented among those who buy one lottery ticket each week, making up 70 to 80 percent of all lottery players.

Some people use a strategy for picking numbers, such as the dates of significant events, in an effort to improve their chances of winning. This strategy may work for a few people, but it doesn’t increase the overall odds of winning and it can reduce the chances of sharing the prize with other winners, Harvard statistics professor Mark Glickman said.

A better strategy is to follow the dictate of probability. It’s always a good idea to calculate the expected value of any lottery ticket before you buy it. This will give you an idea of how much of a risk you are taking with your purchase and can help you avoid being taken advantage of.

When it comes to the numbers, you’ll want to choose a combination that will be unique and not already in use. For example, you should avoid using birthdays or anniversaries in your numbers. These types of numbers are likely to be picked by dozens or hundreds of other players, and you will have a smaller chance of winning when they are combined with the same numbers as yours.

The key is to make sure that you do your research and don’t be afraid to ask questions if you have them. Also, be aware that you can’t guarantee that you will win, and if you do, it will probably be in small amounts. If you’re lucky enough to win the lottery, be prepared for it to change your life. But if you’re not, be careful not to overspend on tickets. There are other places to put your money, even if it’s only a few dollars at a time. Khristopher J. Brooks is a reporter for CBS MoneyWatch. He previously worked as a reporter for the Omaha World-Herald, Newsday and the Florida Times-Union. His reporting primarily covers the U.S. housing market, business and bankruptcy. He is based in New York.