In one survey, psychologists at the University of Vermont asked 349 men and women in committed relationships about sexual fantasies

Fully 98 percent of the men and 80 percent of the women reported having imagined a sexual encounter with someone other than their partner at least once in the previous two months

But there is a big difference between fantasizing about infidelity and actually following through. The strongest risk factor for infidelity, researchers have found, exists not inside the marriage but outside: opportunity.

For years, men have typically had the most opportunities to cheat thanks to long hours at the office, business travel and control over family finances. But today, both men and women spend late hours at the office and travel on business. And even for women who stay home, cellphones, e-mail and instant messaging appear to be allowing them to form more intimate relationships outside of their marriages. As a result, your best chance at fidelity is to limit opportunities that might allow you to straymitted men and women avoid situations that could lead to bad decisions — like hotel bars and late nights with colleagues.

A series of unusual studies led by John Lydon, a psychologist at McGill University in Montreal ourteen network reddit, looked at how people in a committed relationship react in the face of temptation. Not surprisingly, they gave the highest ratings to people who would typically be viewed as attractive.

Later, they were shown similar pictures and told that the person was interested in meeting them. In that situation, participants consistently gave those pictures lower scores than they had the first time around.

When they were attracted to someone who might threaten the relationship, they seemed to instinctively tell themselves, “He’s not so great.” “The more committed you are,” Dr. Lydon said, “the less attractive you find other people who threaten your relationship.”

Other McGill studies confirmed differences in how men and women react to such threats. In one, attractive actors or actresses were brought in to flirt with study participants in a waiting room. Later, the participants were asked questions about their relationships, particularly how they would respond to a partner’s bad behavior, like being late and forgetting to call.

In one study, highly committed married men and women were asked to rate the attractiveness of people of the opposite sex in a series of photos

Men who had just been flirting were less forgiving of the hypothetical bad behavior, suggesting that the attractive actress had momentarily chipped away at their commitment. But women who had been flirting were more likely to be forgiving and to make excuses for the man, suggesting that their earlier flirting had triggered a protective response when discussing their relationship.

“We think the men in these studies may have had commitment, but the women had the contingency plan – the attractive alternative sets off the alarm bell,” Dr. Lydon said. “Women implicitly code that as a threat. Men don’t.”

The study also looked at whether a person can be trained to resist temptation. The team prompted male students who were in committed dating relationships to imagine running into an attractive woman on a weekend when their girlfriends were away. Some of the men were then asked to develop a contingency plan by filling in the sentence “When she approaches me, I will __________ to protect my relationship.”

Because the researchers ethically could not bring in a real woman to act as a temptation, they created a virtual-reality game in which two out of four rooms included subliminal images of an attractive woman. Most of the men who had practiced resisting temptation stayed away from the rooms with attractive women; but among men who had not practiced resistance, two out of three gravitated toward the temptation room.