Benefits of marriage as a search strategy​
​by Davi B. Costa
We propose and investigate a model for dating and marriage in large societies based on a stochastic matching process and simple decision rules. Agents have preferences among themselves given by some probability distribution. They randomly search for better mates, forming new couples and breaking apart in the process. Marriage is implemented in the model by adding the decision of stopping searching for a better mate when an agent finds another one with an affinity higher than a certain fixed amount. We show that the average utility in the system with marriage can be higher than in the system without it. Part of our results can be summarized in what sounds like a piece of advice: don’t marry the first person you like and don’t search for the love of your life, but get married if you like your partner more than a sigma above average. We also compare the evolution of the fraction of married couples in our model with real data and obtain good agreement. In the last section, we formulate the model in the limit of an infinite number of agents and find an analytical expression for the evolution of the system.
(This Mathematica notebook is a companion to the article: https://arxiv.org/abs/2108.04885. More details can be found in the article which is freely available in the Arxiv repository)

1. Introduction

Consider the following situation: you are dating and wonder whether you should propose marriage or not. There are many aspects of marriage to consider, but you are mainly concerned with marriage as a search strategy. You like your mate, but you are unsure if it is enough. After all, there may be someone out there that you would like even more, but it is unlikely that you will get to know this person if you get married. Perhaps, the best is to stay open to the possibility of meeting a potential better mate by not getting married. However, if your relationship is symmetric in this respect, you may become single because your mate left you for someone else. So while marriage closes off some of the opportunities that you would otherwise have, on the other hand, it protects you from the risk of being left out. So you ask yourself: as a search strategy, is it beneficial to get married? Or does the potential benefit of meeting a person with whom you have a greater affinity outweigh the chances of being alone because your current partner has left you? To make these ideas precise and to answer the
question, we propose a model for dating and marriage based on a random matching process and simple decision rules.
​
The model contains a number
N
of agents with preferences among themselves sampled by a given distribution. Initially, all agents are singles, and the system evolves in a certain number
T
of discrete steps. At each step, they will match in pairs by random chance. If the agents of the matched pair like each other more than their previous mates, or more than being single, they will form a new couple. An agent becomes single if its partner starts a new relationship. Marriage is implemented in the model by adding the decision of stopping searching for a better mate when an agent finds another one with an affinity higher than a certain fixed value
Λ
. This parameter should be interpreted as exogenous in the sense that it characterizes the decision behavior of the agents of a given society with respect to marriage. We simulate this system for different values of Λ and we computed the average utility in each case as a function of the number of steps. Part of the conclusions one can extract from the results we obtained, answers the question from the previous paragraph. The answer sounds like a piece of advice: don’t marry the first person you like and don’t search for the love of your life, but get married if you like your partner more than a sigma above average.

2. Model and results

2.1. The model

The model contains
n
agents with preferences among themselves described by a utility function. This information is encoded in the off-diagonal elements of the affinity matrix
A∈
nxn

, where
A
ij
is the utility for agent
i
to be in a couple with agent
j
. In large societies, the probability distribution that generates the affinity matrix is more important than its actual values. Indeed, the preferences of agent
k
concerning the other agents of society are encoded by

A
kj
:1≤j≤n&j≠k
. The histogram with these values, will distribute according to some probability distribution. As it happens with many human traits, it may be reasonable to assume that these values are generated by a Gaussian distribution, i.e.,
A
kj
∼N(
μ
k
,
σ
k
)
for all
1≤j≤n
with
j≠k
and each
1≤k≤n
. In principle, one may think that it is more realistic to assume that the preferences of different agents are given by distributions defined with different parameters μ and σ. Note, however, that the values of the
k
-column of the affinity matrix,

A
jk
:1≤j≤n&j≠k
, encodes the way agent
k
is liked by society. Therefore, if agents indeed have preferences given by different Gaussian distributions, then the distribution that generates the columns of the affinity matrix will not in general be Gaussian. Hence, to have both lines and columns consistently Gaussian, we may assume that all off-diagonal entries of the affinity matrix are generated by the same Gaussian distribution, that is,
A
kj
∼N(μ,σ)
for all
1≤j≤n
and
1≤k≤n
with
j≤k
. When this is the case, we will say that we are dealing with the Gaussian model. For comparison and to make concrete our analytical investigations, we will also study the Uniform model, i.e.,
A
kj
∼U(μ-2σ,μ+2σ)
. The diagonal elements of the affinity matrix are the utilities when agents are singles. We also believe it is reasonable to assume these values are generated by a Gaussian distribution
A
kk
∼N(
μ
s
,
σ
s
)
for all
1≤k≤n
. It is an open empirical problem to investigate the relation between the distributions that generate the diagonal and off-diagonal elements of the affinity matrix. In particular, it would be interesting to investigate the relationship between the mean of these distributions. Note, that the mean of the diagonal elements gives the average utility when all agents are single. On the other hand, the mean of the off-diagonal elements can be interpreted as the average utility when agents form random couples. Therefore, the relationship between the mean of these two distributions encodes how being single compares to dating a random agent in society. We denote the mean and variance of this distribution using an
s
. In Wolfram Language we can generate the affinity matrix for the Gaussian model with parameters:
In[]:=
{n=1000,μ=0,σ=1,μs=0,σs=1};
using
In[]:=
A=RandomVariate[NormalDistribution[μ,σ],{n,n}];​​Do[A〚k〛〚k〛=RandomVariate[NormalDistribution[μs,σs],1]〚1〛,{k,1,n}];
Initially, all agents are singles, therefore their initial utilities
k
u
t
will be given by the diagonal elements of the affinity matrix, i.e.,
In[]:=
Couples={{}};​​Utility={Table[A〚k〛〚k〛,{k,1,n}]};
The histogram with this values follows a Gaussian distribution and can be visualized easily using:
In[]:=
Histogram[Table[A〚k〛〚k〛,{k,1,n}]]
Out[]=
-2
-1
0
1
2
3
0
20
40
60
80
The dynamics of the system happen in discrete steps
t∈Ν
. At each step
t
, all agents match at random with a new agent. In Wolfram language, the matching at each step can be generated easily using
In[]:=
var=RandomSample[Table[k,{k,1,n}]];​​Matching=var1;;
n
2
,var
n
2
+1;;n;​​Matching〚1;;100〛
Out[]=
{{725,959},{378,72},{89,639},{706,9},{524,528},{619,441},{794,492},{122,818},{3,965},{465,339},{304,552},{882,256},{982,842},{244,425},{985,227},{246,711},{117,231},{162,495},{477,809},{434,180},{954,922},{518,950},{653,784},{149,493},{73,385},{928,163},{280,318},{911,899},{445,270},{569,500},{158,987},{529,396},{568,826},{863,598},{433,1000},{517,278},{345,654},{903,361},{57,484},{34,47},{287,325},{312,561},{336,823},{439,935},{54,607},{662,998},{733,170},{60,738},{853,474},{435,525},{95,8},{912,730},{708,198},{757,133},{509,807},{179,204},{888,940},{972,527},{772,453},{728,160},{383,406},{834,878},{610,617},{565,375},{192,201},{800,41},{746,642},{489,176},{622,941},{215,27},{387,530},{862,668},{371,586},{326,324},{559,786},{188,893},{44,156},{186,208},{300,81},{850,827},{579,871},{691,86},{531,351},{700,428},{742,976},{331,787},{273,137},{891,291},{874,473},{145,754},{631,924},{353,567},{498,925},{956,836},{243,437},{659,775},{18,904},{337,534},{11,901},{28,702}}
We see that each element of the Matching is a pair of numbers
{j,k}
denoting the agents that match at the given step.
Then, two agents that were matched at step
t+1
will form a couple if they like themselves. That is, if their their affinities are higher then their utilities at
t
. More precisely:
In[]:=
t=1;​​Match=Table[{a,b}=Matching〚i〛;A〚a,b〛>Utility〚t〛〚a〛&&A〚b,a〛>Utility〚t〛〚b〛,{i,1,Length[Matching]}];​​NewCouples=Pick[Matching,Match]
Out[]=
{{89,639},{524,528},{3,965},{244,425},{954,922},{518,950},{903,361},{57,484},{34,47},{312,561},{662,998},{733,170},{60,738},{853,474},{912,730},{192,201},{300,81},{700,428},{874,473},{659,775},{833,663},{933,896},{262,340},{130,540},{808,119},{703,585},{937,422},{403,782},{676,418},{831,866},{398,906},{750,665},{555,828},{456,996},{657,55},{975,436},{714,42},{926,84},{10,694},{5,847},{736,442},{606,978},{548,732},{546,762},{841,763},{596,472},{677,236},{401,365},{704,35},{224,510},{135,825},{952,461},{536,497},{69,771},{343,295},{63,311},{918,791},{623,735},{934,452},{482,373},{553,471},{945,919},{859,886},{151,767},{921,97},{237,660},{22,994},{936,381},{141,958},{739,910},{883,905},{297,920},{382,52},{45,266},{731,716},{118,91},{942,88},{140,597},{948,78},{384,576},{973,705},{255,40},{191,909},{505,128},{999,929},{23,402},{404,981},{171,388},{543,748},{849,43},{68,279},{643,740},{400,712},{335,483},{20,931},{221,121},{305,25},{496,206},{212,684},{369,793},{184,696},{897,605},{960,476},{648,638},{980,664},{721,487}}
If one of the agents of the new couple was dating before, it will break apart with its previous mate:
In[]:=
BreakingAgents=Select[Flatten[NewCouples],MemberQ[Flatten[Couples〚t〛],#]&];​​CouplesToBreak=Select[Couples〚t〛,MemberQ[BreakingAgents,#〚1〛]||MemberQ[BreakingAgents,#〚2〛]&];
Then, the couples at
t+1
will be the set of Couples at
t
, plus the set of NewCouples, minus the CouplesToBreak:
In[]:=
Couples=Join[Couples,{Join[Complement[Couples〚t〛,CouplesToBreak],NewCouples]}];​​Couples〚t+1〛
Out[]=
{{89,639},{524,528},{3,965},{244,425},{954,922},{518,950},{903,361},{57,484},{34,47},{312,561},{662,998},{733,170},{60,738},{853,474},{912,730},{192,201},{300,81},{700,428},{874,473},{659,775},{833,663},{933,896},{262,340},{130,540},{808,119},{703,585},{937,422},{403,782},{676,418},{831,866},{398,906},{750,665},{555,828},{456,996},{657,55},{975,436},{714,42},{926,84},{10,694},{5,847},{736,442},{606,978},{548,732},{546,762},{841,763},{596,472},{677,236},{401,365},{704,35},{224,510},{135,825},{952,461},{536,497},{69,771},{343,295},{63,311},{918,791},{623,735},{934,452},{482,373},{553,471},{945,919},{859,886},{151,767},{921,97},{237,660},{22,994},{936,381},{141,958},{739,910},{883,905},{297,920},{382,52},{45,266},{731,716},{118,91},{942,88},{140,597},{948,78},{384,576},{973,705},{255,40},{191,909},{505,128},{999,929},{23,402},{404,981},{171,388},{543,748},{849,43},{68,279},{643,740},{400,712},{335,483},{20,931},{221,121},{305,25},{496,206},{212,684},{369,793},{184,696},{897,605},{960,476},{648,638},{980,664},{721,487}}
Now, the utilities will be updated using the affinities of the couples:
In[]:=
NewUtility=Utility〚1〛;​​Do[​​{a,b}=Couples〚t+1〛〚k〛;​​NewUtility〚a〛=A〚a,b〛;​​NewUtility〚b〛=A〚b,a〛,​​{k,1,Length[Couples〚t+1〛]}];​​Utility=Join[Utility,{NewUtility}];
Note that the initial average utility is approximate equal to
μ=0
,
In[]:=
Mean[Utility〚1〛]
Out[]=
0.000816446
However, the average utility at
t=1
is higher seems many agents started a relationship:
In[]:=
Mean[Utility〚2〛]
Out[]=
0.243302
Applying these simple decision rules and using this stochastic matching process we can evolve the system a number
T
of steps. Before doing this, let’s show our implementation of marriage.If the affinity between a couple is higher than a certain fixed value
Λ∈
, then the couple will not match with new agents in the next steps of the evolution. The difference in the implementation is that now, after getting Couples we will also construct the Married couples. For Λ=1 we would add
In[]:=
Λ=1;​​Married=Select[Couples〚t+1〛,A〚#〚1〛〛〚#〚2〛〛>Λ&&A〚#〚2〛〛〚#〚1〛〛>Λ&]
Then, in the next step t+2, the Married couples would not participate in the matching process. We can do this using
instead of “var” and “Matching” as we used before.
We collected all these material and constructed the StochasticMatchingModel function. Schematically we have:
StochasticMatchingModel[dist_,n_,μ_,σ_,μs_,σs_,Λ_,T_] {A,Utility,UtilityΛ,Couples,CouplesΛ,Married}
​
Input:
dist=Distribution used in the simulation, either “U”=Uniform or “N”=Normal/Gaussian;
n = Number of agents;
μ,σ = Mean and variance of the distribution that generates the off-diagonal elements of the affinity matrix;
μs,σs = Mean and variance of the distribution that generates the diagonal elements of the affinity matrix;
Λ = Parameter that defines marriage;
T = Number of steps of the simulaton.
​
Output:
A = Affinity matrix N x N;
Utility = Utility matrix U x T, where u〚t〛〚k〛 is the utility of agent k at step t in the system without marriage;
UtilityΛ = Utility matrix U x T, where u〚t〛〚k〛 is the utility of agent k at step t in the system with marriage;
Couples = List of length T, with Couples〚t〛 the set of couples at step t in the system without marriage;
CouplesΛ = List of length T, with Couples〚t〛 the set of couples at step t in the system with marriage;
Married=List of all agents who get married. Combined with CouplesΛ one can create a list with agents married at each step t.

2.2. Results

Now we will present the results obtained in our simulation for the Gaussian model with
First we run our StochasticMatchingModel simulation:
For comparison, we can run the simulation for the Uniform model and plot the evolution of average utility as above
We see that both results are very similar. Another quantity of interest is the fraction of couples. We have:
Still another quantity of interest is the total number of different partners that each agent had during the T steps of the simulation:
We already plotted the histogram for the simulation with marriage (Λ=1) and without marriage for comparison.
Now we want to compare the simulation for different values of Λ to see whether marriage can be beneficial or not.
First we run the simulation for different values of Λ:
We can plot the evolution of average utility in each system and we get:
Before moving to the next section, let us use the Graph function to summarize the evolution of our system in a visual way. First recall that the value of r〚4〛〚t〛 for each time, gives a list with the couples at step t (for the system without marriage), for example:
We can collect these lists for all times and make a Graph:
For the size of our society this graph is to large for visualization. Restricting to the first 14 steps we get
Isolated vertex, are agents that never started a relationship. Two vertex connected by more then one edge, are agents that kept a relationship by multiple steps. The number of vertex connected to a given vertex is the number of partners a given agent had.

2.3. Discussion, comments and empirical comparison

2.3.1 Men and women

A possible point of concern, is the fact that we did not distinguished man and woman in our model. To make explicit such a distinction, however, is not important for our conclusions. We can partition society into two, making matching just between agents not of the same group. For this situation, the matching is a random surjective function from the smallest partition to the largest one. A random subset of agents that make the large partition is left out from the matching process at each step. A slightly modification of our original implementation is sufficient for that and gives similar results.
which gives:

2.3.3. Homogeneity

It is then interesting to follow the evolution of average utility for these different sets of agents.
One finds that marriage is more beneficial to those that are not that liked. This agrees with intuition. If everyone likes you, you should not be concerned with marriage as a search strategy. It is easier for you to find a nice partner that also likes you and your mate is less likely to leave you because of someone else.

2.3.4. Empirical comparison

It is hard to measure the average utility in a real societies, but the number of married couples is not. By comparing the share of married couples in our model and reality we can test the adequacy of our model to describe reality. First, we download data from https://ourworldindata.org/marriages-and-divorces:
After organizing the data:
We can compare this values with what we obtain in our simulation:

3.1. Evolution equations for the Uniform model

3.1.1. Step 1

We can then compare the results with what we obtained with the simulations:

3.1.2. Step 2

Using the results for step 1 we can using NextStep again to find the results for step 2:
Again, we can compare the results obtained with data. We have:

3.1.3. Steps: 3, 4, and 5

3.2. Distribution for married couples:

In the model with marriage, married couples decouple from the system because they do not break. More precisely, they are not selected in the matching process. This sole fact, allows us to derive an expression for the utility distribution for married couples. Here we just compare the distribution we computed with the simulation: