Every week, millions of people around the world dip into their wages to buy lottery tickets, have a flutter on the horses or enter some other big-prize competition.