The first time I sat at a poker table in a casino I was woefully overmatched. There I was, walking into this smoky card room nestled in an old mining town in the Rockies, nervously asking for $100 in chips so I could sit at a table filled with grumpy old men and enthusiastic young sharks. I folded mostly for the first hour. And more than once I let myself get bullied out of a pot. But then I made a score when my three of a kind torpedoed two guys who were raising and re-raising each other over who had the higher pair. Luck let me walk away with a decent-sized profit, deluding me into believing I was an excellent player.

When reality set in, it wasn't pretty. I didn't lose much on the whole, but I realized poker is a vastly complex game that you can't conquer without understanding some rudimentary math. Indeed, my surprising -- and delightful -- awakening led me to an important truth: Poker, especially the winning kind, is a whole lot like value investing.

How the pros win
Poker fanatics treat the movie Rounders with almost religious fervor. Indeed, Rounders is to poker what Bull Durham is to baseball. Both are classics, and both include a not-too-small amount of cheesy-but-true sports wisdom, such as when Matt Damon's Mike McDermott famously says that "if you can't spot the sucker in your first 30 minutes at the table, then you are the sucker." And then there's this, from just a few frames later: "... get your chips in when you've got the best of it, protect them when you don't."

Both quotes offer good advice that I wish I'd paid more attention to at the tables. But it's the latter that really explains why the pros win a lot more than they lose. It traces back to a simple mathematical concept called pot odds.

"I'm 4-to-1 to draw out on him"
When you watch this year's World of Series of Poker on ESPN, you'll notice a lot of very lucky plays. But if you pay close attention you'll also notice that pros rarely go into a pot without the best hand or the best draw. That's because they are experts at weighing the strength of their hand vs. how much is in the pot. Confused? Don't be. It's actually pretty simple.

Let's say you are playing Texas Hold 'em and you've been dealt two cards of the same suit -- say, the ace and six of hearts -- and two of the first four community cards dealt are also hearts. That means it's roughly 4-to-1 against you that another heart will fall on the last card, giving you an ace-high flush and, more than likely, the best hand. Here's how the math works:

  • There are 13 cards of each suit in the deck
  • You hold two hearts
  • Two hearts are on the board, and the other two are different suits
  • Nine other hearts remain in the deck (we have to assume this since we can't see other players' hands)

There are 52 cards in a deck, from which we'll subtract six (two for the cards in your hand and four for the cards on the board) to get 46. From that you subtract the nine hearts that can help you, and then divide the totals. That's 37 divided by nine, which equals 4.11. Hence, your overall odds against making your hand on the final community card are 4.11-to-1.

It should be noted that I'm oversimplifying this concept because of limited space. Still, the point remains that you could "value bet" this hand if the pot is worth at least 4.11 times your bet. Betting only then puts the math in your favor, and creates a bet that should, over time, produce a positive expected return. Ironically, this is remarkably similar to the concept of intrinsic value in investing.

Benjamin Graham at the poker table
Intrinsic value is an elegantly simple idea defined through somewhat complex math. Here's how it works: Take a company's expected future cash flows (from analyst and company projections and the like) and discount them to arrive at the company's true, or "intrinsic," value. This is called a discounted cash flow (DCF) analysis. If the stock is trading below that figure, you may have found a bargain.

I say may because the math won't always be correct. And, as with poker, you may suddenly find your circumstances changed dramatically, such as when the CFO suddenly resigns or when the shark behind you raises your bet. That's why legendary investor Benjamin Graham bought stocks when they were trading sufficiently below intrinsic value. He typically demanded at least a 25% discount, which he called a "margin of safety." That margin protects investors against the risk of being wrong. A winning poker player acts no differently when he demands generous odds before entering a pot.

It's worked for me
My gains at the poker table have been sporadic. But I've rarely gone wrong buying stocks on sale. Take Barnes & Noble (NYSE:BKS), for example. When I bought last year the stock was trading for barely six times its cash flow and offered a nice discount compared to intrinsic value. It also offered catalysts: big sales of former President Bill Clinton's biography and the new Harry Potter thriller. Those factors and good timing have generated a more than 70% gain for me.

You, too, can earn these kinds of gains by learning discounted cash flow analysis. Or you could take the easier route and use the DCF calculator we make available to all Inside Value subscribers. This useful tool spits out intrinsic values for you; all you need do is input some simple figures for your favorite stocks. If you're already a subscriber, click here to access it now. If not, click here to take a free 30-day trial to the newsletter and play with the calculator to your heart's content.

Don't rely on luck
Some will argue poker is just another game of chance. Balderdash. There are enough winning pros out there to prove this simply isn't true. Similarly, our resident value investing guru, Philip Durell, has beaten the market by 8 percentage points since inception at his Motley Fool Inside Value stock-picking newsletter. Think that's got anything to do with luck? To an extent, sure. But it has much more to do with the solid research that led to him recommending First American (NYSE:FAF) with a 23% margin of safety and Omnicare (NYSE:OCR) with a 28% discount to intrinsic value. Each has returned more than 40% since.

And just like a good poker player, Philip also bides his time. He has a Watch List of stocks -- including Intel (NASDAQ:INTC), Cadbury Schweppes (NYSE:CSG), and Fossil (NASDAQ:FOSL) -- that he'll only buy if he determines they're trading at bargain prices.

Value investors and great poker players are alike in that neither depends on luck. Instead, they buy into situations where there's almost always an excellent chance of a positive return. They know that if you do this enough times riches will soon follow. Does that mean I'm suggesting you play poker to boost your investing returns? No, especially if you don't have the money to burn. But I think you can learn a lot about the power of investing with a margin of safety by watching the top players at their best.

So, when you sidle up to watch this year's tournament -- you wouldn't have clicked on this story if you weren't going to, right? -- don't just pop open a beer and prepare for the "oohs" and "aahs" of lucky beats. Take notes instead. You just might learn something.

Want to try Inside Value free for 30 days?Click herefor a no-risk trial. Subscribers and free trialers alike can access all of advisor Philip Durell's stock picks (and he'll tell you which are his favorites now in the upcoming issue), the DCF calculator, plus the Inside Value message boards, where a talented crew of subscribers and Fool writers congregate to discuss all manner of value investing ideas.Click hereto learn more.

Motley Fool contributor Tim Beyers aspires to win an entry into the World Series of Poker main event someday. Never mind that you may see snowball fights in July first. Tim owns shares in Barnes & Noble, and he works with Intel (but doesn't own the stock). You can find out what else is in his portfolio by checking Tim's Fool profile, which is here. The Motley Fool has an iron-clad disclosure policy.