U.E. LUTECE TP-09

From nature to engineering

# Emergence of sociality

## Emergence of segregationism

Thomas Schelling (1971) studied the dynamics of residential segregation to elucidate the conditions under which individual decisions about where to live will interact to produce neighbourhoods that are segregated by race. His model shows that this can occur even though individuals do not act in a coordinated fashion to bring about these segregated outcomes.

Schelling proposed a prototype model in which individual agents are of two types, say red and blue, and are placed randomly on the squares of a checkerboard. The neighbourhood of an agent is defined to be the eight squares adjoining his location. Each agent has preferences over the composition of his neighbourhood, defined as the proportion of reds and blues. In each period, the most dissatisfied agent moves to an empty square provided a square is available that he prefers to his current location. The process continues until no one wants to move.

The typical outcome is a highly segregated state, although nobody actually prefers segregation to integration. You may have a look at this very beautiful visualisation of the phenomenon.

The program Segregationism.py (in the directory Other/Segregationism ) implements agents of two types (red and blue) that move randomly. To run it, execute the local command starter and load the configuration file Segregationism.evo. The Configuration Editor allows you to change parameter values.

 Modify the method satisfaction called by decisionToMove in class Individual: agents inspect their neighbourhood (through the method InspectNeighbourhood), and decide whether to move away or not. Caveat: Python’s division may be understood as integer division when the operands are integers. Copy your modification in the box below.

Agents have only weak segregationist local behaviour, in the following sense: each agent wants at most 50% neighbours that differ from her/him; otherwise agents are indifferent. Implement the model and observe how segregation emerges. You may increase the value of DisplayPeriod in the Configuration Editor to speed up the simulation.

 Be sure to have loaded the configuration file Segregationism.evo. With the first solution to the previous exercise, for wich minimal value of Tolerance does segregation disappear?

 Set Tolerance to 80. What happens and why?

 Be sure to reload the configuration file Segregationism.evo to bring parameters back to standard values. Set neighbourhood radius from 1 to 4. Explain what we get with this larger value.

 Set neighbourhood radius to 10. Explain what we get.

 Restore default parameters and try 3 colours. Describe what happens.

#### Suggestions for further work

• Consider various kinds of initial states, including random states of various densities, and a regular chessboard with only the four corners free.
• Consider a probabilistic model, in which the probability to move smoothly increases with the number of neighbours that are different from self.
• Consider properties (e.g. sex) for which individuals look for opposites.
• Try to design an automated measure of clustering. Plot the curve of segregationism as a function of preference threshold.
• There is a Genetic Algorithm version of the program in the file SegregationismGA.py (launched by starterGA ). Note however that reproduction (triggered as soon as ReproductionRate is not zero) significantly slows the simulation down.

## Social bubbles

Social bubbles, also called filter bubbles, characterize a state of intellectual (or political or artistic...) isolation resulting from information bias. The phenomenon is to be observe when individual get information from their friends and tend to make friends among people who share the same kind of information. Recommender systems may amplify the phenomenon, as the content they suggest to you corresponds to what is selected by individuals who, in the past, have made choices similar to yours.

The simulation proposed here to illustrate the phenomenon is the most basic one may think of.

• Imagine a population of individuals distributed over two dimensions. These dimensions may be their preferences for certain kinds of movies (e.g. axis 1: contemplative → action, axis 2: drama → humour). People are initially uniformly distributed.
• Now films are proposed (green dots in the animation). A given film attracts individuals that are closest to it (this means that they are slightly more likely to watch similar films in the future).
• Moreover, people who are close to these individuals tend to see the movie as well and are attracted by it, and all the more so as they are close to several such individuals).
As a result, individuals tend to group into social bubbles corresponding to definite cinematographic preferences.

The program Bubbles.py (in the directory Other/Segregationism ) implements this scenario. To run it, execute the local command starter and load the configuration file Bubbles.evo. The Configuration Editor allows you to change parameter values.

Two parameters are crucial here:

• InfluenceRadius: a new film will influence individuals that are within this radius.
• NeighbourhoodRadius: an individual who saw the film will be imitated by people that are within this radius from her.
Try to find values for InfluenceRadius and NeighbourhoodRadius for which the social bubble phenomenon emerges.

## The hawk-dove dilemma

The existence of society supposes that violence remains contained. Can it be so in the absence of policing? Obviously, aggressive behaviour (intimidation) provides immediate payoff when performed against a non-aggressive victim. However, aggressors may loose a lot when confronting each other.
In Maynard Smith‘s hawk-dove game, possible interactions are hawk-hawk, dove-dove and dove-hawk. The matrix below gives the payoffs for strategies indicated in the first column:

 hawk dove hawk (V - C)/2 V dove 0 V/2

Two players confront each other over a resource whose full value is V to either of them. Each player may play one of two strategies: H (Hawk) or D (Dove). Doves signal that they wish to share the resource equally. Hawks signal they are willing to fight to get the resource. When two Doves meet, each gives the characteristic sharing signal and the resource is divided equally, or, perhaps, a fair coin is tossed and the winner gets all. In any case, the expected return to each of the two Doves is V/2. When a Hawk meets a Dove, the Hawk (as it always does) signals fight, the Dove (as it always does) signals share, then the Dove retreats and the Hawk takes the entire resource. Finally, when two Hawks meet, each signal fight, neither retreats, both fight at a cost of C. In the end, the resource is shared equally, minus the cost, or, perhaps, half the time one Hawk gets the entire resource and half the time the other Hawk gets it. In any case, the expected return to each of the Hawks is (V - C)/2.

 A Nash equilibrium characterizes a situation in which no player has any incentive to change strategy. Is DD a Nash equilibrium? (DD means that both players play D).

Nash         Not Nash     Nash if V > C     Nash if V < C

 Is DH a Nash equilibrium?

Nash         Not Nash     Nash if V > C     Nash if V < C

 Is HH a Nash equilibrium?

Nash         Not Nash     Nash if V > C     Nash if V < C

The solution of the dilemma between two actual players would be to choose a probabilistic strategy. In a population of players, the proportion of hawks stabilizes to a definite value which defines an evolutionarily stable strategy.

Launch Evolife from the Evolife directory with starter. Load the HawkDove.evo configuration. Choose appropriate values for the two parameters V and C (see in the Scenarios/DyadicGames/HawkDove section). Let the program run (button [Run]). Observe the proportion of hawks in the population and the number of peaceful (DD) encounters for various values of the two parameters. The meaning of curves is written in the Legend window.

For what follows, set parameters C and V such that C be significantly larger than V (e.g. 60 and 10).

 Open the S_HawkDove.py file (in the directory Scenarii) and locate the hawk() function. As you can see, the effect of noise is to blur the distinction between the two strategies. Set the noise level (in the Configuration Editor, Ecology section) to a significant value (e.g. 30). Observe and explain the effect of noise.

 The Hawk gene is currently coded using 1 bit in genemap. Make it gradual by using more bits (e.g. 10). Now, the gene indicates the probability of being hawk. Change the hawk function accordingly and copy the modified line in the box below.

 Restore values to default (e.g. relaod HawkDove.evo). What do you observe (you may display the genome window)? How do you explain?

#### Suggestions for further work

• Deterring signals - Magnus Enquist (Anim. Behav. 1985, 33, 1152-1161) showed that signalling one’s intention to attack may be a stable strategy:
Consider the following game in a population consisting of equal numbers of strong and weak individuals. Prior to the interaction the animals are assumed to be aware of their own strength but not of the opponent’s. The interaction proceeds in two steps. In the first step the opponents show [signals,] A or B. In the second step the animals may give up, repeat [signal] A and attack if the opponent does not withdraw, or attack directly independent of the opponent’s behaviour. If both animals attack, a short interaction will occur where strong animals always beat weak ones.
Consider now the following global strategy, denoted S. If strong, show A; if the opponent also shows A attack and if the opponent shows B, repeat A and attack only if it does not withdraw immediately. If weak show B and give up if the opponent shows A and attack if the opponent shows B.
(. . .)
if the cost to weak animals of being attacked by a strong animal is sufficiently large, S will be evolutionarily stable.
• Consider the possibility of faking signals (doves may wrongly signal that they are hawks). Genes are required to control which signal to emit, and how much confidence is put in others’ signalling. Signals may have costs.
• Signals may have intensities, associated with variable costs.

## Delayed cooperation

Launch Evolife from the Evolife directory with starter. Load the Cooperation.evo configuration. Let the program run (button [Run]). In the meantime, examine the S_Cooperation.py scenario (in the directory Scenarii) to see how this basic version of cooperation is implemented. Cooperative behavior is controlled by two genes: Cooperativeness and Exploration. The former controls the amount of wealth you give (at your own expense) to partners during encounters. Cooperative acts are rewarded, because if your gift was large enough for partners to remember you, they will choose you as partner when they are in position to make a gift themselves. However, it is in the interest of those partners to explore the rest of the group to see if there are some more generous individuals around. The exploitation/exploration compromise is controlled by the Exploration gene.
 Observe the evolution of both genes in the long term. The meaning of curves is given in the Legend window. Wait until cooperativeness significantly drops. How would you explain the phenomenon?

Visualize social links (shortcut ‘n’; you may alternatively uncomment the default_view line in S_Cooperation.py). In this view, individuals are displayed twice, on the lower and on the upper horizontal axis. Links connect individuals on the lower axis to individuals to the upper axis. Individuals are ranked by their cooperativeness (most cooperative to the right; see function update_positions ).

 From time to time, links are directed towards most cooperative individuals exclusively. On which occasions?

In the section Genetics of the Configuration Editor, change the GeneCoding parameter to Unweighted. Now, the bits of the genes are added up to give its value. A 10 bit gene may therefore have 11 different values, from 0 to 10 (instead of 2^10 = 1024 in the weighted condition). Run the simulation (button [Run]). Is it different? Why? You may visualize genomes (shortcut ‘g’).

 In the Genetics section of the Configuration Editor, set GeneLength to 5 instead of 10. Run the program again (button [Run]) and explain what happens.

[ Go to the discussion forum about cooperation ]

## Reciprocity

Reciprocal cooperation is one of the most studied problems in social sciences, economics and theoretical behavioural ecology, as it is often seen as a foundation of many social conducts. The basic scenario is as follows:
• Agent A makes the first move by offering a fraction of an amount G (gift) to agent B. This fraction is controlled by its gene g1. This gift involves a cost for A, which is proportional to the actual gift and to a constant C1.
• Agent B may reciprocate by offering a reward that is proportional to the received gift, to one of its own gene g2 and to a constant R. This rewarding behaviour has a cost, proportional to the reward and to a constant C2.
• Agents hold in memory the best partner previously encountered and try to interact with it again.
The third condition is crucial for cooperation to emerge. With amnesic players, the best strategy would be to let others make the first step and run away with their gift, as reciprocating would be mere charity. But if players can remember who does who does not reciprocate, then reciprocating is a way of being preferentially chosen as partner in the future.
A critical condition for cooperation to emerge is that:     $$\frac{G R}{C_1 C_2} > 1 + \frac{s(1)}{s’(1)}$$ (see proof there).
s(g2/g2m) is the probability for an individual with gene g2 to be selected as partner in a group in which this gene is on average g2m. The derivative s′(1) measures at equilibrium the marginal efficiency of the ability to detect cooperative agents.

This form of cooperation is still delayed (one agent must take the risk of making the first step), but this time it is the first agent who decides whether it should become friend with the partner.

Modify scenario S_Cooperation.py and implement the interaction. You need to specify two genes to control cooperation, one that controls the amplitude of the first move (g1) and another that controls the amplitude of the response (g2). The function Indiv.best_friend() returns the partner that made the best gift so far. In the interaction section, implement the symmetrical exchange and use the function Indiv.new_friend(Partner, PartnerOffer) that stores an asymmetrical friendship link from Indiv to Partner.

You may choose to reset the agent’s memory periodically, in the start_game function (use Indiv.detach( )). Note that partnership is not eternal anyway, due to natural death and migration. Set parameter Rounds to the number of times each individual will play the game within a season.

To control the second step, you may need to enable two additional parameters in the Configuration Editor. To do so, exit the Configuration Editor, manually edit EvolifeConfigTree.xml with your favourite editor to delete the two parasitic occurrences of the 'XXX' string and restart the Configuration Editor (starter).

 Copy the relevant lines of your function in the box below. You should still observe oscillations between the average values of the two genes. You may try to figure out why it is so.

 Models of cooperation are fundamentally unstable. In a cooperating world, there is an incentive for cheating. And yet, the human species seems to be characterized by its prosociality and generalized cooperativeness. You may share your thoughts about this apparent inconsistency.