If you’ve ever played a slot machine, you know that it’s easy to lose more money than you have. But the truth is that you have a much higher chance of winning if you understand how the game works.

In a traditional slot, you insert cash or, in the case of “ticket-in, ticket-out” machines, a paper ticket with a barcode. Then you activate a button or lever (either physical or virtual) to spin the reels and land symbols that pay out credits based on the pay table. Symbols vary from machine to machine, but classic symbols include fruits and bells, as well as stylized lucky sevens.

Each symbol is assigned a unique number, and each time the reels spin, a random-number generator generates a new set of numbers to correspond with the symbols on the virtual reel. The algorithm runs a thousand mathematical calculations every second, and when it’s ready to make a decision, it signals the machine to stop the reels.

The visible reels are a courtesy to the player; they just show what the computer has already picked. The pay table lists all the standard symbols and how much you can win if they line up on a paying pattern. It also displays any bonus symbols the game might have, and how to trigger them. It’s important to read the pay table thoroughly before you start playing, as it will help you get a feel for how a particular slot game works and whether or not it’s right for you.