COMP30191 the Theory of Games and Game Models

Total Page:16

File Type:pdf, Size:1020Kb

COMP30191 the Theory of Games and Game Models COMP30191 The Theory of Games and Game Models Andrea Schalk [email protected] School of Computer Science University of Manchester August 7, 2008 About this course This is an introduction into the theory of games and the use of games to model a variety of situations. While it is directed at third year computer science students it is also suitable for students of mathematics, and possibly of physics. It contains some proofs but does not require advanced knowledge of mathematics. The course goes beyond what is classically understood as game theory (the basics of which are covered in Sections 1 and 2) by making connections with computer programs for games such as Chess, and using games to model scenarios in sociology or biology. This course has been taught in the past as CS3191 and CS3192. What this course is about Games have been used with great success to describe a variety of situations where one or more entities referred to as players interact with each other according to various rules. Because the concept is so broad, it is very flexible and that is the reason why applications range from the social sciences and economics to biology and mathematics or computer science (games correspond to proofs in logic, to statements regarding the `fairness' of concurrent systems, they are used to give a semantics for programs and to establish the bisimulation property for processes). As such the theory of games has proved to be particularly fruitful for areas which are notoriously inaccessible to other methods of mathematical analysis. There is no set of equations which describes the goings-on of the stock-market (or if there is, it's far too complicated to be easily discoverable). Single transactions, however, can be described using (fairly simple) games, and from these components a bigger picture can be assembled. This is a rather different paradigm from the one which seeks to identify forces that can be viewed as the variables of an equation. Games have also been successfully studied as models of conflict, for example in biology as well as in sociology (animals or plants competing for resources or mating partners). In particular in the early days of the theory of games a lot of work was funded by the military. When playing games it is assumed that there is some sort of punishment/reward system in place, so that some outcomes of a game are better for a player than others. This is typically described by assigning numbers to these outcomes (one for each player), and it is assumed that each player wishes to maximise his number. This is what is meant when it is stipulated 1 that all players are assumed to behave rationally. Games are then analysed in order to find the actions a given player should take to achieve this aim. This is what is referred to as a game theoretic analysis, but it should be pointed out that there are other ways of looking at the behaviour of players. Sociologists, psychologists and political scientists, for example, are more likely to be interested what people actually do when playing various games, not in what they should be doing to maximize their gains. The only way of finding out about people's behaviour is to run experiments and watch, which is a very different activity from the one this course engages in. To give a practical example, assume you are given a coin and, when observing it being thrown, you notice that it shows heads about 75% of the time, and tails the remaining 25%. When asked to bet on such a coin, a player's chances are maximized by betting on heads every single time. It turns out, however, that people typically bet on heads 75% of the time only! Economists, on the other hand, often are interested in maximizing gains under the as- sumption that everybody else behaves `as usual', which may lead to different results than if one assumes that all players play to maximize their gains. Provided the `typical' behaviour is known, such an analysis can be carried out with game-theoretic means. Depending on the size of the game in question, this analysis will take different forms: Games which are small enough allow a complete analysis, while games which consist of a great many different positions (such as Chess or Go) can not be handled in that way. In this course we examine games of different sizes and appropriate tools for analysing them, as well as a number of applications. Organization This course has a webpage at http://www.cs.man.ac.uk/~schalk/3192/index.html. where all information not contained in the notes can be found. These notes form the foundation for the course, and students are expected to work through them in their own time. To help them with this task there will be one question sessions per week which serve two purposes, to give students the opportunity to ask questions regarding the material they were set • to read in the past fortnight; to give the lecturer the opportunity to introduce the more technical concepts before • setting the reading for the coming fortnight. Part of the notes is a collection of exercises that aim to prepare students for solving the `problem solving' part of the exam. There are unassessed as well as assessed exercises, and the latter form the assessed course work. The unassessed exercises come in a part (a) and a part (b)|the purpose of the second part is to provide additional examples for practice during the revision period. In weeks A student learning is supported by examples classes. In these the students get help with solving the exercises, including the assessed course work. These examples 2 classes take place in the lecture slots with the lecturer and demonstrators present to ensure an instructor/student ration of about 1 to 10. In the last week of term the assessed course work is marked. Marking takes place as follows: Students present their workings of the assessed exercises and a demonstrator or lecturer asks them to explain these workings. If the students can do so satisfactorily, and if their workings do not contain more than minor errors, then they will get full marks for an attempted exercise. Exercises where students cannot give a coherent explanation of what they have done will result in zero marks for that exercise. The purpose of these measures is to avoid students merely copying solutions. The timetable for scheduled activities is as follows: When What Where Who Week 1 Introduction Mo 4.00pm in 1.1 All Weeks 2-5, 7-12 Question sessions Mo 4.00pm in 1.1 All Weeks A (3, 5, 8, 10) Examples classes We 9.00am in 2.19 Surnames A{L We 10.00am in 2.19 Surnames M{Z Week 12 Assessment We 9.00am in 2.19 Surnames A{L We 10.00am in 2.19 Surnames M{Z Set reading. Week 1 2 3 4 5 6 Theme Games Strategies Equilibria Non 0-sum Mixed strats Solving Pages 1{14 14{22 23{33 34{42 42{48 48{59 Week 7 8 9 10 11 12 Theme Models Evolution I Evolution II Medium games Large games Catch-up Pages 60{75 76{88 88{97 98{110 111{130 The timetable for the examples classes is as follows: Examples Class Week Exercises Assessed Exercises 1 3 1{7 1(a), 1(b), 1(c), 2 2 5 7{13 1(b), 1(c), 3(a) 3 8 13{18 1(d), 3(a), 3(b), 4 4 10 19{24 4, 5 The fifth examples class in week 12 is reserved for marking the assessed exercises. The assessed course work provides 20% of the final mark for the course, with 80% coming from an exam. All the material in the notes is examinable, including the exercises. Past exam papers are available online, and links are provided at the course's webpage. On the same webpage feedback on previous years' exam performance can be found. The reason for changing the format from the traditional lecture course is the experience I have gained over seven years of teaching this course. The material is fairly abstract, and to learn such material, an active mode of learning is required, where students try to solve exercises by themselves (rather than just `consuming' what is being presented by somebody else). Or, as somebody else put it, mathematics is not a spectator sport. Watching me explain it all in lectures would only be a small first step towards understanding the material|my expectations are made much clearer in the new format. I used to have the more outgoing 3 students asking for additional meetings in the second half of term, whereas the rest never received any help in a smaller group setting. Again the new format gives that chance to every student on the course. I would appreciate the readers' help in order to eliminate any remaining errors and to improve the notes. If you spot something that seems wrong, or doubtful, or if you can think of a better way of explaining something then please let me know by sending email to [email protected]. I will keep a list of corrigenda available on the course's webpage. I would like to thank David MacIntosh, Isaac Wilcox, Robert Isenberg, Roy Schestowitz, Andrew Burgess, Xue Qing Huang, Cassie Wong, Florian Sturmer,¨ Mark Daniel, Steve Hughes, Kevin Patel, and Mousa Shaikh-Soltan from previous years' courses for helping me improve the course material.
Recommended publications
  • New Architectures in Computer Chess Ii New Architectures in Computer Chess
    New Architectures in Computer Chess ii New Architectures in Computer Chess PROEFSCHRIFT ter verkrijging van de graad van doctor aan de Universiteit van Tilburg, op gezag van de rector magnificus, prof. dr. Ph. Eijlander, in het openbaar te verdedigen ten overstaan van een door het college voor promoties aangewezen commissie in de aula van de Universiteit op woensdag 17 juni 2009 om 10.15 uur door Fritz Max Heinrich Reul geboren op 30 september 1977 te Hanau, Duitsland Promotor: Prof. dr. H.J.vandenHerik Copromotor: Dr. ir. J.W.H.M. Uiterwijk Promotiecommissie: Prof. dr. A.P.J. van den Bosch Prof. dr. A. de Bruin Prof. dr. H.C. Bunt Prof. dr. A.J. van Zanten Dr. U. Lorenz Dr. A. Plaat Dissertation Series No. 2009-16 The research reported in this thesis has been carried out under the auspices of SIKS, the Dutch Research School for Information and Knowledge Systems. ISBN 9789490122249 Printed by Gildeprint © 2009 Fritz M.H. Reul All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronically, mechanically, photocopying, recording or otherwise, without prior permission of the author. Preface About five years ago I completed my diploma project about computer chess at the University of Applied Sciences in Friedberg, Germany. Immediately after- wards I continued in 2004 with the R&D of my computer-chess engine Loop. In 2005 I started my Ph.D. project ”New Architectures in Computer Chess” at the Maastricht University. In the first year of my R&D I concentrated on the redesign of a computer-chess architecture for 32-bit computer environments.
    [Show full text]
  • Implementing a Chess Coach
    Implementing a Chess Coach registration: 4861469 (Supervisor: Dr Barry Theobald) Abstract The core component of every chess engine is it’s AI (Artificial Intelligence). AI has been an area of constant interest and research since the dawn of modern computing, holding interest for a number of important fields including not only computing but also, among others, philosophy, psychology and neurology. In this project, a chess program capable of fielding a game between two players was designed and implemented. Prominent methods of achieving both this and a chess engine capable of providing a challenging game experience to a player were discussed, and the methods used in this instance were justified. The program underwent user testing to ascertain it’s performance, and the results were discussed. Acknowledgements I would like to extend my sincere thanks to my supervisor, Dr Barry J. Theobald, for providing me with invaluable guidance and support throughout this challenging project. I would also like to express my gratitude to all of the users that provided me with helpful and constructive feedback. CMPC3P2Y Contents Contents 1 Introduction 8 1.1 Background and History of Computer Chess Engines . .8 1.2 Aims . 10 2 Representing a Chess Board 11 2.1 Arrays . 11 2.2 Bitboards . 11 3 Tree Search Algorithms 14 3.1 Best-First Search . 14 3.2 Breadth-First Search . 16 3.3 Depth-First Search . 16 3.4 Machine Learning Approaches . 20 4 Evaluating a Chessboard 21 4.1 Heuristics . 21 4.2 Piece-Square Tables . 21 5 Weaknesses of Current Generation Chess Engines 23 6 Design and Implementation 24 6.1 Program Structure .
    [Show full text]
  • Exploring Modern Chess Engine Architectures
    Vrije Universiteit Amsterdam Bachelor Thesis Exploring modern chess engine architectures Author: Pieter Bijl (2647306) Author: Anh Phi Tiet (2638026) 1st supervisor: Prof. Dr. W.J. Fokkink 2nd reader: Prof. Dr. ir. H.E. Bal A thesis submitted in fulfillment of the requirements for the VU Bachelor of Science degree in Computer Science July 5, 2021 CONTENTS I Introduction 3 II Basics of chess engine architecture 3 II-A Board representation . .3 II-B Move generation . .6 II-C Search . .9 II-D Evaluation . 12 III Methodology 17 IV Results 18 IV-A Results . 18 IV-B Result analysis . 19 V Conclusion 20 VI Discussion 20 References 23 Appendix 23 2 Abstract—The game of chess is over 1000 years old and is move generator is often the limiting factor, and in a regular still not optimally played in the 21st century. This thesis aims to alpha beta style search. The first research question here is explore the technical history of chess computing over the last 40 as follows: Which approach to board representation is the years. Various techniques that have been employed throughout that time are implemented and tested to determine their perfor- fastest for move generation, which suits a full general purpose mance differences. Similarly, classical evaluation functions that chess engine, and in which subroutines of the engine is the attempt to score a position based on handcrafted, human-like choice of board representation most critical? We hypothesize chess features are broken down and their parameters tuned. that magic and PEXT bitboards will beat the others in both In conclusion, implementations of both array centric board scenarios, where PEXT bitboards perform slightly better.
    [Show full text]
  • A Complete Chess Engine Parallelized Using Lazy SMP
    A Complete Chess Engine Parallelized Using Lazy SMP Emil Fredrik Østensen Thesis submitted for the degree of Master in programming and networks 60 credits Department of informatics Faculty of mathematics and natural sciences UNIVERSITY OF OSLO Autumn 2016 A Complete Chess Engine Parallelized Using Lazy SMP Emil Fredrik Østensen © 2016 Emil Fredrik Østensen A Complete Chess Engine Parallelized Using Lazy SMP http://www.duo.uio.no/ Printed: Reprosentralen, University of Oslo Abstract The aim of the thesis was to build a complete chess engine and parallelize it using the lazy SMP algorithm. The chess engine implemented in the thesis ended up with an estimated ELO rating of 2238. The lazy SMP algorithm was successfully implemented, doubling the engines search speed using 4 threads on a multicore processor. Another aim of this thesis was to act as a starting compendium for aspiring chess programmers. In chapter 2 Components of a Chess Engine many of the techniques and algorithms used in modern chess engines are discussed and presented in a digestible way, in a try to make the topics understandable. The information there is presented in chronological order in relation to how a chess engine can be programmed. i ii Contents 1 Introduction 1 1.1 The History of Chess Computers . .2 1.1.1 The Beginning of Chess Playing Machines . .2 1.1.2 The Age of Computers . .3 1.1.3 The First Chess Computer . .5 1.1.4 The Interest in Chess Computers Grow . .6 1.1.5 Man versus Machine . .6 1.1.6 Shannon’s Type A versus Shannon’s Type B Chess Computers .
    [Show full text]
  • The Design and Implementation of an Adaptive Chess Game
    California State University, San Bernardino CSUSB ScholarWorks Electronic Theses, Projects, and Dissertations Office of aduateGr Studies 9-2015 THE DESIGN AND IMPLEMENTATION OF AN ADAPTIVE CHESS GAME Mehdi Peiravi mehdi peiravi Follow this and additional works at: https://scholarworks.lib.csusb.edu/etd Part of the Robotics Commons Recommended Citation Peiravi, Mehdi, "THE DESIGN AND IMPLEMENTATION OF AN ADAPTIVE CHESS GAME" (2015). Electronic Theses, Projects, and Dissertations. 228. https://scholarworks.lib.csusb.edu/etd/228 This Project is brought to you for free and open access by the Office of aduateGr Studies at CSUSB ScholarWorks. It has been accepted for inclusion in Electronic Theses, Projects, and Dissertations by an authorized administrator of CSUSB ScholarWorks. For more information, please contact [email protected]. THE DESIGN AND IMPLEMENTATION OF AN ADAPTIVE CHESS GAME A Project Presented to the Faculty of California State University, San Bernardino In Partial Fulfillment of the Requirements for the Degree Master of Science in Computer Science by Mehdi Peiravi September 2015 THE DESIGN AND IMPLEMENTATION OF AN ADAPTIVE CHESS GAME A Project Presented to the Faculty of California State University, San Bernardino by Mehdi Peiravi September 2015 Approved by: Haiyan Qiao, Committee Chair, Computer Science Kerstin Voigt, Committee Member Ernesto Gomez, Committee Member © 2015 Mehdi Peiravi ABSTRACT In recent years, computer games have become a common form of entertainment. Fast advancement in computer technology and internet speed have helped entertainment software developers to create graphical games that keep a variety of players’ interest. The emergence of artificial intelligence systems has evolved computer gaming technology in new and profound ways.
    [Show full text]
  • FPGA Multiprocessor for Game Tree Searches Thesis to Obtain The
    FPGA Multiprocessor for Game Tree Searches António Pedro Santos Coelho Thesis to obtain the Master of Science Degree in Electrical and Computer Engineering Supervisor: Prof. Horácio Cláudio de Campos Neto Examination Committee Chairperson: Prof. Nuno Cavaco Gomes Horta Supervisor: Prof. Horácio Cláudio de Campos Neto Members of the Committee: Prof. João Paulo Baptista de Carvalho May 2016 In the past Grandmasters came to our computer tournaments to laugh. Today they come to watch. Soon they will come to learn. Monty Newborn, computer chess tournament organizer, 1977 Acknowledgements I want to thank my supervisor Prof. Horácio Neto for his help and guiding me in the correct direction. I also want to thank my colleges and family for the massive support they have given me for so long. i Abstract This thesis explores the development of a hardware/software system that implements an algorithm for game tree searches, applied to the game of Chess. The system architecture consists of a general purpose processor that executes the software part, and by a dedicated hardware unit that implements a move generator for the game of Chess. Move generation speed is a crucial part of a game tree search algorithm. The faster the move generator, the more tree nodes can be visited per time unit, thus finding more information to help choose the next move. Even though the hardware move generator proved itself to be much faster than the software move generator in the Faile chess engine, the system has a bottleneck in making the moves available to the game engine, so future work is needed to extract the full potential from the designed hardware.
    [Show full text]
  • Data Structures
    Data structures PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Thu, 17 Nov 2011 20:55:22 UTC Contents Articles Introduction 1 Data structure 1 Linked data structure 3 Succinct data structure 5 Implicit data structure 7 Compressed data structure 8 Search data structure 9 Persistent data structure 11 Concurrent data structure 15 Abstract data types 18 Abstract data type 18 List 26 Stack 29 Queue 57 Deque 60 Priority queue 63 Map 67 Bidirectional map 70 Multimap 71 Set 72 Tree 76 Arrays 79 Array data structure 79 Row-major order 84 Dope vector 86 Iliffe vector 87 Dynamic array 88 Hashed array tree 91 Gap buffer 92 Circular buffer 94 Sparse array 109 Bit array 110 Bitboard 115 Parallel array 119 Lookup table 121 Lists 127 Linked list 127 XOR linked list 143 Unrolled linked list 145 VList 147 Skip list 149 Self-organizing list 154 Binary trees 158 Binary tree 158 Binary search tree 166 Self-balancing binary search tree 176 Tree rotation 178 Weight-balanced tree 181 Threaded binary tree 182 AVL tree 188 Red-black tree 192 AA tree 207 Scapegoat tree 212 Splay tree 216 T-tree 230 Rope 233 Top Trees 238 Tango Trees 242 van Emde Boas tree 264 Cartesian tree 268 Treap 273 B-trees 276 B-tree 276 B+ tree 287 Dancing tree 291 2-3 tree 292 2-3-4 tree 293 Queaps 295 Fusion tree 299 Bx-tree 299 Heaps 303 Heap 303 Binary heap 305 Binomial heap 311 Fibonacci heap 316 2-3 heap 321 Pairing heap 321 Beap 324 Leftist tree 325 Skew heap 328 Soft heap 331 d-ary heap 333 Tries 335 Trie
    [Show full text]
  • CS3191 Section 4 Large Games
    CS3191 Section 4 Large Games Andrea Schalk Department of Computer Science, University of Manchester Andrea Schalk: CS3191 Section 4 – p. 1/44 These games have very large game trees—typically far too large to be held in memory entirely, and certainly too large to try to find all strategies. In fact, even the methods in the previous section will not work on such games—the game trees are so large that carrying out alpha-beta search would take far too long to return a value and thus a good move. There are three problems which have to be solved to write such a program which we will discuss in some detail. Finally we will have a look at how Chess-playing programs developed, since Chess is the game for which the most effort has been made when it comes to writing programs. Large games Section 4 covers how computer programs for games such as Chess, Go, Othello, Checkers and similar games work. Andrea Schalk: CS3191 Section 4 – p. 2/44 In fact, even the methods in the previous section will not work on such games—the game trees are so large that carrying out alpha-beta search would take far too long to return a value and thus a good move. There are three problems which have to be solved to write such a program which we will discuss in some detail. Finally we will have a look at how Chess-playing programs developed, since Chess is the game for which the most effort has been made when it comes to writing programs.
    [Show full text]
  • Anatomia De Um Motor De Xadrez
    Instito de Matemática e Estatística Universidade de São Paulo Anatomia de um Motor de Xadrez Autor: Supervisor: Hugo Vinicius Mori Dantas Santana José Coelho de Pina 01 de Dezembro de 2014 Sumário Sumário 1 1 Introdução 2 2 História 3 3 Anatomia 4 4 Comunicação 6 5 Representação do tabuleiro8 6 Busca 17 7 Avaliação 28 8 Pulse 35 9 Disciplinas relacionadas 45 10 Comentários finais 46 1 Capítulo 1 Introdução O xadrez é um jogo de tabuleiro de natureza recreativa e competitiva para dois jogadores. Este jogo é um dos mais populares do mundo e é praticado em diversos lugares como escolas, clubes, torneios ou pela internet [39]. Desde a invenção do xadrez, os enxadristas tentam buscar a melhor estratégia e tática para vencer uma partida. Muitos pesquisadores desenvolveram teorias ou máquinas para este jogo durante muitos anos [28]. Nas décadas de 1940 e 1950, houve um súbito avanço na pesquisa sobre xadrez. Isto foi possível graças à invenção do computador. Um grande número de enxadristas, percebendo o poder do computador, iniciaram o seu trabalho relacionado ao motor de xadrez (chess engine)[28]. O primeiro torneio de xadrez foi realizado em Londres, 1851. Em especial, o primeiro torneio de mo- tores de xadrez ocorreu na cidade de Nova York, em 1970. Desde então, estas competições são realizadas regularmente. O objetivo deste trabalho é apresentar as teorias relacionadas ao xadrez por computador e mostrar como poderiam ser implementadas estas estratégias num computador na forma de motor de xadrez e, finalmente, mostrar as relações deste assunto com as disciplinas oferecidas no curso de bacharelado em ciência da com- putação.
    [Show full text]