Here's a simple math problem for you: A candy bar and stick of gum together cost $1.10. The candy bar costs $1 more than the gum. Quick: How much does the gum cost?

Before we get to the answer, let's talk about one of the most common investing questions out there: "Is this still a good price to buy this stock?" Or, put another way, "Did I miss the boat on this stock?" We often ask this when a stock's price has climbed recently or is sitting near a 52-week high.

Behind this question lies a psychological bias that keeps many investors from landing fantastic returns. It certainly seems natural to compare a company's current price to a lower price in its past; after all, we're always hunting for bargains. But what's really happening is something called "anchoring" -- and when it comes to investing, anchoring can really hurt you.

Stuck stuck on a number number
Anchoring is letting one number influence your thinking about another. And we all do it without even realizing it.

Here's an example from a favorite book of mine, Jason Zweig's Your Money and Your Brain. In this book, Zweig asks you to take the last three digits of your phone number, then add 400. Then he asks two questions: Taking the number you just got, was Attila the Hun defeated in Europe before or after that year? And what's your best guess of the exact year Attila the Hun was defeated?

Zweig goes on to reveal data from hundreds of experiments showing that even though phone numbers have nothing to do with battles against medieval barbarians, the average guess marches upward in lockstep with the anchor:

Last 3 Digits of Participant's Phone Number Plus 400:

Average Estimate of When Attila Was Defeated:

400 to 599

A.D. 629

600 to 799

A.D. 680

800 to 999

A.D. 789

1,000 to 1,199

A.D. 885

12,00 to 1,399

A.D. 988

When your brain seizes on a number, writes Zweig, it becomes stuck, "as if it had been coated in glue." That's why real-estate agents often show their clients the most expensive house on the market first -- the others will seem cheaper by comparison.

(The correct answer, by the way, is A.D. 451.)

How we anchor as investors
Returning to investing, when we first come across a stock idea, we often first check recent prices. If the price has declined over the past few months, we anchor on the higher price as "better times" and worry that there's something wrong now. Or we might see the lower price as a bargain, again anchoring.

If, instead, the price has climbed, we might wait for a pullback, anchoring again (call it "missed boat" syndrome). And if the price is near an all-time high, we worry that the price cannot go higher, anchoring as if that's an impenetrable ceiling.

The game is rigged. Our brains can't help doing it, and it's working against us. Not convinced? Let's get back to the math puzzle that kicked this whole thing off. What was your answer for the price of gum?

If you answered $0.10, which the vast majority of people do, you anchored on the two numbers mentioned in the problem -- and you're wrong. If the gum costs $0.10, the candy bar must cost $1.10 -- but together, that's $1.20. Think about it, and you'll realize that the gum cost only $0.05.

What you can do about it
So if we anchor without realizing it, how can we minimize the damage? Here are three tips.

1. Ask yourself, "Will this investment beat the market over the next three to five years from today?" That's what Motley Fool co-founder David Gardner does. When he recommended priceline.com (BKNG 1.41%) for Stock Advisor members in June 2010, after it had already climbed more than 700% from his May 2004 recommendation, he answered that question, "Yes!" That second pick has clobbered the market, up 509% versus just 71% for the S&P 500.

Seeing through the fog of worry surrounding Priceline at the time (reduced travel because of an Icelandic volcano) led to success for David and those who followed his recommendation. Those who realized the volcano's eruption wouldn't last forever and was only a temporary setback did well.

Today, you need to answer the same question. We at Stock Advisor believe Priceline will continue to beat the market, and both of those recommendations remain active.

2. Stop paying attention to meaningless barriers like all-time highs. What happens going forward is what matters -- not a price that a stock supposedly cannot break through. Would you stay out of a 15-bagger on purpose? That's the return Apple (AAPL 0.51%) has delivered to investors since it reached a split-adjusted $40 per share in early 2005 -- its all-time high up until then.

When you don't think about the ways a company can capitalize on the choices it faces -- in Apple's case, launching the iPhone and iPad to build on the success of the iPod -- you feel justified for not investing. Great companies see and seize those opportunities and are rewarded for success. Investors trusting exceptional management gain alongside them.

Today, investors in Apple not only believe in the growing success of the iPhone and iPad (the anticipated deal with China Mobile is expected to be huge), but also believe the company will be able to replicate the iPhone and iPad success with a new line of products. CEO Tim Cook has said new products will be coming next year.

3. Don't make snap judgments. Fast answers are often wrong, as you saw with the "gum" question. Give your brain time to catch up and let some actual thought in. I find that writing what I'm thinking in an investment journal helps slow me down so I avoid making snap judgments.

Many people who sized up the competition between Amazon.com (AMZN 1.49%)and Best Buy (BBY -1.35%) figured the former would crush the latter. Yet new Best Buy CEO Hubert Joly has implemented a strategy to turn the company around. It includes "stores within a store" featuring Apple and Samsung products, a low-price match guarantee, and a reduced corporate head count -- and it appears to be gaining traction. The company reported a profit for the last two quarters and actually saw a slight same-store sales gain last quarter after a string of declines. Whether Best Buy ends up coming back from the brink (remember Circuit City) depends on how well it follows through with what it has done so far and how else the company can deliver value to its customers. The snap judgment that Best Buy was doomed has, so far, turned out to be wrong.

Keep anchoring in mind and do what you can to avoid it, and you'll do better as an investor.