There's a calculus to knitting. An untamed batch of wool gets twisted and fed into a spinning wheel, a wooden contraption about as high-tech as an abacus, that binds the fibers into a single strand of yarn. That yarn, in turn, is woven into geometric designs comprised of equations: A certain number of rows combined with certain stitches yield something functional and beautiful. In the right hands, knitting produces a precise but almost magical alchemy—chaos into order.

You can see why it would appeal to Brenda Dietrich.

Dietrich, 47, runs the math sciences department at

Dietrich, who has coauthored 13 patents and has twice been named one of IBM's top inventors, likes to make stuff—tangible stuff, not just theorems. As a mathematician, she has a rare ability to travel between two very different worlds, says Paul Horn, head of IBM research. She can listen to a customer describe the messy details of a business, then translate those specs into math problems for her team to solve. And she thinks mathematicians should live in that real world, the world of customers. When she took over the math department in 2001, she encouraged researchers to venture outside Watson, which she calls "that lovely stone building on the hill," and work with IBM consultants in the field.

These days, her team is, in fact, venturing out from years of behind-the-scenes, mostly theoretical research to tackle an impressive array of real-world issues at IBM and beyond. How to assemble a project team from consultants dispersed around the world. How to fight vast forest fires more effectively. How to identify the best sales leads in the pipeline. OnTarget, sales-prediction software that grew out of math research, generated $100 million in new revenue as a pilot program in Canada. Last year, it delivered about $500 million in worldwide use, a sum that makes Dietrich giggle as if she can't quite believe it.

Dietrich's 160 researchers are, in fact, increasingly among the most valuable problem solvers at IBM. "Historically, the stars here have been the physicists who made the technology that went into chips and systems, and then it was the computer scientists and engineers," Horn says. "Now we're seeing the emergence of mathematicians. They're embedded everywhere." This is partly due to IBM's shift from hardware to software and services. And part of it, certainly, is a function of Dietrich's marketing and political savvy: A geek, but a far cry from the personality- challenged stereotype, she understands how to win attention and resources in an organization of 330,000 people.

More than that, her department's growing impact reflects a bigger real-world shift. A generation ago, businesses called on mathematicians, at best, to optimize production lines and maybe to support pricing decisions. What more could they possibly contribute to the bottom line? Today, companies measure nearly every aspect of what they do, and computers are fast enough to crunch the numbers in time for execs to act on the analysis. In the hands of talented mathematicians, data create an invaluable advantage. Elaborate algorithms reveal a company's inefficiencies and opportunities—unseen bottlenecks in the supply chain or customers' hidden buying patterns. Entire companies—think

A number-theory class at the University of North Carolina at Chapel Hill changed Dietrich's mind about becoming a doctor. Math was a revelation, like hearing music for the first time. "There's structure and symmetry and the most gorgeous theory," she says. "It made me believe in some underlying order in the world."

Dietrich, whose husband is an IBM software architect, joined the company in 1984 after earning her PhD in operations research and industrial engineering at Cornell, and she applied that "gorgeous theory" to designing more-efficient chip-manufacturing lines. It was thrilling to see how useful math could be. In the mid-1990s, she grew bored between projects—"a dangerous situation," she laughs—and pursued a new set of problems, spending six months in the field alongside IBM consultants and customers. "They couldn't tell you the dependent and independent variables," she says. But she could, and that ability to translate the practical into the theoretical (and back) was powerful. In some ways, her experience was the basis for how her research department now operates.

If you're not a mathematician, the deep math that Dietrich and her team perform sounds utterly foreign—combinatorial auctions, integer programming, conditional logic, and so on. Their whiteboard scribbles at Watson look incomprehensible, like Farsi or Greek (then again, many of the symbols are Greek). But these mysterious equations represent the real world and how it works. When mathematicians "model" a problem, they're creating a numerical snapshot of a dynamic system and its variables.

Take the forest-fire project Dietrich and the researchers are working on. Extinguishing fast-spreading flames over tens of thousands of acres is an expensive and complicated undertaking. In 2000, a particularly devastating year, the federal government spent more than $1 billion and still lost more then 8 million acres. Its fire planners want to reduce the cost and the damage through better coordination among the five agencies involved.

Armed with seven years of data, IBM's mathematicians are creating an enormous model that shows how the resources—every firefighter, truck, plane, etc.—have been used in the past, how much each effort cost, and how many acres burned. The algorithms describe the likely costs and results for any number of strategies to combat a given fire. "How many bulldozers and buckets do you keep in Yellowstone Park?" Dietrich asks. "And if you need to move them elsewhere, how much will it cost and how long will it take?" She's talking fast, describing the unruly variables that math makes sense of. "It's a nice project. Complicated, huh?"

Uh, yeah. For years, mathematicians were so focused on basic research that they wouldn't go near projects like this—and they weren't asked to, either. "It was like working at a university without even the load of teaching," says longtime researcher Baruch Schieber. "When you decided what to work on, the first consideration wasn't, how will this impact the company?" If researchers wanted to, they could close their office door and focus on the most esoteric research, uninterrupted—and isolated.

At first, Horn says, putting math specialists in front of clients made everyone nervous, not least of all the clients. The researchers are undeniably brilliant, he says, chuckling, but "you wonder how some of them get home at night." Watson, located an hour north of New York, has a laid-back, collegiate feel; sneakers and jeans, along with the occasional bushy beard and ponytail, are the norm. Opinionated, professorial types fit right in. Dietrich may seem genial and charmingly quirky, but when she holds forth on the intricacies of math, she can be intimidating. She doesn't suffer fools and relishes a good debate.

But Dietrich has learned to soften her approach to avoid undermining the consultants' relationships with clients. She helped create a class for researchers that explains the consulting process and culture. A mathematician's perfectionism has to give way to deadlines. The smartest-person-in-the-room vibe is considered off-putting, rather than an invitation to match wits. "Instead of forcing an argument on logic, which we're trained to do—it's a bit adversarial—you have to keep your mouth shut and listen," she says. "And you've got to stay out of the technical muck."

Some longtime mathematicians initially worried that research would suffer under Dietrich. Instead, they lead a double life. In fact, says researcher Robin Lougee- Heimer, projects like the one she is working on now, a nationwide distribution puzzle for a brand-name customer, uncover fertile research topics. "I'm getting exposed to great problems," she says, "with nasty details and complexity."

It used to be that Schieber, a senior manager in optimization, would hear about a project within IBM and occasionally reach out to consultants. They rarely returned his calls. Now, he says, "I am the one being selective."

"When we first started asking what resources consultants use on projects, they said every project was different. That just drove me crazy."

The word is out: The math team can help. Dietrich fields a few dozen requests a month, half of which she turns down because the problem has already been solved or is not challenging enough. "We want to push the frontiers of what's solvable," she says. "Otherwise, what's the point?"

In a sense, Dietrich is doing what she enjoyed as a young math whiz—solving word problems. Here's a doozy: After IBM's sales team signs a consulting contract, the company often has to assemble the project team on deadline—say, 50 Java developers in Chicago by the following Monday. It can choose from 190,000 consultants around the world with various skills, personalities, and availability. It must do this for thousands of projects a year for clients of all sizes in every imaginable industry. Meanwhile, the mix of projects and available consultants is constantly changing.

"When we first started asking what resources consultants use on projects, they said every project was different," says Dietrich. "That just drove me crazy." By poring over two years of project data, the mathematicians identified which skills were most often applied in certain types of assignments. "You may not know exactly what the customer wants, but now you have a rough idea who you need for a $5 million project versus a $50 million project," says Dan Connors, optimization manager for the Workforce Management program. That staffing-analysis tool helped managers anticipate demand and schedule accordingly, boosting the consultants' productivity 7% and reducing travel expenses and the use of outside contractors. The savings exceeded $500 million. So do the math: Add in sales from the OnTarget forecasting tool, and that's a $1 billion contribution by Dietrich's math whizzes.

The brainiacs are tackling another problem whose solution could be just as valuable: how to pick the best teams. Project managers tend to select the most talented developers and engineers available, or the ones they already know. That may work well for the project at hand, but in the long run, it doesn't necessarily benefit IBM as a whole; better to spread the talent around. Researchers are also creating a social- networking analysis that would assess trails of email, instant messaging, and phone calls to identify which teams operate as flat organizations and which ones are hierarchical—who works well together and who doesn't.

But the problem that's really grabbing Dietrich involves predicting the workforce of the future. By analyzing population trends, employee demographics and skills, and demand for certain technologies, her researchers hope to identify labor shortages in various functions and professions before they happen.

That work, almost unthinkably complex and far-reaching, is nowhere near complete. Each answer generates new questions, and that's fine. That's good. Even mathematicians don't have all the answers. Dietrich won't get bored, and she'll turn out some lovely knitting. Eventually, she'll have numbers that help us think differently about the world and where it's headed—and IBM and its customers will hire or train employees accordingly.

It may well turn out, of course, that what they need are more mathematicians.

*A version of this article appeared in the February 2007 issue of Fast Company
magazine.*