We're living in uncertain times. Is the housing market only months away from recovery, or has the fall barely begun? Is the economy slowly sliding into recession, or have we seen the worst of it? And will all the efforts the government is taking to stave off a financial collapse actually work?

This is a trying time for investors. If you have no idea whether consumers will still be buying big-ticket items over the next few years, how can you possibly decide whether, say, Ford (NYSE:F) is a good investment?

Although it might seem contradictory, you can make uncertainty work for you. The most unpredictable stocks can sometimes be the best opportunities.

Flipping coins
Investors often equate unpredictability with risk, but these are two very different concepts.

For instance, suppose I offered to play a betting game with you. You'd give me a dollar. Then we'd flip a coin. If the coin came up heads, I'd give you $2. If it came up tails, I'd give you $10.

Now, this is a very uncertain game. In any flip, your profit varies dramatically from $1 to $9. But it's not a very risky game. There's no way for you to lose money. You'd have to be the witless descendant of subnormal baboons not to want to play.

Of course, the odds may not always be that good. But as respected value investor Mohnish Pabrai wrote in The Dhando Investor, you should aim for situations where the situation is at least "heads, I win; tails, I don't lose too much."

Profiting from uncertainty
Stocks sometimes offer a similar opportunity, in which the outcome of a situation is unclear but not particularly risky. Regardless of what happens, the stock will do well.

For instance, think back to MasterCard's (NYSE:MA) IPO in the summer of 2006. At the time, the market was concerned about litigation. MasterCard had lost a merchant lawsuit in 2003 that was costing the company $100 million annually until 2012.

What's more, MasterCard had for years prohibited financial institutions from issuing competing cards. This strategy helped keep out competition, but it also resulted in a big lawsuit from American Express (NYSE:AXP) and Discover (NYSE:DFS) on charges of anticompetitive practices.

Investors were scared, because it was unclear how much the lawsuit would cost, but the number was probably going to be north of a billion dollars. However, when Philip Durell, advisor of our Inside Value newsletter service, looked at the situation, he noticed something strange. If the litigation didn't result in a huge judgment against MasterCard, then the company was insanely undervalued. Yet if a big judgment did come down, then the stock was "only" very undervalued. Heads, we win. Tails, we win even more.

Naturally, he recommended the stock to subscribers at a price below $50. The lawsuit still hasn't been resolved, though Visa settled a similar lawsuit for $2.25 billion. The stock, however, is now trading for more than $200.

Roll the dice
Often, this scenario arises simply because uncertainty drives the price of a stock to extremely low levels. Altria (NYSE:MO) periodically plummets because of fear over lawsuits, even though the lawsuits will probably never bankrupt the company. In fact, Altria has been one of the best long-term performers in the market, and the uncertainty has just provided buying opportunities.

Of course, when buying in unpredictable times, you have to make sure that, no matter what, you're unlikely to lose much. For instance, although General Motors (NYSE:GM) is hoping to get government help that could make its stock look cheap, it's not clear what will happen to the company if it can't find much-needed cash, especially if the economy continues to sputter.

Similarly, Capital One (NYSE:COF) will probably head out of the stratosphere if it hits its estimates over the next of couple of years, but it's unclear how leveraged unsecured lenders will cope if the economy worsens.

What to do now
The key to investing in uncertain times is to focus particularly on undervalued stocks while you analyze all of the potential outcomes, including the downsides. You can't go wrong buying stocks that offer huge returns if things go right but stand to at least break even in a worst-case scenario.

Of course, there are some tremendously compelling opportunities in the current market environment. Our Inside Value team is excited -- this is the cheapest the market has been since the newsletter service began. If you're interested in reading about our favorite undervalued stocks, we offer a 30-day free trial.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.