“She was consistently told by teachers in adolescence, then later by colleagues, that the things she was interested in were things women didn’t do, and that there were no good female mathematicians,” Dr. Pippenger said.

Dr. Klawe persevered. A native Canadian, she received her Ph.D. in mathematics in 1977 from the University of Alberta. She started a second Ph.D., in computer science, at the University of Toronto, but was offered a faculty position there before completing the degree.

In 1980, she married Dr. Pippenger, a highly regarded theoretical computer scientist, and for the first decade of their marriage Dr. Klawe was the professional afterthought. In the 1980s, they both worked at the I.B.M. Almaden Research Center in San Jose, Calif. “They only hired me so they wouldn’t lose Nick,” Dr. Klawe said.

They moved to the University of British Columbia in Vancouver in 1988, and Dr. Klawe’s talents as an administrator began to blossom. In 2002, she was recruited to Princeton University as dean of engineering and applied sciences.

“By the time we went to Princeton,” Dr. Pippenger said, “it was clear they were hiring me because they really wanted to get Maria.” Dr. Klawe, a slight and sprightly woman, had not been at Princeton long before she began receiving recruiting inquiries. “If you’re a female administrator at a place like Princeton, you’ll get a request to be president or provost twice a week,” she said. “A lot of times it’s not that they care about you, but they need a credible female candidate.”

She seldom read beyond the first few lines. “I had this automatic message saying I was honored to be nominated, but had no intention of leaving Princeton in the near future,” she said.

Then one day in 2005, an announcement about the search for a president at Harvey Mudd floated into her in-box. She knew about the college and couldn’t resist opening the attachment.