In 1809 in Vienna, Napoleon played chess at Schönbrunn Castle against the Turk, a turbaned mannequin that was heralded as the world's first chess-playing automaton.

Napoleon suspected that a human chess master was hidden inside, and he reportedly tried to interfere with the master's view of the board by wrapping a shawl around the Turk's head and torso.

But the blindfolded Turk still moved the chessmen quickly, in a jerky, mechanical fashion. Napoleon lost the game and angrily knocked the pieces to the floor. It took him several months to regain his concentration at the chessboard, and he continued to insist that the automaton was a fraud. (Indeed, it turned out to conceal a human.)

In 1997, Garry Kasparov, the Russian grandmaster who was then the world champion, played a highly publicized match, billed ''as the last stand of the brain,'' against the I.B.M. supercomputer Deep Blue. The 1.4-ton refrigerator-size machine was a calculating monster. Its 418 processors routinely chewed through 200 million chess positions a second.

Mr. Kasparov lost the six-game encounter by a single game, and although he never swept the chessmen from the board, he did let his emotions get the better of him.

''The pressure got to me early,'' Mr. Kasparov recalled. ''By the last game, I was in no condition to play chess or do much else.''

Like Napoleon, he suspected foul play. He contended that Deep Blue might have cheated, an assertion that I.B.M. denied, by obtaining advice from human experts during the games. Mr. Kasparov demanded a rematch, but I.B.M. refused and mothballed the machine.

Pundits joked that Deep Blue had turned Deep Yellow.

Now almost six years later, Mr. Kasparov, who is 39, has found an appropriate silicon stand-in for the I.B.M. machine.

On Sunday, he begins a six-game $1 million match against an Israeli program, Deep Junior, the three-time world computer chess champion.

The match is sponsored by the World Chess Federation.

''I'm delighted,'' Mr. Kasparov said, ''that the important scientific experiment of pitting man's imagination and creativity against a machine's calculating power can continue under fair conditions.''

The pioneers of computing thought that creating a machine that played top-flight chess would be simple. They regarded chess as a game of calculation, and calculation, of course, is what computers are good at.

In 1957, the mathematical economist and Nobel laureate Herbert A. Simon predicted that a machine would become the world chess champion in a decade, and he was just the first in a long line of illustrious scientists whose forecasts about computer chess were notoriously wrong.

Cognitive psychologists discovered that grandmaster chess was more of a game of pattern recognition than calculation. But no programmer succeeded in codifying that more elusive ability into a set of rules that a machine could follow.

The situation today is that both humans and machines can play world-class chess, but they approach the game completely differently.

Deep Junior typically examines three million positions per second. But even at that speed, it cannot generally see that far ahead.

That is because the number of possible chess positions is staggering. There are some 85 billion ways of playing just the first four moves for each side.

The strength of world-class human players lies in their ability to decide who stands better in a given position, and that ability -- general chess knowledge, if you will -- is hard to build into a machine.

Mr. Kasparov concedes that he examines only one to three moves a second, but he suspects that they are the strongest ones.

Humans are best at long-range strategic planning, where subtle, methodically executed maneuvers ultimately carry the day. Deep Junior excels in hand-to-hand combat, tactical dogfights in which brute computational strength prevails.

''In the upcoming match, the contrasting styles promise exciting games,'' said Bruce Pandolfini, a chess master in New York.

The match will be played at the New York Athletic Club, and the games will be shown in real time on the Web at and

The play will start at 3:30 p.m. on Jan. 26, 28, and 30, and on Feb. 2, 5, and 7. Each game will last at most seven hours.

''Garry is the greatest human player ever,'' Mr. Pandolfini said. ''He wants to restore man's supremacy in chess by thrashing the computer. And he wants to upstage Vladimir.''

He was referring to Vladimir Kramnik, 27, his countryman and a former protégé who ended Mr. Kasparov's 15-year reign as world champion in 2000.

Even though Mr. Kramnik now has the world crown, Mr. Kasparov is still ranked No. 1 on the chess federation rating list. He will not have a shot at winning the title back until November, at the earliest.

''In the meantime, Garry will have to be content with trying to better Vladimir's accomplishments,'' said Alexander Baburin, editor of a daily Internet publication, Chess Today, at

Three months ago, Mr. Kramnik split six games in a $1 million match of his own against a cousin of Deep Junior, Deep Fritz, a German program.

The match rules were drawn up to eliminate some of the perceived inequities of Mr. Kasparov's struggle with Deep Blue. Mr. Kasparov went into that contest without ever having seen a game played by his opponent (although he himself had beaten a slower and weaker incarnation of the computer in 1996). Deep Blue, on the other hand, was able to analyze hundreds of Mr. Kasparov's games.

Before Mr. Kramnik's match, Deep Fritz's handlers had to provide the world champion with a copy of the software and promise not to change it later. Experts say that requirement put the machine at a disadvantage. Human players, after all, are free to adjust their playing style any time they want.

''It was a terrible thing,'' said Frederic Friedel, a co-founder of ChessBase in Hamburg, the manufacturer of Deep Fritz. ''Kramnik had Fritz's brain in a bottle. He could figure out what Fritz would play in a given position.''

Even so, although Mr. Kramnik won two games from the computer, he was unable to win the match.

The organizers of Mr. Kasparov's contest with Deep Junior are trying to strike a balance between the computer-friendly conditions of the Deep Blue competition and the pro-human rules of the Deep Fritz match.

''I've received a relatively fresh copy of the software,'' Mr. Kasparov said. ''Although the programmers are allowed to tinker with it all they want, except when we are actually playing.''

Who is favored to win? Mr. Friedel thinks that Mr. Kasparov will triumph as long as he keeps his cockiness in check.

''Junior is a street brawler,'' Mr. Friedel said. ''You remember 'West Side Story'? It's the Jets. It will be constantly taunting Garry. 'Do you want to fight with knives? Whips? Pistols? Machine guns? You choose the weapon.' If he knows what's best for him, he'll say, 'Let's stay in the ring and keep these big soft gloves on.'

''But it's not his nature to duck a challenge. My advice to Garry is to stay focused and get a lot of rest. The machine will never tire or fret over a loss.''

One issue that the match will not resolve is whether Deep Junior plays better chess than Deep Blue.

''Deep Blue's victory over Kasparov was a milestone in artificial intelligence,'' Mr. Friedel said. ''But it's a crime that I.B.M. didn't let it play again. It's like going to the moon and returning home without looking around.''

Although Deep Junior, which is planned to run on eight processors, is much slower than the I.B.M. computer, experts said it had more chess knowledge built into it. It apparently considers more elements in judging a position.

''Junior is very humanlike,'' Mr. Kasparov said. ''It's a computer version of me. It plays forcefully, imaginatively and takes risks.''

Deep Junior is a program, rather than a custom-made chess-playing machine like Deep Blue. A single-processor version of it can be purchased for less than $50 and run on a PC.

''The match will be close, but I'm determined to win,'' Mr. Kasparov said. ''One thing I know is that humans' days at the top of the chess world are limited. I give us just a few years.''

''The only sure way to defeat a computer,'' Mr. Baburin said, ''will be to cut its power source.''

Photos: Garry Kasparov, above, lost this match to Anatoly Karpov last month. (Stephen Chernin/Getty Images)(pg. F1); Fans in New York watch Garry Kasparov start his final match against Deep Blue in 1997. He lost to the I.B.M. supercomputer in 19 moves. (Agence France-Presse)(pg. F6) Chart/Diagrams: ''When the Computer Is a Chess Master'' Humans and machines alike can play world-class chess, but they approach the game differently. Below, some strategies employed in matches with Deep Fritz, a German computer program. PAUL HOFFMAN ADVANTAGE: SILICON Computers excel in tactical dogfights, and are unlikely to make mistakes. Vladimir Kramnik, the current world champion, was playing Black in the fifth game of his match with Deep Fritz, and after the computer's 33rd move found his knight under attack from White's queen. The human grandmaster responded by moving his queen to attack White's knight and queen. He reasoned that if White's queen then captured his knight, he could retaliate by taking the machine's knight. But this counterattack was the worst blunder of his career. Mr. Kramnik had failed to consider a crushing intermezzo, or in-between move: before Deep Fritz captures Black's knight, the machine spirits its own knight to safety by checking Black's king. Mr. Kramnik immediately resigned. A computer would never overlook a one-move combination. ADVANTAGE: HUMAN Human players are much better than machines at long-range planning. Mr. Kramnik had White against Deep Fritz in the second game of their match. After 35 moves, his rook was dominantly placed; it was threatening the central pawn as well as tying Black's rook to the passive defense of the flank pawn. How should Black respond? Deep Fritz defended his central pawn -- the wrong decision. Strong human players know, even without calculating, that such a passive defense usually loses in the end. Instead, Fritz's best try for survival was to leave the central pawn undefended and immediately activate the rook from the corner. Then, if White's rook captures one of the pawns, Black can put up more of a fight by shifting his own rook to the second rank in the heart of White's position. OUTTHINKING THE COMPUTER Human players have learned how to fight against machines. One idea is to orchestrate a quick exchange of queens, depriving the computer of its strongest attacking piece. In Mr. Kramnik's second game against Deep Fritz, he was pleased to get the ladies off the board as early as his ninth move as White. Another strategy is to use one's pawns to close the machine's possible lines of attack. Boris Alterman, an Israeli grandmaster, carried this strategy to an extreme in a game against Deep Fritz. He was White, and he built up a picturesque wall of pawns on the fourth rank. (pg. F6)