On the first day of class every semester, Portia Dyrenforth asks the students taking her psychology course whether they think couples with similar personalities are more likely to be happy together.

Inevitably, she says, they nod.

Then she asks whether they know any couples who are very different from each other but still seem quite content in their relationships.

They nod at this one, too.

"It's the idea that opposites attract or birds of a feather flock together," she says. "Students really resonate with that and the idea that both of them make a lot of sense."

Both of the truisms are regularly trotted out by relationship experts proffering advice and long-married couples rationalizing the reason for their success.

Online dating sites like EHarmony.com have even built businesses around the belief that people with similarities make better matches in the long run. OppositesConnect.com, obviously, is betting the reverse is true.

Two years ago, Dyrenforth, a professor at Hobart and William Smith Colleges in Upstate New York, decided to try to get to the bottom of the discrepancy.

To assemble a large and varied group of couples to examine, she turned to existing data that had been collected by demographers in Australia, Germany and Great Britain. (She couldn't find any studies conducted in the United States that were extensive enough to fit her purposes.) In all, 11,625 married couples were included in the study, recently published in the Journal of Personality and Social Psychology.

Dyrenforth, working with three other psychologists, examined the data with a few questions in mind: Do personality traits influence a person's own happiness in general and in the context of a relationship? Can a spouse's personality affect the happiness of his or her partner? And does having similar personalities affect the couple's relationship satisfaction?

The traits Dyrenforth looked at were extroversion, agreeableness, conscientiousness, emotional stability and openness to experience - often referred to as "The Big Five" by psychologists.

She found that people with high levels of all those characteristics were more likely to be happy with life in general and with their relationships. Emotional stability, in particular, seemed to be a crucial component for personal happiness.

More surprising to Dyrenforth was that a partner's traits can also influence our happiness. People who have spouses with high levels of agreeableness, conscientious and emotionally stability were more likely to be happy in their relationships and with life as a whole. (Extroversion and openness didn't seem quite so influential.)

As for sharing common characteristics? It didn't seem to matter much. Dyrenforth couldn't find any significant evidence that people with the same levels of openness, extroversion or any of the other qualities were more satisfied with their relationship than those with differing traits.

Her study didn't look at factors like religion, personal values or education levels that online dating sites often use to match people up. But when it comes to major facets of our psyches, "having similar personalities is not necessarily a key ingredient for happiness," she concluded in the paper.

That, she says, explains why her students thought both of those old sayings were true: Opposites do occasionally attract, and birds of a feather will sometimes flock together. And, according to Dyrenforth, either kind of pairing can work just fine.