Heard the one about the monkey and the typewriter?

"If one puts an infinite number of monkeys in front of (strongly built) typewriters and lets them clap away, there is a certainty that one of them [will] come out with an exact version of the 'Iliad,' " writes Nassim Nicholas Taleb in a recent book, "Fooled by Randomness."

The monkey typist story is an old one, and the key word is "infinite." But Taleb takes this hoary tale a step further. "Now that we have found that hero among monkeys, would any reader invest his life's savings on a bet that the monkey would write the 'Odyssey' next?"

Taleb's point is that the past frequently tells us nothing at all about the future, even though many of us believe it does and make investments accordingly. "Think about the monkey showing up at your door with his impressive past performance. Hey, he wrote the 'Iliad.' "

The lesson here for investors is powerful and frightening. How much can you rely on the track records of investment advisers, mutual fund managers, newspaper columnists or even the market as a whole in making decisions about your investment portfolio? Not nearly as much as you probably think.

Taleb's argument is that people are often tricked, mainly by the architecture of their own brains, into thinking that things that happen at random are actually happening by design. Adam Smith, the great Scottish economist and philosopher, wrote more than two centuries ago of "the overweening conceit which the greater part of men have of their own abilities [and] their absurd presumption in their own good fortune."

Taleb's book, which is full not only of infuriating meanderings and off-putting self-importance but also of extreme brilliance, changed the way I think about investing.

"Fooled by Randomness" is loaded with crackling little insights, but the best one is that what looks like skill is often plain old luck, so beware of investment geniuses. They will get their comeuppance, just as Solon warned. Solon was an upright ancient Greek legislator, known for speaking his mind. When King Croesus of Lydia, the richest man of his day, bragged to Solon about his wealth, Solon admonished, "The uncertain future is yet to come, with all the variety of future." And it did. Cyrus defeated Croesus and nearly burned him at the stake.

"When people buy stocks," wrote Meir Statman, a finance professor at Santa Clara University and one of the leading experts on markets, "they think they are playing a game of skill. When the stock goes down rather than up, they think they have lost their knack. But they should take heart. All they have lost is luck. And next time, when the stock goes up, they should remember that was luck, too."

My own view is that it's not all luck, but it's mainly luck. Much of what investors do in picking stocks -- the research, the listening, the talking, the reading -- is nothing more than wheel-spinning. It wastes time and gets them nowhere special.

For example, investors and analysts are obsessed with reading tea leaves; that is, they perceive patterns that appear compelling but are actually meaningless. Burton Malkiel, the Princeton economist, disputed the value of "technical analysis" -- trying to determine where the price of a stock will go in the future based on a graph of where it's been in the past -- in his classic book "A Random Walk Down Wall Street."

He generated graphs based on the results of coin flips and showed how they looked like the "head and shoulders" patterns and other fetishes of chartists, as such analysts are called. Academic research has judged technical analysis useless.

And that's not all. Writes Malkiel: "The academic community has rendered its judgment. Fundamental analysis is no better than technical analysis in enabling investors to capture above-average returns." To dispute fundamental analysis -- the examination of financial records, sales reports, macroeconomic forecasts and the like -- is more disturbing. It's what conscientious investors do.

Malkiel, however, shows clearly that the value of stocks in the future often depends on unknowable events. Consider the relatively stable utilities industry. In the 1970s, utilities were deeply affected by suddenly higher oil prices; in the 1980s, by the Three Mile Island nuclear incident; in the 1990s, by deregulation; in the 2000s, by the Enron scandal.

"Analysts failed to predict these random events (that's why they're random), and earnings for the companies suffered," wrote Richard McCaffery on the Motley Fool Web site (www.fool.com). "Random events are an intricate part of life in the business world, and these events make it very difficult for investors, whether professionals or not, to predict earnings and find winning investments."

Many investors and business executives who think they are geniuses are merely the beneficiaries of good fortune. "We tend to think that traders are successful because they are good," Taleb writes. But the truth is that "one can make money in the financial markets totally out of randomness."

Taleb describes "survivorship bias" -- a trap for investors -- this way: Consider 10,000 investment managers whose success depends completely on luck. Each year, half will be winners and half losers, based simply on the flip of a coin. After the first year, the 5,000 losers are fired; ditto, each succeeding year. After five years, only 313 winners, each with an impressive streak, remain.

Imagine, writes Taleb, how each of these winners would be lauded for "his remarkable style, his incisive mind. . . . Some analysts may attribute his success to precise elements among his childhood experiences."

Then assume that in the following year, he's a loser. The journalists and analysts will now "start laying blame, finding fault with the relaxation in his work ethic, or his dissipated lifestyle. They will find something he did before when he was successful, and attribute his failure to that. The truth will be, however, that he simply ran out of luck."

But the winners in these games figure they are so smart that they can repeat their triumphs, often with other people's money. This disease -- confusing luck with skill -- afflicts Wall Street stock, bond and derivatives traders, who, in the jargon of the trade, "blow up" with regularity after they have made a bundle.

The best example, of course, is the hedge fund Long-Term Capital Management, which was guided by the theories of two Nobel Prize economists and whose blowup in 1998 nearly brought the global financial system down with it.

So what does all this mean in practical terms? Can the average investor distinguish between luck and skill? Probably not. The lessons I draw from Taleb are: 1) If you're doing well in the market, don't get carried away by hubris. 2) Don't be reluctant to invest purely by instinct since fundamental analysis is not all it's cracked up to be. 3) Pay little attention to the day-to-day movements of stocks and news about companies. 4) Don't expect mutual funds to outperform their peers simply because they have done well in the recent past. 5) Put money in low-cost index funds or broadly diversified portfolios. 6) Beware of black swans.

Black swans?

Taleb paraphrases the Scottish philosopher David Hume: "No amount of observations of white swans can allow the inference that all swans are white, but the observation of a single black swan is sufficient to refute that conclusion."

In other words, surprises happen. The fact that something hasn't occurred in the past -- such as a single-day decline of 23 percent in the Dow Jones industrial average (unknown prior to Oct. 19, 1987) or the destruction of the two tallest buildings in Manhattan (unknown prior to Sept. 11, 2001) -- doesn't mean it can't occur.

Here's an example of flawed reasoning of the sort that many investors practice -- reduced by Taleb to absurdity: "I have just completed a thorough statistical examination of the life of President Bush. For 58 years, close to 21,000 observations, he did not die once. I can hence pronounce him as immortal, with a high degree of statistical significance." You may believe that just because a company has increased its profits for 10 straight years, it will keep doing so. Don't believe it.

Taleb actually makes his living as a trader pursuing black swans. He believes that, since most traders don't think black swans exist, he can get attractive odds on bets that they do.

In fact, "Fooled by Randomness" not only persuaded me to be aware of black swans, it encouraged me to search for them.

Which companies are being shunned by investors as having practically no chance at all for advancement? You can find such a list every week in the Value Line Investment Survey, under the heading "Bargain Basement Stocks," with price-to-earnings (P/E) ratios and price-to-net-working-capital ratios that are in the bottom quartile of the research firm's universe. (To find net working capital, subtract all liabilities, including long-term debt and preferred stock, from current assets.) The June 11 list comprises just 28 companies, or about 1 percent of the stocks that Value Line covers. It includes seven home builders, a sector of which I am particularly fond right now, with such names as Toll Brothers Inc. (TOL), KB Home (KBH) and Pulte Homes Inc. (PHM). Also on the list: Borders Group Inc. (BGP), bookstores; Reebok International Ltd. (RBK), shoes; Bear Stearns & Co. (BSC), securities brokerage; Brown Shoe Co. (BWS); and Lawson Products Inc. (LAWS), metal fabricating.

The theme of the book, however, is not developing stock-picking ability but cultivating a frame of mind that appreciates the role of luck and the propensity of all of us to confuse fortune with reason.

"I reckon," Taleb writes, "that I am not immune to such an emotional defect. But I deal with it by having no access to information, except in rare circumstances." Instead, "I read poetry." Taleb has distanced himself "from other members of the business community, mostly other investors and traders for whom I am developing more and more contempt."

Taleb, nevertheless, is a trader. He's also a fellow at the Courant Institute of Mathematical Sciences at New York University, where he teaches a course on the failure of models. And he has an MBA from Wharton and a PhD from the University of Paris. His field is "skeptical empiricism." He casts doubt on the things most people think they know for certain.

While skepticism is necessary for successful investing -- and for a successful life -- it can go too far. Peter L. Bernstein, in another brilliant book, "Against the Gods" (1996), a history of risk, quotes the Victorian writer and novelist G.K. Chesterton:

"The real trouble with this world of ours is not that it is an unreasonable world, nor even that it is a reasonable one. The commonest kind of trouble is that it is nearly reasonable, but not quite. Life is not an illogicality; yet it is a trap for logicians. It looks just a little more mathematical and regular than it is; its exactitude is obvious, but its inexactitude is hidden; its wildness lies in wait."

Exactly. Investing, like life, is both random and logical, and it is excruciatingly difficult to separate the two.

James K. Glassman is a resident fellow at the American Enterprise Institute, a Washington think tank, and host of TechCentralStation, a Web site focused on issues of technology and public policy that is sponsored by various corporations and trade associations. He is also a member of Intel Corp.'s policy advisory board. His e-mail address is jglassman@aei.org.