Maegan Ayers and her then-boyfriend, Nathan Socha, faced a dilemma in the fall of 2009. They had found the perfect little condo for sale in the Boston neighborhood of Jamaica Plain: on the ground floor, just a mile from the nearest “T” train station, and close by Boston’s Emerald Necklace, a seven-mile chain of parks and bike paths. Federal incentives, low prices, and high rents had made home-buying an unusually attractive proposition, and the pair was eager to snap up the condo.

But, as the couple’s parents gently pointed out, Ayers and Socha were not yet married, or even engaged. If their relationship were to sour, they would have none of the protections that married homebuyers enjoy. As “tenants in common,” one of them could legally rent out or even sell his or her share of the condo to a total stranger. In the event of a break-up, Ayers and Socha wondered, how could they avoid conflict over their jointly owned condo?

Many families are faced with some version of Ayers and Socha’s quandary—how to fairly divide coveted goods. Some achieve a satisfying division, and are even strengthened in the process; others are ripped apart. Despite these high stakes, the methods families use to divide their assets tend to be very ad hoc.

Ayers and Socha did something different: They turned to mathematics.

Perhaps the oldest fair division method on the books—one which has been used by children from time immemorial—is the “I cut, you choose” method for dividing up, say, a cake between two people. One person cuts the cake into two pieces, and the other person gets to choose which piece to take. Abraham and Lot used this method to split up the land in which they would settle: Abraham divided the land, and Lot chose Jordan, leaving Canaan for Abraham.

“I cut, you choose” has one very appealing property: It is envy-free, meaning that neither participant would willingly trade her share for the other share. The person who cuts the cake—or tract of land, or other divisible good—has an incentive to make the two shares as equal as possible from her perspective, since she doesn’t know which she’ll end up with. If she does a good cutting job, she will be content with either piece. The other participant gets to choose her favorite piece, so neither person will wish to trade.

But when the good being divided is not homogenous—when the cake has an assortment of different frostings, or the land has a mix of fertile valleys, mineral-rich mountains, and arid deserts—the “I cut, you choose” method falls short on other important measures of fairness and desirability.

In some division problems, mathematicians have shown that no ideal split exists.

In these settings, the chooser has a distinct advantage over the cutter. The cutter, to be safe, must divide the cake into two pieces that, to him, have equal value. But the chooser may have very different preferences from the cutter. Maybe from the chooser’s vantage point, one of the pieces is worth 60 percent and the other is worth 40 percent If so, he will happily walk away with considerably more than what he considers half of the cake. In mathematical language, the “I cut, you choose” method is not equitable.

Not only is the method not equitable, it can also fail to give each person the share that will be most useful to him. For instance, suppose John and Jane are sharing a cake that is half vanilla and half chocolate. John likes vanilla best, while Jane prefers chocolate. The ideal split is obviously for John to get the vanilla half and Jane the chocolate half. But if John is the cutter, then unless he knows Jane’s preferences, that ideal split will appear too risky to him: He could lose the entire vanilla half. So he will divide the cake into two identical pieces, with an equal amount of each flavor. This division is not “efficient”: There are other divisions that can improve some or all participants’ shares without making anyone worse off.

Mathematicians have proven that when two people are dividing a cake, there is always some division that is simultaneously envy-free, equitable, and efficient (to get a sense of why this is true, see Sidebar: Cakes Are Fair Game). But there’s no simple algorithm for identifying this ideal split. And, in some other division problems, mathematicians have shown that no ideal split even exists. In its stead, mathematicians have, over the past 20 years, developed a rigorous framework for exploring the trade-offs required by different kinds of divisions, helping to bring clarity to the fallout from divorce, death, and divestment.

One straightforward approach that Ayers and Socha might have taken is called “the shotgun clause,” a close analogue to “I cut, you choose” that is common in business contracts. This clause stipulates that if, for example, two owners of a business want to part ways, one of them will propose a buyout price, and the other will choose either to buy or be bought out at that price. Like “I cut, you choose,” this method is envy-free but not equitable: It’s better to be the chooser than the proposer. As a result, arguments about who should propose and who should choose sometimes lead to years of litigation, says James Ring, lawyer and CEO of Fair Outcomes, a Boston company that provides division algorithms.

Instead, Ayers and Socha committed that in the event of a break-up, they would use a relatively new algorithm called Fair Buy-Sell to determine which of them would buy out the other’s share, and at what price. Fair Buy-Sell was devised in 2007 by Ring and Steven Brams, a professor of politics at New York University, and requires each partner to simultaneously propose a buyout price. If John proposes $110,000 and Jane proposes $100,000 then John, the higher bidder, will buy out Jane for $105,000. Unlike the shotgun clause, this method is equitable: Each participant ends up with something—either money or the business—at a price that is better than his or her offer. “Both participants always get a solution that’s better than what they proposed,” Ring says. And the business always goes to the partner who values it more.

This algorithm joins a long list of others, with names like Adjusted Winner and Balanced Alternation. Just as important as prescriptions for fair division, though, is understanding when perfect fairness is impossible, or comes at the cost of social welfare (which measures the extent to which items are going to the people who value them most.). In the January 2013 issue of *The American Mathematical Monthly*, Brams—together with Christian Klamler of the University of Graz and Michael Jones of Montclair State University—showed that when three people are dividing a cake, it is sometimes impossible to find a division that is simultaneously envy-free, equitable, and efficient. Similarly, when three people have to divide a collection of indivisible items, it is sometimes necessary to choose between an envy-free solution and an efficient solution (for a simple example in which this happens, see Sidebar: Envy vs. Efficiency).

“Mathematics sets limits on what is achievable,” Brams says. “Then the question is, if you can’t get everything, what properties do you want to give up on?”

Maybe I’ll say that I will buy you out for $100,000, but if you want to buy me out, you have to pay me $200,000. It’s human nature.

Here too, services are popping up to help. A new, free online service called Spliddit will allow users to decide for themselves just how much they want to relax the notion of fairness. Its division algorithms ask participants to choose a particular fairness criterion—either envy-freeness or one of two weaker criteria. The algorithm then looks for the division at the chosen fairness level that produces the highest social welfare, which in this case is measured by the sum of all the participants’ values for their winnings. The higher the fairness constraint the participants set, the lower the social welfare is likely to be, and vice versa.

The inner workings of the Spliddit algorithms are not as transparent as those of the Fair Buy-Sell algorithm. But Ariel Procaccia, a computer scientist at Carnegie Mellon University in Pittsburg whose research team created Spliddit, nevertheless believes that even math-phobic individuals will be able to use the site: The divisions the algorithms generate should speak for themselves, he says.

“People should be able to look at a proposal and see that it makes sense—that they like their share and don’t want to switch with anyone,” he says.

While fair division algorithms have come a long way, their real-world use can be complex. For one thing, human beings can entertain equally compelling but mutually exclusive notions of fairness. When siblings are dividing their parents’ estate, for example, should each sibling get an equal share, or should the sibling who nursed their father through his last illness get more? A fair division algorithm cannot make this determination for a family.

“Depending on how the algorithm plays out, it could offend either set of moral sensibilities,” says Peter Ditto, a social psychologist at the University of California, Irvine. “It’s hard to satisfy all our intuitions about fairness and justice, because they tend to mutually conflict.” Our satisfaction is further complicated, says Ditto, because evolution has honed us to be injustice detectors, so that “we often feel we are being screwed even when we aren’t.” Throw in the intricacy of emotional responses to a settlement, and it becomes clear that our relationship with division algorithms will not always be a simple one.

At the same time, the impartial nature of mathematical algorithms can help people tease out their own subconscious motivations and tame their hypersensitive unfairness radars. That’s what happened when Fair Buy-Sell was used to resolve an ugly feud that had dragged on for years between siblings who had inherited a family business empire and couldn’t agree about who would buy out whom.

“Each side claimed the other side was offering too little,” Ring says. “That’s how people behave in a conflict if they don’t trust each other—maybe I’ll say that I will buy you out for $100,000, but if you want to buy me out, you have to pay me $200,000. It’s human nature.”

When one sibling’s lawyer challenged him to use the Fair Buy-Sell algorithm, the process of choosing a price to plug into the system led the sibling to an epiphany: He didn’t actually want the business. His previous intransigence, he realized, had been an attempt to unfairly profit at his sibling’s expense. The fair division algorithms offer “a very powerful and positive thing,” Ring says. “To get what I want, I don’t have to lie to you and brutalize you and pretend I care about things for years.”

Division services like Fair Outcomes and Spliddit offer a mathematical lens through which users can view their own motivations. Will they choose to emphasize envy-freeness or social welfare? If even an envy-free division feels unacceptable to them, are they motivated by vindictiveness? As Marc Kilgour, professor and Chair of Mathematics at Wilfrid Laurier University in Waterloo, Ontario, puts it, the mathematical approach to fair division “throws a light on all kinds of behavior that has been around for a long time.”

As for Ayers and Socha, they never did end up invoking the Fair Buy-Sell algorithm. Instead, Maegan Ayers became Maegan Socha, and the married couple eventually sold their condo and moved to Rhode Island, where they are expecting their first child in July. Looking back, Maegan sees their condo purchase and fairness contract as the young couple’s leap into adulthood. “At the time I thought that part of being adult was being old enough to make those kinds of decisions, and I’m pleased by how we handled it,” she recalls. “It was a sign of faith and confidence in each other to know that if things didn’t work out, we wouldn’t be unfair or hurtful to each other. We’d preserve something, even if the relationship didn’t work.”

*Erica Klarreich is a mathematics and science writer based in Berkeley, Calif. Her work has appeared in the 2010 and 2011 volumes of *The Best Writing on Mathematics.