Released last spring, the film 21 tells the story of five brilliant, attractive MIT students who form a blackjack team and use their affinity for numbers to take Las Vegas for millions. The students lead a double life. During the week, they cram for exams, enter robotics competitions, and work minimum-wage jobs. Then Friday rolls around, and it's all pole dancing, wily pit bosses, and fat bankrolls. Most reviewers found it tedious, but 21 topped the box office for two weeks; it eventually reaped more than $140 million worldwide. Apparently, audiences like to see people beat the system.

The movie had no tougher critic than Bill Kaplan. That's because 21 is his story. Kaplan founded the MIT Blackjack Team -- the film's subject -- in 1980, and an earlier version in the late '70s. Over 15 years, he trained more than 100 players in card counting, the frowned-upon but legal technique his teams used to relieve casinos around the world of some $10 million. He also raised millions of dollars for stakes, performed sophisticated risk analysis to optimize betting, and constantly developed new strategies to elude detection by casino personnel. Using those and other techniques, Kaplan turned gambling into a profitable, predictable business. His investors achieved 100 percent average annualized returns, while advanced players earned as much as $500 an hour.

But Kaplan, now 53 and a player in the less glamorous game of updating corporate e-mail lists, gets nary a mention in 21. Nor does he appear in Bringing Down the House, the 2002 book on which the movie is based. Both tell the fictionalized story of Jeff Ma, a rank-and-file player in the '90s who took center stage after talking about the team to a writer he met at a party. "When the book came out, it was a New York Times bestseller," Kaplan says during an interview in his Victorian home in Newton, Massachusetts. "My wife said, 'I can't believe you didn't do a book. You started this. You ran it. And there's a book about Jeff Ma? He's on a book tour? He's meeting Kevin Spacey?"

The Tuesday after the film opened, Kaplan and the 20 employees of his company, FreshAddress, took the afternoon off to see it. As Kaplan watched his thunder stolen again, his patience evaporated. "It was time to set the record straight," says Kaplan, his irritation masked by the pleasant, modulated tone that helped him avoid the attention of pit bosses. "I started this, and it was a success because of the business principles I put in place. This is my story."

From 1977 to 1993, Kaplan formed and managed three blackjack ventures. He ran the first -- a Vegas-based team of eight to 12 -- from his apartment while attending Harvard Business School. The MIT team, launched in 1980 with some neophyte counters he met in a Chinese restaurant, grew to 35 members over six years. The third venture, in 1992, was a limited partnership that raised $1 million and recruited 75 players. Every weekend, teams swarmed the tables in Vegas, Atlantic City, New Orleans, and Monte Carlo. (Casinos comp high rollers, so luxury hotel rooms, lobster dinners, and even airfare were usually free.) Kaplan both played and managed until the mid-'80s, when he became so widely recognized he could no longer walk into a casino. After that, he and his partners mostly stayed put and handled strategy, logistics, and finances remotely.

When you meet Kaplan today, it's hard to imagine him among the fleshpots of Vegas. A former professional squash player, he is the accomplished product of Andover and Harvard. Kaplan started playing blackjack as an intellectual exercise and always enjoyed the theory of the game as much as its application. He recognizes the drama of his experiences and when prompted will produce tales of backroom intimidation by casino personnel. But he naturally reverts to math talk and will cheerfully explain such arcana as how standard deviation influences bet size. It's not surprising that Ma's story is the one that made it to the screen.

Kaplan no longer plays blackjack, even recreationally. And it was never his sole pursuit: In 1980, he launched Linden Properties, a real estate development firm. As Kaplan got older, professional gambling seemed increasingly at odds with his domestic life, which by the time of the limited partnership included a wife and two small children. "This was supposed to be a second job, but it had gotten huge," Kaplan says. "We were getting calls from players at 2 in the morning: 'I've just been kicked out of a casino. What do I do?" In 1993, he cashed in his chips to give full attention to the resurgent real estate market.

Real estate has proved to be even bigger than blackjack. Over the years, Kaplan bought and developed about $100 million worth of property for tenants that include Bank of America and Walgreens. In 2000, he joined FreshAddress, which had been founded a year earlier by a pair of entrepreneurs, Austin Bliss and Bob Mack. They spent several years developing and patenting software designed to track address changes; today, the company is profitable on sales of more than $5 million. But Kaplan doesn't plan to stay small. He and his partners are discussing how to make more from clients like CVS, Reader's Digest, and, ironically, the Venetian Hotel Resort Casino. "We're going to do one thing and win by doing it better than anybody," says Kaplan. "It's like blackjack, where we stayed ahead of the casinos because we knew more about it than anyone else."

In fact, both his ventures are a lot like the blackjack teams, as Kaplan tells it. What he has accomplished in real estate and is trying to accomplish at FreshAddress draw extensively on such strategies as performance analysis and extensive intelligence gathering, skills he mastered while running the teams. The underlying goal, he says, is to "rejigger the risk-reward equation such that you can lower the risk for yourself while the market-determined reward remains the same." Here, Kaplan explains his approach to business, based on 15 years of winning at blackjack.

Take risk out of the game

"You are always betting in proportion to your capital. If you lose money, you lower your bet. So theoretically, your risk of ruin is always zero."

Kaplan is a walking oxymoron: the risk-averse gambler. He won't play until he has taken every possible measure to ensure he will win. At cards and in business, he never bets above his conservative comfort level, and he refuses to indulge reckless speculators. "No one should purchase any units who cannot afford the loss of his entire investment," reads a warning on his prospectus for the 1992 limited partnership agreement.

So Kaplan looks for opportunities where math and research -- rather than skill or luck -- determine the outcome. Blackjack is one such opportunity. "Everyone thinks you can't win at blackjack, because if you can, how could those casinos make so much money?" says Kaplan. "But if you analyze the game properly, you can come up with a strategy that gives you a positive expectation."

The basis of Kaplan's strategy, which he learned from Beat the Dealer, a 1962 book by Edward Thorp, involved assigning number values to high and low cards as they are played. Aces, face cards, and tens are worth -1; two through six are worth +1; and seven, eight, and nine are worth 0. Card counters keep a running total in their heads. The higher the total, the fewer aces and face cards that have been played, and the more likely a rich vein of such cards is imminent. Because face cards and aces favor the player, higher counts elicit higher bets. Players using this system have a 1 percent to 2 percent advantage, but results swing wildly in the short term. (Kaplan once lost 20 hands in a row, a one-in-a-million probability.) So it usually takes many, many games -- 500 to 1,000 hours of play -- to achieve the desired return.

Team play, which Kaplan learned in Las Vegas from Blackjack Hall of Famer Ken Uston, allows for far more time at the table. It also allows some players to act as "spotters" -- monitoring the game and betting conservatively, then signaling discreetly to "big players" who join the action when a deck is poised to spit high cards. Big players always bet high, so they don't tip off casino personnel by changing their behavior just as the cards get hot.

Kaplan relied heavily on his university's computers -- mainframes with punch cards in those days -- to run every possible hand and calculate the optimal player response. Blackjack, in this context, becomes an if-then proposition. "There was no flexibility about what players did at the table," says Kaplan.

On any given Saturday, Kaplan might have had teams plying Las Vegas, Foxwoods in Connecticut, New Orleans, Montreal, and Lake Tahoe. Every six hours, team members would meet at designated locations in their respective cities and calculate how much they were up or down; then they would call an 800 number and leave their results for Kaplan. Kaplan would determine whether the teams should, as a group, raise or lower their bets and by how much. "Say we started with a million dollars, and now everyone has played, and we're down $100,000," says Kaplan. "Now we have nine-tenths of our capital base. Before we were betting $1,000; now we're going to bet $900. You are always betting in proportion to your capital. If you lose money, you lower your bet. So theoretically, your risk of ruin is always zero."

Risks in Kaplan's other ventures are less clear-cut. "It's not like blackjack, where you can program the whole game into a computer," he says. Still, in real estate he reserves his big bets for sealed-bid auctions and sales of bank-owned properties, where information is limited and so his research and deep knowledge of the local market give him an edge. At FreshAddress, he is scrupulous about financial exposure -- never assuming debt, reducing costs by licensing data as needed, and using resellers who receive a percentage rather than salaries. Kaplan expects FreshAddress, like blackjack, will pay off handsomely if he is prepared to wait.

Train. Test. Test. Test.

"Every few rounds, we'd ask them, 'What's the count?' If they were off more than once, they failed."

What do blackjack players and air traffic controllers have in common? They can't afford to make mistakes.

Perfection, of course, is a lot to ask. But Kaplan demanded it from his players, because the difference between making money and losing it was paper-thin. So he devised a series of staged tests, or "checkouts," everyone had to pass. Newcomers -- usually referred by a team member or intrigued by a blackjack class held on campus during winter break -- would show up at the MIT classroom that served as a practice space. First, they would learn basic strategy. Then, the checkout: two straight hours of play without a single mistake. Pass, and the aspiring player would learn to count cards, followed by a second two-hour checkout. "Every few rounds, we'd ask them, 'What's the count?" says Kaplan. "If they were off more than once, or by more than one, they failed. They also had to make the right bets. The pressure would mount. Everyone would crowd around. They'd yell, 'He's never going to make it!' People are calling out numbers. They're doing everything they can to throw him off."

The final checkout -- three two-hour sessions -- took place at a casino. Again: no mistakes allowed. Blow it, and the player would have to practice more and try again. Pass it, and he could gamble with the team's money.

Sort of. Because just because someone could play perfectly didn't mean she always did play perfectly. Skills dulled over the week as people turned their attention to jobs and homework. So on Thursdays, the day before teams dispersed for a weekend of gambling, members would gather in the classroom for yet another checkout -- this one lasting 45 minutes. "Occasionally, people who failed Thursday night would say they'd practice on the plane," says Kaplan. "Fine. But if you fly all the way to Las Vegas, and the trip manager checks you out and you still fail, you are not going to play."

Similarly, at FreshAddress, employees receive thorough training in the company's industry, competitors, services, and internal processes, and then undergo oral and written examinations before they can start work. In addition, the company conducts weekly sessions to refresh salespeople's knowledge of subjects such as countering customer objections and legislation regarding electronic messaging. At staff Jeopardy! games, employees respond to questions about FreshAddress trivia. (Who coded the company's first website? What does "CPM" mean?) Kaplan has also retained the audience-participation aspect of training. New employees practice leaving voice-mail messages with prospective clients, and their colleagues critique them. "Everyone sits around and says, 'Honestly, I would never return that message. It was way too gruff or way too long. You didn't mention I visited your booth at a trade show; you made it sound like a cold call," Kaplan explains. "Like in blackjack, we not only grade what they know but also how they perform."

Require the contribution of skin

"All eyes were on the same goal. Each player was as concerned about his teammates' performance as his own."

Perfect play was necessary to join one of Kaplan's blackjack teams, but it was not sufficient. Players also had to invest their own money. Even students squeezing by on a loan and a job swabbing dining-hall tables kicked in at least $1,000. They were paid using a complicated formula based on hours of play plus a share of profits. (Big winners often received bonuses, but no players were docked for losing.) Those who brought in fresh blood trained the recruits themselves and earned proceeds from their first 12 hours at the tables. Having skin in the game kept everyone motivated and honest, essential in an operation that trusted players to walk around with thousands of dollars in their pockets. "All eyes were on the same goal," says Kaplan. "Each player was as concerned about his teammates' performance as his own."

Starting with his Vegas team, Kaplan raised more than a million dollars from friends, classmates, and their families. As a leader and manager, he always put up capital on the same terms as other investors and took his compensation at the back end like everyone else. Each investment was structured as a "bank," generally defined as about three to six months of play. (See "Infographic: Know When to Hold 'Em") For each bank, Kaplan would write a business plan, including information on the number of active players, how many hours each would play, the team's strategy, and the projected return on investment. He constantly revised those projections based on new information. The Venetian might have changed its shuffling methods, for example. Or perhaps the Griffin Detective Agency, which published photos of counters, had spotted a player, rendering him persona non grata in the agency's client casinos. When the allotted time had passed or the teams had achieved the desired return, Kaplan would break the bank, pay everyone off, and start again. "Investors could decide whether to reinvest and how much," he says. "And players who made money could put it into the next venture."

The compensation system at FreshAddress echoes that of the blackjack teams, paying employees slightly below-market wages but offering a monthly share of net revenue, which adds from 10 percent to 50 percent to their compensation. That motivates workers to operate more like a team than a company, Kaplan says. "If people are rewarded based on the success of the whole, it keeps everyone focused on the same goal."

Analyze everything

"We tracked casino openings religiously. Whenever one opened, we would hit it really hard before they figured out what was going on."

Face cards and aces weren't all the blackjack teams tracked. Kaplan is so enamored of numbers that he makes Gary Loveman, the famously analytic CEO of Harrah's Entertainment, look like a from-the-gut leader by comparison. At the casinos, players carried Excel spreadsheets folded in their pockets. Periodically, they would slip into a bathroom and fill in 30 rows of data on every aspect of the game: what time they started play, how many chips they cashed in for, how much they varied their bets, how much they won and lost every hour. After each weekend, those sheets would be fed into a computer to determine how much each player had earned. Then Kaplan would calculate the standard deviation of players' won-lost records as a check against his computer-generated projections for the group's overall performance. (That data also tipped him off if someone wasn't following prescribed strategy or was stealing.) Investors received weekly summaries of performance data as well as a final report at bank's breaking.

In addition, all data were shared with all players. "Players could see what every other player was doing, what they had earned, what stakes they were playing, how many hours they got in," says Kaplan. "And someone would say, 'Wow, you got in six hours at the Mirage playing those kinds of stakes? That's where I'm going to be playing.' And the other guy would be like, 'Yeah, it was great. No one bothered me. I played over in this corner. All the pit boss ever does is talk on the phone to his girlfriend."

The teams also conducted qualitative intelligence. "We tracked casino openings religiously," says Kaplan. "We paid one person to do the research, and whenever one opened, we would hit it really hard before they figured out what was going on." Kaplan would send scouts to check out casinos' soft openings, essentially dress rehearsals in which management assessed whether dealers, cashiers, and other employees were up to snuff. "They'd come back and say, 'It's full stakes and an eight-deck shoe, and they are cutting cards all the way back," says Kaplan. "The scout might show up at a riverboat casino and realize that the manager who threw us out of Caesars is now there. So he'd say, 'Don't send six people down to play, because they will get kicked out in a second."

Kaplan retains his zest for collecting and organizing data, a task the Internet has obviously made much easier. For real estate ventures, he conducts extensive structural, market, construction, and lease analysis. If the results warrant it, he can then make a low no-contingency bid. Such bids may appeal more to sellers than higher offers dependent on environmental, structural, or financial considerations. Or Kaplan may secure the property when those higher, less-informed bidders discover problems and drop out.

As for FreshAddress, it tracks sales, proposals, prospects, projects, and reams of industry-specific data using an elaborate project management system that is accessible by the whole company. "We share everything except salaries," says Kaplan. "Everyone is constantly watching everything and catching errors or finding ways to maximize revenue or minimize costs. Knowledge is power. The more people on the team that have knowledge, the more powerful the team."

Always keep the count

"The count is everything. If you lose the count, you have to get up from the table and walk away."

Kaplan is still squash-team trim and tall enough to need extra legroom in airplanes. He looks like the athlete he is, and he maintains the athlete's obsession with focus. Blackjack, after all, is a game, as is business. Take your eyes off the goal, and you stumble.

At a blackjack table, there is one goal -- keeping track of the cards -- and many, many distractions. Kaplan encouraged rowdy audiences at checkouts, because he knew what players could expect in the casinos: waiters offering drinks (which players were not permitted to accept), other players chatting, pit bosses hovering, big wins, big losses. Players had to respond as casually as possible to all those stimuli while never, ever, losing the count. "The count is everything," says Kaplan. "If you lose the count, you have to get up from the table and walk away."

For his part, Kaplan was focused on meeting projected returns. But distractions were frequent and occasionally overwhelming. As more teams embarked on weekends, Kaplan spent more time during the week working with lawyers to retrieve the confiscated money, chips, and possessions of players who had been caught counting. Sometimes plane tickets were part of the casino's haul, forcing him to scramble to arrange players' transportation home.

One event in particular rattled Kaplan for months. In 1993, a player accidentally left a paper bag stuffed with $125,000 in cash in an MIT classroom overnight. By the time the building opened, the bag had disappeared. The university ultimately located it (a janitor had stored it in his locker for safekeeping). Still, the FBI, the IRS, and the DEA were called to investigate, and it took Kaplan and his partners three harrowing months to retrieve the money. Maintaining his focus on operations through that ordeal required a monumental act of will.

Now at the helm of a traditional company, Kaplan and his partners keep the count with big-picture meetings once a week, at which they limit discussion to FreshAddress's three or four major goals. Says Kaplan: "We have to keep asking, Where are we now? Where are we headed?"

Seize the moment

"When you've got the advantage, get out the money."

Winning at blackjack requires patience. Players would bide their time until the count turned favorable, at which point they would raise their bets or signal a big player to join the game. But sometimes, just when a deck started to smoke, a pit boss would look over their shoulders, and "they'd lose their nerve," says Kaplan. "They'd think, If he sees me make a big bet, he'll kick me out. I'll wait until he walks away." That's a losing strategy, says Kaplan, because players make all their money in those next few rounds. Hence the teams' mantra: "When you've got the advantage, get out the money."

Kaplan concedes that his own nerve failed him when he shunned publicity after Bringing Down the House hit it big. For years, he had kept mum about the team and its strategies for fear of exposing active members. Even when the book bared all secrets and former players scurried from the shadows to share Jeff Ma's limelight, Kaplan worried that people might find his past unsavory. It wouldn't have been the first time.

In 1977, Kaplan took the biggest risk of his life: postponing admission to Harvard Business School for a year in order to play blackjack in Las Vegas. When HBS found out, it revoked his acceptance. Beyond panic, Kaplan composed a lengthy, handwritten explanation of how he was applying his math, statistical, and computer science background to a real-world problem and pointed out that running the team was excellent experience for his stated intention of becoming an entrepreneur. "Five weeks later, I got a call from the dean of admissions," says Kaplan. "He said, 'You can now tell people you are the only person ever to be admitted to HBS twice in one year."

Thirty years have passed, and attitudes toward gambling have changed. "Poker is big, and there's no longer this negative connotation," says Kaplan. "The public sees the MIT experience as a story about brilliant people beating the game." That's why, with his blackjack teams in the public eye, Kaplan is finally telling his story. Shortly before the movie premiered, he hired his first publicist. He has since been interviewed on Bloomberg Radio and other news outlets. And he's working on a proposal for his own book.

"I've got the advantage," says Kaplan. "It's time for me to get out the money."

Leigh Buchanan is an Inc. editor-at-large.