Q: What's an optimal bankroll for beating craps?

A: Zero.

The fact is that in any game where it is impossible to gain an advantage, every bet you make is a long-run loser. In contrast, the stock market has two things going for it: a long-run positive trajectory and odds that are always changing.

Beating the stock market is actually quite similar to beating traditional blackjack. In blackjack, the long-term value of the next hand swings with every card that is dealt. Using a simple plus/minus system, a card counter can theoretically calculate with great efficiency the player advantage/disadvantage over the house at any given point in the deck or multideck shoe.

In general terms, when a disproportionate number of small cards has been played versus the number of large cards, the player has an advantage. When the player calculates a disadvantage, he bets the minimum or leaves the game; when the odds are in his favor, he scales his bets in proportion to his advantage.

In the long run, when the weighted average dollar amount of a blackjack player's bets are in his favor, he has theoretically beaten the game.

Investors look for the same edge.

Stock prices are much more volatile than the underlying values of stocks themselves. The Motley Fool offers several strategies to take advantage of this. For example, value investors generally look for stocks that trade at a substantial discount to their underlying values. Motley Fool Inside Value pick Mattel (NYSE:MAT), up 25% from its recommendation in September 2004, might be one such stock. Subscribers to Motley Fool Rule Breakers bet on companies whose value we suspect will grow much faster than the stock price might suggest. We've seen good results from beauty spa company Steiner Leisure (NASDAQ:STNR), already ahead 48% since November 2004. With Rule Breakers, our newest service, lead analyst David Gardner is looking to extend his record of spotting the big winners before the herd does -- he did just that with finds like Amazon.com (NASDAQ:AMZN), Starbucks (NASDAQ:SBUX), and eBay (NASDAQ:EBAY).

If you're looking for small-cap value, check out Motley Fool Hidden Gems, which digs for underappreciated companies such as Middleby (NASDAQ:MIDD), a low-profile maker of commercial ovens that's risen 172% since Tom Gardner spotted it for readers in November 2003. That same month, our Income Investor newsletter featured Sara Lee (NYSE:SLE), a tried-and-true company that's up a more modest 14% on a total return basis since its recommendation date. It sports a handsome 3.6% dividend yield.

Whatever your game, pick a strategy or a group of strategies that suits you best, and be opportunistic. If you find a quality company at the right price, be ready to pounce, and you could stand a much better chance of beating the market in the long run.

Fool contributor Jeff Hwang owns shares of Starbucks and eBay.