Don Tillman is a highly intelligent and successful professor of genetics, but outside of the confines of academia, he is barely able to function in society. He is incapable of doing all of the social things that are required in order to fit in. In fact, he suffers from some form of Asperger's syndrome that manifests itself in social awkwardness and failure to read cues, as well as indicators of Obsessive-Compulsive Disorder.
Don would very much like to find a wife, but he finds it difficult to meet and connect with women. In an effort to find his ideal partner, he develops a scientific questionnaire that he calls "The Wife Project." The questions are designed to elicit answers that will cumulatively produce the ultimate compatible partner for him. Don's best friend Gene—a colleague at the university, and also a cheating ladies man—feels that Don needs to be more flexible. Gene sends a graduate student to meet him; Rosie is entirely unsuitable as she is the polar opposite of everything Don is looking for, but inexplicably, Don finds himself enjoying her company.
At the time they meet, Rosie is preoccupied with finding her birth father's identity. Her now-deceased mother told Rosie that Phil, the man who has raised Rosie her entire life, is not biologically her father, and that, on the night she graduated from medical school, she slept with a classmate. Don becomes obsessed with helping Rosie to find her birth father and develops a Father Project that should reveal the identity of her parent. The two of them work together to obtain genetic samples from various men who graduated in the same class as Rosie's mother, and then Don tests these samples to see if they are a match with Rosie's genes. Their efforts to obtain genetic samples from as many candidates as possible lead Rosie and Don to get to know each other fairly well, and eventually, they even travel to New York City together.
Upon their return from New York, Don is caught using lab equipment at the university where he works to test the DNA samples. As a result, he is fired from his job. At about the same time, Don realizes that he is in love with Rosie. He desires to try to change himself in hopes that Rosie will return his feelings, and he develops a program of imitating the behavior he associates with people who are experiencing romantic love. He also meets with Phil and gains a different perspective on Rosie's version of her childhood and the relationship between them. Don even manages to get his job back when he receives significant funding for a research project. However, when he declares his feelings to Rosie, she is upset that he is behaving insincerely and does not think that he actually feels love for her.
Although he is very sad that Rosie has rejected him, Don realizes that he has value and that he does not need to pretend to be someone different. He proposes to Rosie, and this time, she accepts. Rosie and Don end up moving to New York City together and getting married. They also test the remainders of the samples and realize that Phil, the man who has raised Rosie, is actually her biological father after all.