You can see a recording of this here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=9f82fa36-ff3c-476b-898f-b11e00c66c6c
You can see a picture of the board I used here.
The Moran process is a game theoretic model of evolution. One of the differences from the Replicator Dynamics equation is that the population is assumed to be finite: so we assumed there is a finite population of \(N\) individuals that can be of any of the types that correspond to actions of the underlying Norma Form Game.
In the example of the Hawk Dove game that we played in class we assumed there were \(N=3\) individuals and the question we attempted to understand was: if we introduce a Hawk in to a population of Doves, what will happen?
The Moran process then follows the following:
Repeat that process until there is a single type of individual in the population.
In class we used dice to simulate the above. We were a bit short on time at the end so not everyone got to complete a simulation. We did still find a probability of 50% of the Hawk taking over.
Here is a notebook with some numeric simulations of the probabilities. If you look through the notes you can see approaches for calculating exact fixation probabilities.
]]>You can see a recording of this here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=5cc70927-0793-4dd5-9690-b11a00c682d0.
After this we discussed potential reasons for the emergence of the social convention of walking on a particular site of the road (on the left in the UK for example).
We used the following game to model this using Replicator Dynamics:
\[A = \begin{pmatrix} 1 & -1 \\ -1 & 1\\ \end{pmatrix}\]This game is meant to model the interaction of individuals in a given population who interact (by walking past each other). If both these individuals walk according to the same convention then they get a utility of 1 but if not they get a utility of -1.
We then model a given population using a vector \(x=(x_1, x_2)\) where \(x_1\) corresponds to the proportion of individuals walking according to the first convention (say: the left) and \(x_2=1-x_1\) is the proportion walking according to the second convention.
We can then compute the average utility of an individual who walks using the first convention (we can refer to this as the first type and to utility as fitness). They will interact with another individual of the first type \(x_1\) of the time getting a fitness of \(1\) and an individual of the second type \(x_2\) of the time getting a fitness of \(-1\). The average utility is then:
\[f_1 = x_1 - x_2\]The average utility of the individuals of the second type are:
\[f_2 = - x_1 + x_2\]The average utility over the entire population is then given by:
\[\phi=x_1f_1+x_2f_2\]In the notes on Replicator Dynamics you can find linear algebraic expressions of these quantities \(f\) and \(\phi\) that extend naturally to populations with more than just 2 types.
The actual Replicator Dynamics equation is then given by:
\[\frac{dx_i}{dt} = x_i(f_i-\phi)\text{ for all}i\]In the case of our game this corresponds to:
\[\begin{align} \frac{dx_1}{dt} =& x_1 (x_1 - x_2 - x_1(x_1 - x_2)+x_2(x_2 - x_1))\\ \frac{dx_2}{dt} =& x_2 (-x_1 + x_2 - x_1(x_1 - x_2)+x_2(x_2 - x_1)) \end{align}\]which can be simplified to:
\[\begin{align} \frac{dx_1}{dt} =& x_1 ((x_1 - x_2) - (x_1 - x_2) ^2)\\ \frac{dx_2}{dt} =& x_2 ((x_2 - x_1) - (x_1 - x_2) ^2) \end{align}\]Substituting \(x_2=1-x_1\) we have:
\[\begin{align} \frac{dx_1}{dt} =& x_1 (2x_1 - 1)2(1-x_1))\\ \frac{dx_2}{dt} =& -x_1 (2x_1 - 1)2(1-x_1)) \end{align}\]And we see (setting the derivatives to be equal to 0) that there are 3 stable populations:
The fact that this is stable mathematically (ie the derivatives are zero) corresponds to the game theoretic fact that in these populations every type of individual has the same fitness: so no one behaviour has an evolutionary advantage.
]]>You can see a recording of this here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f55bd298-4d8a-4973-9361-b11700c6837f.
Thanks to you all for participating and making this good fun.
After the tournament (congratulations to Mathletico Madrid) we briefly talked about Axelrod’s tournaments which have spurned a large amount of research on the emergence of cooperation.
]]>You can see a recording of this here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=a1b89a57-d6f1-4092-a958-b11300c68136.
In class I asked you to write down strategies for a play of the centipede game.
This required writing down an action to take at every possible node of the centipede game.
You can see a pdf with the scans of every strategy here. (Forgive the token effort of removing your names, if anyone would like me to take this down please let me know).
There were essentially 3 strategies played:
If we consider just these 3 actions then we can reformulate the game as a two player game with the action sets: $A_1=A_2={\text{TT}, \text{PT}, \text{PP}}$.
Using this we can now rewrite the utility functions for both players by reading from the tree definition of the centipede game:
\[A = \begin{pmatrix} 2 & 2 & 2\\ 1 & 4 & 4\\ 1 & 3 & 4\\ \end{pmatrix} B = \begin{pmatrix} 0 & 0 & 0\\ 3 & 2 & 2\\ 3 & 5 & 4\\ \end{pmatrix}\]The Nash equilibria for this can then be computed:
>>> import numpy as np
>>> import nashpy as nash
>>> A = np.array(
... (
... (2, 2, 2),
... (1, 4, 4),
... (1, 3, 4),
... )
... )
>>> B = np.array(
... (
... (0, 0, 0),
... (3, 2, 2),
... (3, 5, 4),
... )
... )
>>> game = nash.Game(A, B)
>>> list(game.vertex_enumeration()
[(array([1., 0., 0.]), array([1., 0., 0.]))]
This corresponds to both players picking to take at the first opportunity. If both players do this: neither have a reason to change what they are doing.
This was not the exact game I wrote down at the end of the class where we also included the strategy to take at the first node and hypothetically pass at the second. Of course no one wrote that one down as it does not make immediate sense. If I were to change how I play this game (perhaps I will do this next year) I would not only randomise who is player 1 or player 2 but also randomise the node at which to start playing.
You can find the notebook I used in class here
]]>You can see a recording of this here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=f8ffef2b-2a36-4bf4-ae9f-b11600a56276.
I asked you all to write strategies for the game defined by playing the following stage game twice:
\[A = \begin{pmatrix} \underline{12} & 6\\ 0 & \underline{24}\\ \underline{12} & 23\\ \end{pmatrix} \qquad B = \begin{pmatrix} \underline{2} & 1\\ \underline{5} & 4\\ \underline{0} & 0\\ \end{pmatrix}\]We discussed things at length and found 4 Nash equilibria which corresponds to both players playing a strategy that did not depend on actions of either player:
We then discussed the following strategy:
This corresponds to the following scenario:
Play \((r_2, c_2)\) in first stage and \((r_1,c_1)\) in second stage unless the column player does not cooperate in which case play \((r_3, c_1)\)
This gives a utility of \((36, 6)\). Is this an equilibrium?
We discussed the incentive either play might have to deviate from this: there is none. No player has a reason to deviate so this is a Nash equilibrium.
]]>You can see recordings here:
Some direct actions I have taken as a result of your feedback:
At this stage there is nothing I can do about the compressed nature of the timetable. I am aware of this and I hope I have reassured you that I have your best interests at heart.
After discussing feedback we also talked about meetings. This was a bit rushed but I think we covered everything. You can find a link to a number of principles on meetings here: /gt/topics/meetings.html
Below I have listed all the comments you raised. This is mainly in the interest of future students considering whether or not to pick this course.
YouTube videos are useful and lessons are interactive
The classes are fun, and the practical implementation of game theory topics via games is useful
I like how interactive it is
All of the notes on a well structured website
Like collaborative teaching style
I think that the games we play in lectures are fun and helpful to understand the "lecture notes"
I enjoy the discussions and interactive aspects of this module
Happy with the unique structure of the module, short timeframe is slightly stressful but can't be helped.
Collaborative teaching
The interactive lectures are really cool, and enjoyable. The lecture notes and videos explaining them also work really well.
Interactive
The constant switch between practical and theory applied in class to implement a stronger understanding.
Interactive and fun
interactive classes, good back and forth between Vince and the class, good structured notes
The website is clearly laid out, easy to make notes from
The games keep it fun and keep everyone engaged
lessons are interactive and still help us learn about game theory
Videos as well as notes online
The interactive parts of the module
YouTube videos are really good length, makes the content a lot more manageable when it's broken down into smaller chunks
"The lectures are great fun, the fun of the lectures helps break routine of usual lectures and take in the content
The website and youtube is also very helpful in understanding content"
Nice to see the notes get applied in real life situations and the open chats have been useful
The notes are very easy to digest and the examples in them help
The nashpy notes are very detailed and easy to read
Interactive
Prefer the double lecture hours in first month to give more time to work on coursework later
Breaking up the lectures with interactive scenarios
Interactive lectures are useful and the youtube videos and notes are easy to follow
Interactive activities during class help to see how concepts can be applied
interactive and organised
The notes are detailed and exercises are accessible
Multiple think pair share opportunities help to consolidate knowledge and understanding
I like the website, it’s much more convenient than using learning central.
Really enjoy discussions in lectures
Interactive lectures, seems to be a general consensus of enjoyment towards the module and enthusiasm shown in group work and discussion
Interacting with the students, rather than you talking at us for an hour straight
Nice lecturer
The Short form YouTube videos that can consolidate knowledge after attending a lecture
The course materials on Vinces website are helpful. Lectures are engaging. I like that the module is completely coursework based.
Very Interactive
website is formatted well and easy to find everything to practice game theory in python
Clear notes on website and interactive website reinforce learning
I like that the lectures feel very active, and that I’m not just sitting and taking notes for the entirety of it. It feels more engaging.
Very interactive module. Applying things into practice.
Putting ideas into practice with actual games makes it easier to understand
lectures are fun, so easier to stay concentrated
How interactive and engaging the lectures are. As well as the youtube videos and exercises online
The use of youtube videos and lecture notes of content combined with the collaborative teaching really helps solidify my understanding of the content
The exercise questions are great way to test us on what we’ve learnt
The website is really useful for looking through notes and videos
All coursework ease exam pressure
The Nashpy library is really structured with examples and example code which I find incredibly helpful.
Interactive, not just listen and write
the way you interact with us is really engaging and i appreciate that. it’s nice to come to class and actually feel like you can participate and discuss
I think the website works quite well, easier to use than learning central, and the videos are helpful
Chocolate bribes help
As interesting as you want it to be
Playing games and putting then applying the theory to them (real life application)! I find myself understanding and following the class when I read up on the lecture notes in my own time
Self-study is nice
bit random sometimes
The group project seems quite vague
interactive learning and comprehensive schedule
I would prefer topics directly from the book are discussed - ie the more difficult concepts are gone over.
Maybe a video showing how to download nashpy
Would like to see more examples of previous group projects
I enjoy the lectures :)
Remembering to read the lecture notes as they’re not covered in the lecture
A bit more of a brief on the group coursework
N/A
Timetabling
N/a
More frequent reminders for online notes/videos
Not so much a fault of the module itself but due to the timetabling and having so many classes it has been difficult to get through all the content as it's taught
I don't think having all the classes packed into a few weeks is very fair
Slightly unclear about assessments
Could maybe have more questions / interactive quizzes (like menti) in lectures and outside of lectures
Although interactive, Still don’t really know what’s going on in this module or what we’re working towards. The material on your website seems a lot more difficult compared to material we’ve gone thru
Clearer distinction in class between examples and the concepts to be learned
More demonstration of code or how to model in the lectures would be helpful
There’s only a small focus on the notes in lectures, and it feels like we go through content very quickly without fully focussing on some points in the notes
As someone who doesn’t know anyone in the class, turning to a neighbor can sometimes be tough
sometimes neglect the notes/videos in own time, slightly stressed about unstructured group coursework, maybe more guidance will be helpful but cant know yet
A lot of content in a short space of time
:)
All good
Structure confusing
Can’t be helped but it’s harder to keep up with the exercises in time with the lectures so slightly behind
Tim winning RPS
it’s not something i really want to be changed, i think this class can seem quite overwhelming just because it’s so different study wise (the change is challenging) but i don’t want that to changelol
N/A
Talking about the groip coursework more would be helpful. Its a bit of a shot in the dark
Not enough discussing about what we have to do on the group project, it was a bit vague
I would like it to be a bit more clear what topic in the notes we’re discussing, maybe just at the start of the lecture
Whats required for assessments unclear
The mathematical notation in the online notes sometimes seems a bit off. I prefer it when I can (mostly) work out how something works without an example, but with these the examples are needed
The website is almost too accessible, making it seem less useful to do wider reading
More online quizzes would be better to consolidate knowledge
Maybe go through how to code a bit more
"I feel like I don't have enough time between lectures to look at the course
notes and videos"
maybe more lecture video
A recording of the class is available here.
We applied the algorithm described here to the zero sum game defined by:
\[A = \begin{pmatrix} 0 & -1 & 1\\ 1 & 0 & -1\\ -1 & 1 & 0 \end{pmatrix}\]The basic idea behind the algorithm is as follows:
Note We did not actually get to part 3 today.
We considered the supports of size 1: there are no single pairs of actions that are pairs of best responses to each other.
We considered 2 pairs of supports of size 2:
That is 2 of the 9 possible pairs of supports of size 2.
]]>A recording of the class is available here.
I started the class by showing how to use nashpy
to check if strategies are
best responses to each other.
You can see the Nashpy documentation for this here: https://nashpy.readthedocs.io/en/stable/how-to/check-best-responses.html
You can find a link to a video demonstrating this here: https://vknight.org/gt/topics/best-responses.html
You can find the notebook I used in class here
After this we moved on to class rock paper scissors tournament.
The first time I heard of this game (a variation of rock paper scissors) was in an episode of the Big Bang Theory. You can find a clip of it here: YouTube and a summary of the rules are available here.
After everyone played their tournaments (a knock out with a final) following that there was a “last player standing” session which lead to the grand final. Tim was victorious here (hail Tim) and we then started having a conversation about what made someone be good at Rock Paper Scissors Lizard Spock.
Interestingly all the ideas revolved around playing a best response to what you thought your opponent would do.
One thing I spoke about at the end was how to make that hard to do: being unpredictable.
Indeed, in this setting the only pair of strategies that are best responses to each other are:
\[\sigma_r=(1/5, 1/5, 1/5, 1/5, 1/5)\]and
\[\sigma_c=(1/5, 1/5, 1/5, 1/5, 1/5)\]]]>A recording of that class is available here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=45a3c766-d0bc-4b49-8f7f-b10800c652b0.
We started class by discussing what the original expectations you had might have been about Game Theory:
After this we played matching pennies against strategies played by a computer. As usual you all had some great suggestions and good ideas. Thank you for your engagement and the discussions we’re having in class.
We took at look at calculating the best response \(\sigma_c*\) (although in class I used \(\sigma_2\) interchangeably) against the strategy \(\sigma_r=(x, 1-x)\).
We saw that depending on the value of \(x\) we had 3 possible best responses:
All of this was lead by the idea that the expectation for a given \(\sigma_c\) is a linear function. The function can either:
An interesting concept one of you raised was that \(\sigma^rB\) which is a row vector is essentially the game from the column players point of view. I hadn’t heard anyone put that like that and it’s completely correct *for a given value of \(\sigma_r\)*.
This leads to the concepts described in this section of the notes: nashpy.readthedocs.io/en/stable/text-book/best-responses.html#generic-best-responses-in-2-by-2-games
Which is that we could write down a generic form of \(\sigma_c^*\):
\[
\sigma_c^*=
\begin{cases}
(0, 1),&\text{ if } x > 1/3\\
(1, 0),&\text{ if } x < 1/3\\
\text{indifferent},&\text{ if } x = 1/3
\end{cases}
\]
I left as an exercise to repeat the procedure for \(\sigma_r^*\) which gives:
\[
\sigma_r^* =
\begin{cases}
(1, 0),&\text{ if } y > 1/2\\
(0, 1),&\text{ if } y < 1/2\\
\text{indifferent},&\text{ if } y = 1/2
\end{cases}
\]
(where \(y\) is the probability of being in the first column).
I then passed briefly over the remaining sections of the notes:
I started writing a notebook to demonstrate some things but realised that I was rushing things so I’m going to do that at the start of the next class.
]]>A recording of this class is available here: https://cardiff.cloud.panopto.eu/Panopto/Pages/Viewer.aspx?id=3a87cbb9-72fa-4a03-a335-b10500c67c26
We did this by pairing up and playing two different games:
As well as briefly talking about strategies we mainly made sure everyone understood the notion of picking from an action set, how this is not necessarily random but also what we would mean by random.
I briefly (because I’m an idiot and thought I had 10 less minutes than I did): showed how to define a game using nashpy. If you would like to download the notebook I wrote in class it is here.
At the end of class someone came up to me and said that for the second game, they actually both chose their actions for the entire 5 plays before showing them (as opposed to picking, showing and then picking the next). This is arguably a “right way to do it” as the strategy is completely independent of the actions of the opponent.
]]>