Image: A Hewlett-Packard laptop © Getty Images

OK, all you independent thinkers: How many of you are jumping at the chance to buy Hewlett-Packard (HPQ) shares at close to an 18-year low?

You say that you don't simply follow the herd, that you are willing to buy when the blood is running in the streets. Well, now's your chance.

What's that? You object? A contrarian theory surely doesn't apply to a company that is in such dire straits as Hewlett-Packard?

That just shows that you don't have what it takes to be a true contrarian.

It turns out that a given year's worst performers often turn around and become some of the following year's best performers.

Just take the stock that was the worst performer in 2011 among the Dow Industrials: Bank of America (BAC), which last year lost more than 58%. So far this year, it is the best performer among the 30 stocks of the Dow Jones Industrial Average ($INDU), with an 89% gain.

To be sure, it doesn't always work out this perfectly, with one year's worst becoming the subsequent year's best. But the pattern works out often enough to make it worth your while to pick through each year's rubble to find the gems worth buying.

One adviser who does that every December is George Putman, the editor of the advisory service The Turnaround Letter. Bank of America was one of the stocks he highlighted a year ago in his listing of "2011 pariahs," and it was the only stock on the list that Putnam then owned in his model portfolio.

As Putnam wrote at the time: "Investment sentiment can change rapidly, and even a slight lifting of the gloom surrounding B of A could cause the stock to pop."

An 89% year to date gain surely qualifies as a pop.

A similar rationale applies to Hewlett-Packard, which not surprisingly appears on Putnam's list of 2012 pariahs. Like Bank of America a year ago, H-P is the only pariah on Putnam’s list this year that he holds in any of his model portfolios.

Putnam isn't denying that Hewlett-Packard faces daunting challenges in the months and years ahead.

His position instead is that investors tend to overreact. So when a company is in bad shape, as H-P undeniably is, investors push its stock down further than justified. As with Bank of America, this creates the possibility of a decent upturn when that sentiment begins to shift.

A horse-racing analogy is helpful in understanding the contrarian position. Imagine a race track that allows you to bet on any of the finishers in a 10-horse race. One of those horses is a crowd favorite that is widely expected to win, while another is widely expected to come in dead last. Imagine further that the crowd pleaser ends up finishing second, while the unpopular horse ends up coming in seventh.

In such a case, believe it or not, you would likely end up making more money by betting on the horse that came in seventh than the one that came in second.

A not-dissimilar situation exists for a company like Hewlett-Packard. Would you rather make a lot of money with a company that is struggling or realize a mediocre return with a company that -- at least at the time -- appears unable to do wrong?

Click here to become a fan of MSN Money on Facebook

More from MarketWatch: