# CS代考 6CCS3AIN, Tutorial 05 (Version 1.0) 1. For each of the interaction scenarios below: – cscodehelp代写

6CCS3AIN, Tutorial 05 (Version 1.0) 1. For each of the interaction scenarios below:

(i) Determine which strategies are dominated (and explain why)

(ii) Use the idea of deleting strongly dominated strategies to simplify the scenario where appropriate.

(iii) Identify any Nash equilibria.

(iv) Identify the Pareto optimal outcomes.

(v) Identify the outcome that maximises social welfare.

j

LR U34

(a)

(b)

(c)

2. In the lecture we talked about the Prisoner’s Dilemma. Another well studied game is the Stag Hunt. Here is the story which describes what it captures:

A group of hunters goes stag hunting. If they all stay focussed on the stag, they will catch it and all have a lot of food. If some of them head off to catch rabbits, the stag will escape. In this case the rabbit hunters will have some small amount of food and the (remaining) stag hunters will go hungry. What should each hunter do?

As a two player game (two hunters, each of which can choose between Rabbit and Stag) this is:

j

RS R21

i23 S34

14

Note that S is often interpreted as “lie / cooperate” in the Prisoner’s dilemma sense, and R as “confess”. In

that sense, mutual cooperation (both hunters choose S) is the best outcome. What are the Nash equilibria and Pareto optimal outcomes?

3. Another canonical 2 player game is “chicken”, probably best explained in Rebel without a Cause: https://www.youtube.com/watch?v=u7hZ9jKrwvo

i32 D12

14

j

LR U -1 2

i -1 1

D 1 -1

2 -1

j

LR U31

i31 D42

24

Chicken has a payoff matrix like:

j

SJ S12

i14 J43

23

1

where J denotes “jump” (cooperate in Prisoner’s dilemma notation) and S denotes “stay in car” (defect in Prisoner’s dilemma notation).

What are the Nash equilibria and Pareto optimal outcomes?

How do the outomes of this game compare with those of the Prisoner’s dilemma?

4. For the optional computational part of the tutorial.

On KEATS you can find the file intro.py. This is illustrates the cabailities of the Python package called

Nashpy: https://nashpy.readthedocs.io/en/stable/index.html

Nashpy provides tools for handling two player games. You can install it using: pip install nashpy

Anaconda includes pip, which is a package manager for Python, as well as its own package maanger conda so if you have Anaconda installed1 installation is easy. Otherwise, I’m afraid that you are on your own.

With Numpy installed, you can run intro.py with: python intro.py

from the command line. As set up, this loads up Rock, paper, scissors, Matching pennies, and Prisoner’s dilemma and shows what Nashpy can do, extracting player utilities under specific strategies and searching for Nash equilibria.

Now try using Nashpy to check your answers to part (iii) of Q1 (a)–(e). Note that where there are mixed strategy Nash equilibria, Nashpy will find those also.

5. Since Nashpy makes it possble to search through the outcomes of the games, you should be able to write code that:

(a) Identifies dominated strategies.

(b) Identified Pareto optimal outcomes

(c) Identifies outcomes that maximise social welfare.

Use your code to check your answers to parts (i), (iv) and (v) of Q1 (a)–(e).

6. Write code that uses Nashpy to search for pure strategy Nash equilibria.

1If you don’t have Anaconda installed, you can install that from https://www.anaconda.com/download. If you are planning to do much with Python, Anaconda is pretty handy to have since it makes it easy to install new packages.

2