30
U.U.D.M. Project Report 2013:25 Examensarbete i matematik, 15 hp Handledare och examinator: David Sumpter Augusti 2013 Department of Mathematics Uppsala University Evolutionary Language Games Linnéa Gyllingberg

Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

  • Upload
    others

  • View
    12

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

U.U.D.M. Project Report 2013:25

Examensarbete i matematik, 15 hpHandledare och examinator: David SumpterAugusti 2013

Department of MathematicsUppsala University

Evolutionary Language Games

Linnéa Gyllingberg

Page 2: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology
Page 3: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

Abstract

In the late 1940s game theory was invented. Originally the mathematicaltheory was used to describe economical behaviour, but in the 1970s game the-ory was applied to study evolutionary biology. During the last two decades amathematical framework describing the evolution of language has been devel-oped. We investigate how the mathematical theories from game theory andevolutionary dynamics can be used to describe the evolution of vocabulary.

i

Page 4: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

Contents

1 Introduction 1

2 Evolutionary Game Theory 22.1 What is Evolution? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22.2 What is Game Theory? . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.2.1 Nash Equilibrium . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Evolutionary Game Theory . . . . . . . . . . . . . . . . . . . . . . . 3

2.3.1 Evolutionarily Stable Strategies . . . . . . . . . . . . . . . . . 5

3 The Language Game 73.1 Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.1.1 Communication Payoff . . . . . . . . . . . . . . . . . . . . . . 73.1.2 Maximum Payoff . . . . . . . . . . . . . . . . . . . . . . . . . 73.1.3 Learning a Language . . . . . . . . . . . . . . . . . . . . . . . 83.1.4 Population Dynamics . . . . . . . . . . . . . . . . . . . . . . . 8

3.2 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.3 Simulations and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.3.1 Two Objects and Two Signals . . . . . . . . . . . . . . . . . . 103.3.2 Three Objects and Three Signals . . . . . . . . . . . . . . . . 123.3.3 Homonymy and Synonymy . . . . . . . . . . . . . . . . . . . . 133.3.4 Evolutionarily Stable Languages . . . . . . . . . . . . . . . . . 14

4 General Language Game 164.1 The Evolution of Vocabulary . . . . . . . . . . . . . . . . . . . . . . . 16

4.1.1 Different Learning Strategies . . . . . . . . . . . . . . . . . . . 164.1.2 Taking Advantage of Mistakes . . . . . . . . . . . . . . . . . . 164.1.3 Population Dynamics with Different Strategies . . . . . . . . . 17

4.2 Other Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

A Matlab code 20A.1 Two Object Two Signal Game . . . . . . . . . . . . . . . . . . . . . . 20A.2 Three Object Three Signal Game . . . . . . . . . . . . . . . . . . . . 23

ii

Page 5: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

1 Introduction

For billions of years information has been transferred genetically from one individualto another, from one generation to the next. Evolutionary biology is the study ofhow this information transfer changes over time and gives rise to new species [7,pp. 249-252]. For a long time, the primary information transfer was genetic. Aboutone million years ago human language started to evolve [7, p. 250]. Informationcould now be transferred by language and this gave rise to a new type of evolution:cultural evolution. How did humans evolve the ability to speak? Why did humansstart to talk? What gave rise to the complex features of human language?

To answer these questions several aspects of the evolution of language must bestudied. One way to try to answer these questions is by mathematical models.Theories to explain the evolution of language should explore three different aspects[9]. Firstly they should try to explain the evolution of the simplest communicationsystem. Secondly they should show how natural selection leads to the transitionfrom animal communication to human language by explaining the evolution of thesimplest properties that distinguish human language from animal communication.And thirdly they should explain how natural selection leads to the complex featuresof modern human language. This thesis deals with the first aspect.

1

Page 6: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

2 Evolutionary Game Theory

2.1 What is Evolution?

Ever since Charles Darwin published On the Origin of Species in 1859, the theoryof evolution has been one of the most fundamental theories in science. Darwin gavea simple scientific explanation for all the diversity in nature.

Some parts have of course been modified due to new discoveries, but the basicideas of Darwin still form the foundation of the theory of evolution today [1, p. 15].The theory of evolution spans over all fields of biology. All biological systems canbe interpreted in an evolutionary context.

All evolution requires three basic properties: reproduction, selection and muta-tion [7, p. 18]. Evolution needs populations of individuals that reproduce. Repro-duction is not perfect and mistakes occur during the reproduction. These mistakesare called mutations. Mutations give rise to different types of individuals; variationsarise. Some types will reproduce faster than others and selection will lead to thebiological diversity we see in nature.

2.2 What is Game Theory?

Game theory is a field of mathematics invented in the late 1940s by the mathemati-cian John von Neumann and the economist Oskar Morgenstein [3, pp. xiii-xv]. Itis the study of strategic decision making. The basic question to answer is: Whichstrategy should I use to maximize my payoff? In game theory, a game is usuallyrepresented by a matrix which shows the possible strategies for the players and thepayoff they get by playing the strategies. A simple, but yet very interesting, exam-ple of a game is the two-person two-strategies game The Prisoner’s Dilemma. ThePrisoner’s Dilemma is studied in various fields: economics, political sciences andphilosophy are just some examples.

The prisoner’s dilemma can be formulated in the following way: Two criminalsare suspected of committed a joint crime. They are both arrested and imprisonedand there is no possibility for them to talk to each other. The police does nothave enough evidence to convince a jury. The prisoners are left with two choices:either they can remain silent or they can confess the crime and testify against theirpartner. If both confess, then both of them are sentenced to one year in prison.If one confesses and testifies against the other, while the other remains silent, theconfessing prisoner is set free and the other one is sentenced to ten years in prison.If they both remain silent, they serve seven years in prison.

This can be represented with the payoff matrix in Figure 1.

2

Page 7: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

-1 -10

-1 0

0 -7

-10 -7

Remain silent Confess

Remainsilent

Confess

Prisoner B

Pri

soner

A

Payoff Matrix

Figure 1: Payoff matrix for The Prisoner’s Dilemma

2.2.1 Nash Equilibrium

An important idea in game theory is the concept of Nash equilibrium that wasdeveloped by the American mathematician John Nash in the early 1950s [7, pp.51-53]. A Nash equilibrium can be described by the following example: Consider atwo player game. If both players play a strategy that is a Nash equilibrium, thenneither of the players can receive a higher payoff by changing only his own strategy.

Now consider The Prisoner’s Dilemma and the payoff matrix in Figure 1. Whatis the Nash equilibrium? If both remain silent, each player can improve their ownpayoff by confessing. If both confess, then none of them can increase their payoffby switching strategy. Hence, both players confessing is a Nash equilibrium. Thereare various types of games in game theory, zero-sum and non-zero-sum games, com-binatorial games and differential games are just some examples. Depending on thetype of game, there are different formal definitions for a Nash equilibrium.

2.3 Evolutionary Game Theory

Originally game theory was used to describe economic behaviour, but in the 1970sgame theory was applied on biology by John Maynard Smith and George Price [7,p. 46] to describe evolutionary biology. When applied to economics, business andpolitical sciences, game theory is the study of mathematical models that describestrategies by intelligent rational decision-makers. Evolutionary biology does notrequire rational game players, instead it considers a population of individuals withfixed strategies interacting in a game [7, pp. 46-70]. The strategies can denotedifferent types of features or qualities.

The simplest way to describe an evolutionary strategy is by a game with twostrategies, A and B, in a population. Let xA denote the frequency of individualsplaying strategy A, and xB denote the frequency of individuals playing strategyB. Then ~x = (xA, xB) defines the composition of the population. By denoting thefitness of A and B fA(~x) and fB(~x) respectively, the dynamics of the population canbe described as

xA = xA(fA(~x)− (xAfA(~x) + xBfB(~x)))

xB = xB(fB(~x)− (xAfA(~x) + xBfB(~x)))(1)

3

Page 8: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

Since xA and xB denote the frequency of the individuals using strategy A andB respectively, xA + xB = 1. Introducing the new variable x with xA = x andxB = 1− x, the system (1) can be rewritten as to

x = x(1− x)(fA(~x)− fB(~x)) (2)

A game with two strategies is usually described by a payoff matrix:

A B( )A a bB c d

(3)

The payoff matrix is not read in the same way as the payoff matrix in Figure 1.The meaning of the payoff matrix is that an A player gets payoff a when playingwith another A player, and payoff b playing against a B player. A B player getspayoff c and d, playing against an A player and a B player, respectively. From thispayoff matrix we get that the fitness for the different types of individuals is givenby

fA = axA + bxb

fB = cxA + dxB(4)

By using the variable change xA = x and xB = 1− x we get

fA = ax+ b(1− x) = (a− b)x+ b

fB = cx+ d(1− x) = (c− d)x− d(5)

Inserting the fitness functions into equation (2) we get the dynamics to be

x = x(1− x)(fA − fB) = x(1− x)(((a− b)x+ b)− ((c− d)x− d)

= x(1− x)((a− b− c+ d)x+ b− d)(6)

The equilibrium points of this differential equation is x∗ = 0, x∗ = 1 and x∗ =(d− b)/(a− b− c+ d).

Since x denote the frequency of A players in the population, x ∈ [0, 1]. For somevalues of a, b, c and d the third equilibrium point, x∗ = (d− b)/(a− b− c+ d), willnot be in the interior of [0, 1]. For the inequality 0 < d−b

a−b−c+d< 1 to be satisfied,

either a > c and b < d, or a < c and b > d.To determine the stability of the steady states, we start with evaluating the

Jacobian of equation (6) for the different steady states:

J =dx

dx=

d

dx(x(1− x)((a− b− c+ d)x+ b− d) (7)

= 2x(a− b− c+ d) + (b− d)− 3x2(a− b− c+ d)− 2x(b− d) (8)

An equilibrium point, x∗ is stable if J |x=x∗ < 0 and unstable if J |x=x∗ > 0. Forx∗ = 0 we have:

J |x=0 = b− d (9)

4

Page 9: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

So x∗ = 0 is stable when b > d and unstable when b < d. The Jacobian of the fixedpoint x∗ = 1 is:

J |x=1 = 2(a− b− c+ d) + (b− d)− 3(a− b− c+ d)− 2(b− d) = −a+ c (10)

Hence x∗ = 1 is stable when a > c and unstable when a < c. For x∗ = (d− b)/(a−b− c+ d) we have:

J |x= d−ba−b−c+d

=(a− c)(d− b)a− b− c+ d

(11)

When a < c and b > d, x∗ = d−ba−b−c+d

is stable and when a > c and b < d, it isunstable. If a = c and b = d then the differential equation (6) is x = 0, and hencethe frequency of A players and the frequency of B players is always constant.

Depending on the parameters a, b, c and d there are five possible cases for thesteady states of equation (6):

(i) If a > c and b > d there are only two equilibrium points x∗ = 1 and x∗ = 0.x∗ = 1 is the only stable point and hence all the B players of the populationwill become extinct.

(ii) If a < c and b < d there are also just two equilibrium points, x∗ = 1 andx∗ = 0, as in (1), but x∗ = 0 is always stable. No matter how small frequencyof B players there is in the beginning, A players will always become extinct.

(iii) If a > c and b < d, then x∗ = (d − b)/(a − b − c + d) ∈ [0, 1] and will beunstable. Both x∗ = 1 and x∗ = 0 will be stable. The outcome depends on theinitial condition.

(iv) If a < c and b > d, then x∗ = 0 and x∗ = 1 will be unstable. x∗ = (d− b)/(a−b − c + d) will be in the interior of [0, 1] and will be stable. Hence A playersand B players will coexist.

(v) If a = c and b = c the frequency of A players and B players is always constant.

Now consider the concept of Nash equilibrium. For the strategies of the evolu-tionary game described by matrix (3) we have:

(i) A is a strict Nash equilibrium if a > c

(ii) A is a Nash equilibrium if a ≥ c

(iii) B is a strict Nash equilibrium if d > c

(iv) B is a Nash equilibrium if d ≥ b

2.3.1 Evolutionarily Stable Strategies

Unaware of the Nash equilibrium in game theory, the British biologist John MaynardSmith invented the concept of evolutionarily stable strategy (ESS) [7, pp. 53-55].Consider a large population of A players. A single B player is introduced in thepopulation. The game between A and B is again given by the payoff matrix (3). The

5

Page 10: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

question which the concept of ESS answers is the following: What are the conditionsto oppose an invasion of B players into the population of A players? The answer isgiven by the conditions that make the equilibrium point x∗ = 1 from equation (6)stable. In this particular evolutionary game, the concept of ESS can also be derivedin the following way:

Assume that there is an infinitesimally small fraction of B players in the pop-ulation. The frequency of B will be ε and the frequency of A will be 1 − ε. Thefitnesses for A and B is given by equation (6). If A will resist an invasion of B, thefitness of A must be greater then the fitness of B.

a(1− ε) + bε > c(1− ε) + dε (12)

After cancelling the ε terms, the inequality leads to

a > c (13)

But if a = c the inequality (12) leads to

b > d (14)

So for the strategy A to be ESS either a > c or a = c and b > d.

For a general evolutionary game a strategy is ESS if it is a strict Nash equilibriumand it is a Nash equilibrium if it is ESS [7, p. 55]:

Strict Nash⇒ ESS⇒ Nash

6

Page 11: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

3 The Language Game

In the article ”The Evolutionary Language Game”, Martin Nowak, Joshua Plotkinand David Krakauer investigate how evolutionary game dynamics must be modifiedto be able to describe evolution of language [6]. They study the evolution of thesimplest language system by exploring how signals can evolve to become associatedwith different objects and compare different learning strategies. I have reproducedpart of their work and studied the language dynamics for some special cases.

3.1 Model

We consider a group of individuals. Information can be transferred about n objects.An object can be an animal, an event, a person or anything else that can be referredto. There are m possible signals for describing these n objects. For each individualin the population there is an n×m probability matrix P and an m× n probabilitymatrix Q. P , also called the active matrix, has the entries pij, which represents theprobability that a speaker associates object i with sound j. For the active matrix,rows represent objects and columns represent sounds. An individual will alwaysproduce a signal when seeing an object which means that all rows of P will sum upto one.

The passive matrix Q has entries qji that denotes the probability of a listener tothink of object i when hearing sound j. An individual will always think of an objectwhen hearing a signal, leading to the rows of Q, just like P , sums to 1. Hence wehave

m∑j=1

pij = 1 andn∑

i=1

qji = 1

3.1.1 Communication Payoff

Each individual Ii has a language Li given by Pi and Qi. For two individuals I1and I2 with languages L1 and L2, p

(1)ij denotes the probability for I1 to make sound

i when seeing an object j whereas q(1)ji denotes the probability for I1 to infer object

i when hearing sound j. For individual I2 these probabilities are given by p(2)ij and

q(2)ji . The probability for individual I1 to communicate object i to individual I2 is

given by∑

j p(1)ij q

(2)ji . The total communication payoff between the two individuals

sums these probabilities for all objects and then takes the average of the reversedsituation. This leads to a communication payoff described by

F (L1, L2) =1

2

m∑i=1

n∑j=1

p(1)ij q

(2)ji + p

(2)ij q

(1)ji (15)

3.1.2 Maximum Payoff

Since the equation evaluates both ability of I1 to transfer information to I2 andvice versa, there is a symmetry of the language game: F (L1, L2) = F (L2, L1). The

7

Page 12: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

maximum payoff is obtained when two individuals speak the same language. Forlanguages where n = m, the maximum payoff is Fmax(L,L) = n.

The maximum payoff is obtained when P is a permutation matrix and Q = P T .A permutation matrix is a binary matrix with exactly one 1 in each row and in eachcolumn.

3.1.3 Learning a Language

As in real life, this model assumes that individuals learn their language by listeningto other individuals and then imitating them. Every individual undergoes a learningphase. During the learning phase it constructs an association matrix, A. A isan n × m matrix with entries aij which determines how often an individual hasheard other individuals referring to object i with the sound j. Assume that anindividual, I2, is learning from another individual, I1. The association matrix isentirely constructed from the active matrix of I1; P1. How I1 understands a language,Q1, is not considered. In real life, language learning is a complex process thatcontinues through life. In this model the learning phase is considered to last ktimes, meaning that I2 samples the responses of I1 to each object k times beforedeveloping her own language. From the association matrix, the active matrix andthe passive is then constructed by normalizing rows and columns respectively:

pij =aij∑ml=1 ail

(16)

qji =aij∑nl=1 alj

(17)

If I1 never uses signal j for any word, the j:th column of the association matrix of I2will sum up to 0. Hence some elements of the passive matrix of I2 will be undefined,if Q is constructed as described in equation (16). The teacher not using a signalj should lead to the learner associating all objects with the same probability whenhearing signal j:

qj1 = qj2 = ... = qjn =1

nwhen

n∑l=1

alj = 0 (18)

3.1.4 Population Dynamics

Now consider a group of N individuals with languages L1 to LN . Each individualtalks to every other individual. The total payoff for each individual is obtained bysummarizing the communication payoff and dividing it with the number of individ-uals they talk to:

FI =

∑J

F (LI , LJ)

N − 1(19)

where J ∈ {1, ..., N} \ {I}.There are different learning strategies for newborn individuals. They can learn

from their parents, they can learn from role models in the population or they canlearn from random individuals in the previous generation. Depending on the learning

8

Page 13: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

strategies of the population, the payoff is used in different ways. Regardless of thelearning strategy, there are discrete generations - children always learn their languagefrom the previous generation and there is always the same number of individuals inthe next generation as in the previous.

When considering parental learning, communication payoff is interpreted as bi-ological fitness. Individuals with high payoff will produce more offspring than in-dividuals with lower payoff. The probability that a particular individual from thenext generation has individual I as their parent is given by

FI∑J FJ

where J ∈ {1, ..., N}.

3.2 Implementation

To implement this model I used Matlab. The code is presented in Appendix A.Initialization: Create an initial population, G(0) with N individuals. Each

individual i has a n×n P (i) matrix and a n×n Q(i) matrix. The P and Q matricesare either randomly generated or they can be stated in the beginning.

Iteration:

1. Evaluate the communication payoff for each individual for population G(i) asdescribed by equation (19). Store the fitness.

2. Create a new generation, G(i + 1) with N individuals. Create an associationmatrix A, an active matrix P and a passive matrix Q for each individual. Allare zero matrices.

3. Each individual of generation G(i+ 1) chooses a parent from generation G(i)selected by their communication payoff. The probability of individual I ingeneration G(i) being selected as parent for an individual in generation G(i+1)is FI∑

J FJ.

4. Each individual from G(i + 1) learns from her parent. The learner listens toher parent k times and constructs their association matrix A as described insection 3.1.3.

5. Construct the active and passive matrices for each individual from their asso-ciation matrices according to equations (16). If any row of A sums up to 0,then Q is constructed according to (18).

6. Replace population G(i) with population G(i+ 1). Return to 1.

The average payoff for each generation is stored and then the communication payoffis plotted against generations.

9

Page 14: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

3.3 Simulations and Analysis

3.3.1 Two Objects and Two Signals

0 10 20 30 40 50 60 70 80 90 1000.8

1

1.2

1.4

1.6

1.8

2

Time

Pay

off

k = 1

(a) k = 1

0 10 20 30 40 50 60 70 80 90 1000.8

1

1.2

1.4

1.6

1.8

2

TimePay

off

k = 5

(b) k = 5

0 10 20 30 40 50 60 70 80 90 1000.8

1

1.2

1.4

1.6

1.8

2

Time

Pay

off

k = 10

(c) k = 10

0 10 20 30 40 50 60 70 80 90 100

1.3

1.4

1.5

1.6

1.7

1.8

1.9

2

Time

Pay

off

k = 30

(d) k = 30

Figure 2: Simulation of parental learning for a 2-object 2-signal game. There areN = 100 individuals in population and 50 simulations.

I started the simulations with looking at a two object two signal game. Both P andQ are 2 × 2 matrices. In some simulations they were randomly generated in thebeginning, in other simulations the first P and Q matrices were given. In Figure 2parental learning for four different values of k is simulated 50 times for each valueof k. The average payoff for each generation is plotted against time. The maximumpayoff for the two object two signal game is 2, as described in section (3.1.2). Whenall the individuals of a population speak the same language with the maximumpayoff, there is no ambiguity in the language. Every object can be described byexactly one word and every word describe exactly one object. In Figure 2a themaximal payoff was in average reached only after 10 generations. With k = 5,the convergence to a common language is slower; it takes about 20 generation inaverage before the total communication payoff is 2. The larger k is, the slower theconvergence is to a common language. Since the individuals with the high payoff

10

Page 15: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

are more likely to have children than individuals with low payoff, selection will leadto a population with a better language. But in some of the simulations, the payoffstays at 1. This is the case when k = 1 and k = 10, but not when k = 5 and k = 30.

All simulations in this thesis are stochastic processes with absorbing states. Anabsorbing state is a state, once being entered, it cannot be left. For this model, allabsorbing states will be languages where P is a binary matrix. This is because ofthe learning process:

When an individual I1 has a binary matrix P1, the association matrix for anindividual I2 learning from I1, will always lead to a binary active matrix. Forexample, consider a two object two signal game where I1 has an active matrix

P1 =

(1 00 1

)The association matrix for an individual learning from I1 by listening

k times will look like A2 =

(k 00 k

)and hence lead to the active matrix P2 =

(1 00 1

)All individuals in a population speaking the same language with payoff 1, implies

that they all have an active matrix with two ones in one column: P =

(1 01 0

)or

P =

(0 10 1

). These matrices are binary and hence they are also absorbing states.

When all individuals in a population speak the same language with payoff 1,selection will not result in a better language. Why is then the convergence to acommon language slower when k increases?

When k = 1 the association matrix of the learning individual I2 will always bebinary. A binary association matrix A2 will lead to a active matrix P2 = A2 . Ask increases, the probability for P2 being binary decreases. When k → ∞, P1 andP2 will be exactly the same matrices. As all absorbing states are languages withbinary matrices, as stated before, the smaller k is, the faster a common languagewill evolve. Does the value of k affect the number of simulations ending up ina suboptimal absorbing state? This is hard to determine from the simulations inFigure 2. An answer to this question can be seen in the simulations of a three objectand three signal game for different values of k.

11

Page 16: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

3.3.2 Three Objects and Three Signals

0 10 20 30 40 50 60 70 80 90 1000.5

1

1.5

2

2.5

3

Time

Pay

off

k = 1

(a) k = 1

0 10 20 30 40 50 60 70 80 90 1000.5

1

1.5

2

2.5

3

Time

Pay

off

k = 5

(b) k = 5

0 10 20 30 40 50 60 70 80 90 1000.5

1

1.5

2

2.5

3

Time

Pay

off

k = 10

(c) k = 10

0 10 20 30 40 50 60 70 80 90 1000.5

1

1.5

2

2.5

3

Time

Pay

off

k = 30

(d) k = 30

Figure 3: Simulation of parental learning for a 3-object 3-signal game. There areN = 100 individuals in population and 50 simulations.

In the three object three signal language game n = m = 3, so the active and passivematrices are 3× 3 matrices. Figure 3 shows simulations for this game with differentvalues of k. As in the previous simulations for the two object two signal game, foreach value of k there are 50 runs. The maximum payoff in the three object threesignal game is of course 3. The absorbing states are languages with payoff 1, 2 or 3.All runs either end up with fitness 2 or with fitness 3. A language with fitness 3 is anunambiguous language: P and Q are permutation matrices. As for the two objecttwo signal game, the lower value of k, the faster the language tends to developinto an absorbing state. What also can be noticed in Figure 3 is that there is asmall difference in the number of runs that end up in a suboptimal absorbing statedepending on the value of k. For a small value of k, more runs seem to end up in asuboptimal absorbing state. To explain why, we have to consider the learning processagain. When k = 1, the association matrix of a learning individual will always bebinary, as explained earlier. Even though the active matrix of a teaching individualmight be asymmetric and favour an unambiguous language, the probability for the

12

Page 17: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

learning individual to have an active matrix giving a suboptimal language is highwhen k = 1. For example, consider an individual I2 in the two object two signal

game learning from individual I1. I1 has an active matrix P1 =

(0.9 0.10.2 0.8

). The

probability for I2 active matrix to look like P2 =

(1 01 0

)is quite low, but it is much

higher when k = 1 than when k = 30.

3.3.3 Homonymy and Synonymy

Synonymy is when a word has the same meaning as another word. Homonymy iswhen a word has several meanings. In linguistics, it is generally understood thatsynonyms are rare [6]. Homonyms are on the other hand frequent. It is easy tofind examples of homonyms, but hard to find examples of synonyms. Can theevolutionary language game provide an explanation to this? In the context of thelanguage game, synonymy is when a object can be referred to by several signals andhomonymy is when a signal can be used to describe several objects.

0 10 20 30 40 50 60 70 80 90 1000

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2

Time

Pay

off

(a) Homonymy: P =

(1 01 0

) 0 10 20 30 40 50 60 70 80 90 1001.1

1.2

1.3

1.4

1.5

1.6

1.7

1.8

1.9

2

Time

Pay

off

(b) Synonymy: P =

(0.5 0.50.5 0.5

)Figure 4: Simulation of parental learning for a two object two signal game withinitial conditions for homonymy and synonymy.

Homonomy is represented by a binary matrix with more than one 1 in a column.Figure 4 shows simulations of homonymy and synonymy in the two object and twosignal game. In Figure 4a all individuals in the population started with an active

matrix P =

(1 01 0

)and a passive matrix Q =

(0.5 0.50.5 0.5

). In all simulations k = 5.

There were ten runs and all runs ended with all individuals in the last generationhaving exactly the same active and passive matrices as the individuals in the firstgeneration. This is not surprising at all. Homonymy is represented by a binarymatrix, and as explained previously a language with an active matrix being binaryis an absorbing state.

Synonymy refers to the case where there is more than one non-zero entry in acolumn. In Figure 4b all individuals had a language containing two synonyms in

13

Page 18: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

the beginning: P =

(0.5 0.50.5 0.5

)and Q =

(0.5 0.50.5 0.5

). Both the objects could be

referred to by both the words. After just 10 generations, the synonyms were gone

and the population spoke an unambiguous language with either P =

(1 00 1

)or

P =

(0 11 0

).

Synonymy seems to be unstable. To understand why, consider the followingactive matrix in the one object two signal game: P = (0.5 0.5). Here one objectcan be referred to by two sounds. This situation is not stable. When k = 1, the nextgeneration will have a binary active matrix. For k > 1, the next generation will notnecessarily have binary matrices, but binomial sampling will lead to the new activematrices being more asymmetric than the former. Which eventually, will lead tobinary matrices.

3.3.4 Evolutionarily Stable Languages

We have seen that all languages which are absorbing states have binary active matri-ces. But are some binary matrices better than other? Novak and Trapa investigatesthis question by introducing the concepts Nash equilibrium and evolutionarily stablestrategies into the language game [9]. By following the definitions of game theorythey define Nash equilibrium for the language game:

A language L is a strict Nash equilibrium if

F (L,L) > F (L,L′) ∀ L 6= L′

and a Nash equilibrium if

F (L,L) ≥ F (L,L′) ∀ L 6= L′

In section 2.3.1 we derived the concept of evolutionarily stable strategies. Novakand Trapa define an evolutionarily stable language.

A language L is an evolutionarily stable strategy if

F (L,L) > F (L,L′) ∀ L 6= L′

or ifF (L,L) = F (L,L′) then F (L,L′) > F (L′, L′)

Strict Nash equilibria and evolutionarily stable strategies are always fixed pointsof evolutionary dynamics. This means that all Nash equilibria and ESS must beabsorbing states, but exactly which languages are Nash equilibria and which areESS? They show that the conditions for a language to be a strict Nash equilibriumare rather restrictive. Only unambiguous languages, where each signal refers toexactly one object and one object can be referred to by exactly one signal are Nashequilibria. This means that L is a Nash equilibrium if and only if n = m and P isa permutation matrix and Q = P T .

In evolutionary game theory strict Nash implies ESS. But in this particulargame a language is ESS if and only if it is strict Nash [9]. This means that the

14

Page 19: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

only evolutionarily stable languages are languages where P and Q are permutationmatrices and Q = P T .

Simulations for exploring these properties are shown in the figure below.

0 10 20 30 40 50 60 70 80 90 1001.8

2

2.2

2.4

2.6

2.8

3

Time

Pay

off

(a)

0 10 20 30 40 50 60 70 80 90

2.88

2.9

2.92

2.94

2.96

2.98

3

TimePay

off

(b)

Figure 5: Simulation of three object three signal game with initial conditions.

In Figure 5a, 98 of the 100 individuals speak a language L1 with one homonym:

Pi =

1 0 00 1 01 0 0

and Qi =

1/2 0 1/20 1 0

1/3 1/3 1/3

for i = 1, .., N − 2.

Two of the individuals speak an unambiguous language L2:

Pi =

1 0 00 1 00 0 1

and Qi =

1 0 00 1 00 0 1

for i = N − 1, N − 2. After 50 runs we can see that for most of the runs, allindividuals speak the unambiguous language after a number of generations. This iswhat to expect: the language L1 is not evolutionarily stable, but the unambiguouslanguage L2 is. The evolutionary process is stochastic, so some of the runs still endup with all individuals speaking language L1 after a number of generations.

In Figure 5b the initial conditions are the opposite: 98 of the individuals speaklanguage L2 and 2 of the individuals speak language L2. In all 50 runs after a fewgenerations, all individuals speak language L2, as expected.

15

Page 20: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

4 General Language Game

4.1 The Evolution of Vocabulary

4.1.1 Different Learning Strategies

In the article ”The Evolutionary Language Game”, Novak, Plotkin and Krakauerstudied how different learning strategies affected the population dynamics [6]. Theindividuals talked about n = 5 objects and used m = 5 sounds in the simulations.One benefit with using n = m = 5 is that there are more absorbing states. Withn = m = 2 there is only one other absorbing state except for the maximum fitness,and with n = m = 3 there are only two other absorbing states. Using n = m = 5leads to more interesting dynamics. Their simulations of parental learning leads tosimilar results as the simulation in section 3.3: the smaller value of k the faster thepopulation evolves a common language, but the likelier the process is to end up inan suboptimal absorbing state.

After investigating the population dynamics for parental learning, Novak et al.study the dynamics for role model learning and random learning. Role modelsare individuals with high fitness. Each individual imitates K individuals from theprevious generation with high fitness. When K = 1, the implementation leads to anidentical model as for parental learning. For K > 1 the convergence to a commonlanguage takes longer than for K = 1, but reaches in average a higher payoff.

The last learning model investigated is random learning, meaning that individ-uals imitate random individuals from the previous generation, regardless of theirpayoff. This means that there is no reward for higher payoff and therefore no selec-tion for better languages. But still random learning lead to sufficient communicationsystems. This is because the absorbing states of this stochastic process is binary ma-trices. The binary matrices have on average higher payoff than matrices containingentries which numbers are between 0 and 1.

4.1.2 Taking Advantage of Mistakes

In daily life, language mistakes are made both while learning a language and whentalking to other persons. Novak et al. introduce errors in the language acquisition,and hence study the effects of mistakes in the learning process. Assume that withprobability ρ, a learning individual misunderstands the response of another indi-vidual. Instead the learning individual registers another randomly chosen response.Thus the probability for the learning individual to make the correct entry into herassociation matrix is 1− ρ.

Novak et al. simulates the population dynamics for four different error levels,ρ = 0.0001, 0.001, 0.01 and 0.1. When the error level is low, ρ = 0.0001 andρ = 0.001, the dynamics resembles the dynamics without any noise. When ρ = 0.01the only absorbing state for parental learning is languages with maximum payoff.With this rate of mistake, the errors prevent the language from getting caught in asuboptimal absorbing state. For ρ = 0.1 the probability of making mistakes is toohigh to improve the evolution of a common language, instead the all simulationslead to a fluctuated fitness which always was rather low. This implicates that there

16

Page 21: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

is an optimum error rate for the evolution of a common language.

4.1.3 Population Dynamics with Different Strategies

In evolutionary game theory the population dynamics for populations with differentstrategies is studied. Offspring inherit the strategy from their parents and their fit-ness is determined by their strategy, as described in section 2.3. In the evolutionarylanguage game, the strategy children inherit is not the language, but the languageacquisition. So what will happen with a population using mixed strategies?

Novak et al. consider a population where 20% learn their language from theirparent and 80% acquire the language from random individuals. To begin with, thelanguage of all individuals is just random matrices. As generations pass the fractionof random learners declines and a common language evolves. Their simulationsshow that parental learning is a much more efficient learning strategy than randomlearning when it comes to rapidly evolve a language with high communication payoff.But as soon as a common language has evolved, there is no selection against randomlearning individuals. This can be interpreted as an example of neutral drift.

The outcome of the competition between random learning and parental learningwas not unexpected. But which strategy is the better when comparing parentallearning to role model learning? As explained in section 4.1.1 there is no differencein the algorithm for the language acquisition between parental learning and rolemodel learning when K = 1, where K is the number of role models. To study thedynamics for the strategies competing, they simulated the competition between thestrategies that learn from their parent and M other individuals with high fitness.They did 100 runs with M from 0 to 4, all starting with equal proportions. M = 0means pure parental learning. 36 runs of the simulation converged to a homogeneouspopulation with either M = 1, 2, 3 or 4, 55 runs converged to a homogeneouspopulation with individuals just learning form their parents and nine runs convergedto a population with mixed learning strategies. This implicates that there is nota big difference between learning your language from your parent or from severalsuccessful individuals.

4.2 Other Studies

Several other studies have used the same model to investigate different aspects of lan-guage evolution. One approach to the evolutionary language game is made by KennySmith [8]. He investigates how different learning biases affect the language dynam-ics. Learning biases are assumed to be genetically transferred. There are three typesof biases: learning rules that are biased in favour of acquiring homonyms, learningrules biased against acquiring homonyms and learning rules neutral to homonymy.As described in section 3.3.3, homonymy is a many-to-one mapping between mean-ings and signals. We have showed that synonymy is rare, but homonymy is plentifulin language. Smith shows with simulations that, after a few generations, populationswith a learning bias favouring one-to-one mapping have better optimized languagesthan populations with a learning bias favouring homonymy. These results hold bothfor individuals learning their language from random individuals and for individuals

17

Page 22: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

learning from role models. Finally Smith investigates the evolution of learning bi-ases. He finds that the only evolutionarily stable learning bias is the one in favour ofunambiguous language. This outcome is similar to results of Nowak’s and Trapa’swork about Nash equilibrium of the evolutionary language game [9]: as describedearlier they show that the only evolutionarily stable languages are unambiguous.

The model used for all the studies previously discussed is only relevant for study-ing the evolution of vocabulary. Vocabulary is only one of many interesting partsof the human language. Syntax, grammar and speech are some examples of whatneed to be studied to understand the complex process of language evolution.

The evolution of syntax is studied by Nowak, Plotkin and Jansen [5]. Whileother animals use signals to refer to whole situations, human language is syntactic.To understand what caused the transition from non-syntactic to syntactic languagethey use a model to describe how words spread in a population using non-syntacticcommunication. The model is similar to the SIR-model used to describe diseasespreading in a population [2, pp. 83-115]. They then use the same model to describeword spreading in a population with syntactic communication and investigate whena syntactic language leads to higher payoff than a non-syntactic language. Theresults suggest that the essential step that lead to the transition non-syntactic tosyntactic communication was the increase of relevant events that could be referredto.

Another language feature also studied by Nowak, together with Komarova andNiyogi, is the evolution of a universal grammar [4]. Universal grammar is a theoryby the American linguist Noam Chomsky [7, pp. 262-263] who claims that theability to learn grammar is native. By using formal language theory and replicatordynamics from evolutionary game theory they try to find an explanation for theevolution of an universal grammar.

In conclusion, this thesis has described a mathematical model used to explainthe evolution of vocabulary. The mathematics of the model is based on game theorygenerally and evolutionary game theory specifically. By evolutionary game theoret-ical notions such as Nash equilibrium and evolutionarily stable strategies, linguisticphenomena such as homonymy and synonymy were analysed. As stated in the be-ginning, to understand the evolution of human language, different aspects has to beconsidered. A mathematical framework for the evolution of a simple vocabulary isjust one of them. There are several studies that developed mathematical models tounderstand other aspects of the evolution of language. And hopefully, there will beeven more research in this field where mathematics, biology and linguistics meet,resulting in a more profound picture of the evolution of human language.

18

Page 23: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

References

[1] Mats Bjorklund. Evolutionsbiologi. Studentlitteratur, Lund, 2005.

[2] Nicholas F. Britton. Essential Mathematical Biology. Springer, 3rd edition, 2005.

[3] Morton D. Davis. Game Theory - A Nontechnical Introduction. Dover Publica-tions, Mineaola (NY), 1997.

[4] Martin A. Nowak Natalia L. Komarova and Partha Niyog. Computational andevolutionary aspects of language. Nature, 417:611–617.

[5] Joshua B. Plotkin Martin A. Nowak and Vincent A. A. Jansen. The evolutionof syntactic communication. Nature, 404:495–498, 2000.

[6] Joshua B. Plotkin Martin A. Nowak and David C. Krakauer. The evolutionarylanguage game. J. Theor. Biol., 200:147–162, 1999.

[7] Martin A. Nowak. Evolutionary Dynamics: Exploring the Equations of Life.The Belknap Press of Harvard University Press, Cambrige, Massachusettes andLondon, England, 2006.

[8] Peter Smith. The evolution of vocabulary. J. Theor. Biol., 228:127–142, 2004.

[9] Peter E. Trapa and Martin A. Novak. Nash equilibrium for an evolutionarylanguage game. J. Math. Biol., 41:172–178, 2000.

19

Page 24: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

A Matlab code

A.1 Two Object Two Signal Game

1 % Population dynamics for parental learning2

3 clear all4

5 figure(1)6 hold on7

8 for t=1:50 % Number of simulations9

10 N = 100; % Number of individuals in the population11

12 P1 = [];13

14 a=rand(1,N); % Random entries for active matrix15

16 b=rand(1,N); % Random entries for active matrix17

18 for i=1:N %Create N active matrices19 P1{i} = [a(i) 1-a(i); b(i) 1-b(i)];20

21 end22

23 c=rand(1,N); %Random entries for passive matrix24

25 d=rand(1,N); %Random entries for passive matrix26

27 for i=1:N %Create N passive matrices28 Q1{i} = [c(i) 1-c(i); d(i) 1-d(i)];29

30

31 end32

33

34 F1 = zeros(1,N); % Create a fitness matrix with 1 row and N ...columns.

35 for i=1:N36 %Goes through the languages of each individual37 for m=setdiff([1:N],i)38 % Calculate the fitness between each indiviual39 for k=1:240 % Calculate the fitness41 for j=1:242 F1(i)=F1(i)+0.5*(P1{i}(k,j)*Q1{m}(j,k)+P1{m}(k,j)*Q1{i}(j,k));43 end44 end45 end46 F1 = F1./(N-1);47 end48

49 F1 = F1./sum(F1); %

20

Page 25: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

50

51 f=cumsum(F1);52

53

54 G = 100; %Number of generations55

56 % Create the next generation57

58 F = zeros(G,N);59

60 for l=1:G % Go through the process for a number of generations61 l62

63 for i=1:N % Create N active matrices64 P2{i} = zeros(2,2);65 end66

67 for i=1:N % Create N passive matrices68 Q2{i} = zeros(2,2);69 end70

71 k = 1; %Number of times a child listen to its parent72

73 %Create association matrices for all new individuals74 for i=1:N75 A2{i}=zeros(2,2);76 end77

78 for i=1:N79 parent=sum(rand>f)+1; %Give the new generation parents80 for c=1:k81 %Take a random object82 %i=round(rand*2);83

84 %Go through all objects85

86 for j=1:287 r=rand; %Choose a random word88 if r<P1{parent}(j,1)89 %Say 'a'90 A2{i}(j,1)=A2{i}(j,1)+1;91 %Mistake92 % if rand<0.0193 % A2{i}(j,2)=A2{i}(j,2)+1;94 % else95 % A2{i}(j,1)=A2{i}(j,1)+1;96 % end97 else98 %say 'b'99 A2{i}(j,2)=A2{i}(j,2)+1;

100 end101 end102 end103

104 for j=1:2 %Caluculate the active matrix for each ...individual

21

Page 26: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

105

106 P2{i}(j,1)=A2{i}(j,1)./(A2{i}(j,1)+A2{i}(j,2));107 P2{i}(j,2)=A2{i}(j,2)./(A2{i}(j,1)+A2{i}(j,2));108 end109

110

111 for j=1:2 %Caluculate the active matrix for each ...individual

112

113 if A2{i}(1,j)+A2{i}(2,j) == 0 %Check if the ...parents haven't talked about one word

114

115 Q2{i}(j,1)=0.5;116 Q2{i}(j,2)=0.5;117

118 else %Otherwise calculatw the passive matrix in the ...usual way

119

120 Q2{i}(j,1)=A2{i}(1,j)./(A2{i}(1,j)+A2{i}(2,j));121 Q2{i}(j,2)=A2{i}(2,j)./(A2{i}(1,j)+A2{i}(2,j));122 end123 end124 end125

126 %Calculate the fitness for the next generation127

128 %Children become adults.129 P1=P2;130 Q1=Q2;131

132 %Recalculate the fitness133 F2 = zeros(1,N); % Create a fitness matrix with 1 row and N ...

columns.134 for i=1:N135 % Go through the languages of each individual136 for m=setdiff([1:N],i)137 % Calculate the fitness between each indiviual138 for k=1:2139 % Calculate the fitness140 for j=1:2141 F2(i)=F2(i)+0.5*(P2{i}(k,j)*Q2{m}(j,k)+P2{m}(k,j)*Q2{i}(j,k));142 end143 end144 end145 end146 F2 = F2./(N-1);147

148

149 F(l,:)=F2; %Store fitness for each generation150

151

152 F2 = F2./sum(F2);153

154

155 f = cumsum(F2);156

22

Page 27: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

157 end158 plot(mean(F')) %Plot the average fitness for each generation159

160 end161 hold off

A.2 Three Object Three Signal Game

1 % Population dynamics for a 3-object 3-signal language game2

3 clear all4

5 figure(1)6 hold on7

8 for t=1:50 % Number of simulations9 t

10

11 N = 100; % Number of individuals in the population12

13 P1 = [];14

15 a=rand(9,N); % Create an 9xN matrix with random entries used to ...the active matrix

16

17 for i=1:N % Create N active matrices18 P1{i} = [[a(1,i) a(2,i) a(3,i)]./(a(1,i)+a(2,i)+a(3,i)); ...19 [a(4,i) a(5,i) a(6,i)]./(a(4,i)+a(5,i)+a(6,i)); [a(7,i) ...

a(8,i) a(9,i)]./(a(7,i)+a(8,i)+a(9,i))];20 end21

22 b=rand(9,N); % Create an 9xN matrix with random entries used to ...the passive matrix

23

24 for i=1:N % Create N passive matrices25 Q1{i} = [[b(1,i) b(2,i) b(3,i)]./(b(1,i)+b(2,i)+b(3,i)); ...26 [b(4,i) b(5,i) b(6,i)]./(b(4,i)+b(5,i)+b(6,i)); [b(7,i) ...

b(8,i) b(9,i)]./(b(7,i)+b(8,i)+b(9,i))];27 end28

29

30 F1 = zeros(1,N); % Create a fitness matrix with 1 row and N ...columns.

31 for i=1:N32 % Go through the languages of each individual33 for m=setdiff([1:N],i)34 % Calculate the fitness between each indiviual35 for k=1:336 % Calculate the fitness37 for j=1:338 F1(i)=F1(i)+0.5*(P1{i}(k,j)*Q1{m}(j,k)+P1{m}(k,j)*Q1{i}(j,k));39 end40 end41 end

23

Page 28: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

42 end43

44 F1 = F1./(N-1);45

46 F1 = F1./sum(F1);47

48 f=cumsum(F1);49

50

51 G = 100; % Number of generations52

53 % Create the next generation54

55 F = zeros(G,N);56

57 for l=1:G % The process for a number of generations58

59 for i=1:N % Create N active matrices60 P2{i} = zeros(3,3);61 end62

63 for i=1:N % Create N passive matrices64 Q2{i} = zeros(3,3);65 end66

67 k = 5; % Number of times a child listen to its parent68

69 % Create association matrices for all new individuals70 for i=1:N71 A2{i}=zeros(3,3);72 end73

74 for i=1:N75 parent=sum(rand>f)+1; % Give the new generation parents76 for c=1:k77 % Take a random object78 % Go through all objects79

80 for j=1:381 r=rand; % Choose a random word82 if r<P1{parent}(j,1)83 % Say 'a'84 A2{i}(j,1)=A2{i}(j,1)+1;85 elseif r<P1{parent}(j,1)+P1{parent}(j,2)86 % Say 'b'87 A2{i}(j,2)=A2{i}(j,2)+1;88 else89 % Say 'c'90 A2{i}(j,3)=A2{i}(j,3)+1;91 end92 end93 end94

95 for j=1:396

97 % Caluculate the active and passive matrix for each ...

24

Page 29: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

individual98

99 P2{i}(j,1)=A2{i}(j,1)./(A2{i}(j,1)+A2{i}(j,2)+A2{i}(j,3));100 P2{i}(j,2)=A2{i}(j,2)./(A2{i}(j,1)+A2{i}(j,2)+A2{i}(j,3));101 P2{i}(j,3)=A2{i}(j,3)./(A2{i}(j,1)+A2{i}(j,2)+A2{i}(j,3));102

103 end104 for j=1:3105 if A2{i}(1,j)+A2{i}(2,j)+A2{i}(3,j) == 0 % ...

Check if the parents haven't talked about one word106

107 Q2{i}(j,1)=1/3;108 Q2{i}(j,2)=1/3;109 Q2{i}(j,3)=1/3;110

111 else % Otherwise calculate the passive matrix in ...the usual way

112

113 Q2{i}(j,1)=A2{i}(1,j)./(A2{i}(1,j)+A2{i}(2,j)+A2{i}(3,j));114 Q2{i}(j,2)=A2{i}(2,j)./(A2{i}(1,j)+A2{i}(2,j)+A2{i}(3,j));115 Q2{i}(j,3)=A2{i}(3,j)./(A2{i}(1,j)+A2{i}(2,j)+A2{i}(3,j));116 end117 end118 end119

120 % Children become adults.121 P1=P2;122 Q1=Q2;123

124 % Calculate the fitness for the next generation125 F1 = zeros(1,N); % Create a fitness matrix with 1 row and N ...

columns.126 for i=1:N127 % Go through the languages of each individual128 for m=setdiff([1:N],i)129 % Calculate the fitness between each indiviual130 for k=1:3131 % Calculate the fitness132 for j=1:3133 F1(i)=F1(i)+0.5*(P1{i}(k,j)*Q1{m}(j,k)+P1{m}(k,j)*Q1{i}(j,k));134 end135 end136 end137 end138

139

140 F(l,:)=F1/(N-1); % Store fitness for each generation141

142

143 F1 = F1./sum(F1);144

145

146 f = cumsum(F1);147

148 end149

25

Page 30: Evolutionary Language Games - DiVA portal654892/FULLTEXT01.pdf · Evolutionary Language Games Linnéa Gyllingberg. Abstract ... from one generation to the next. Evolutionary biology

150 plot(mean(F')) % Plot the average fitness for each generation151

152 end153

154 hold off

26