38
Programming a computer to play chess in the 1950s Jacqueline Wagner University of Heidelberg [email protected] April 18 2019 Jacqueline Wagner University of Heidelberg April 18 2019 1 / 38

Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg [email protected] April182019

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Programming a computer to play chess in the 1950s

Jacqueline Wagner

University of Heidelberg

[email protected]

April 18 2019

Jacqueline Wagner University of Heidelberg April 18 2019 1 / 38

Page 2: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Overview

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 2 / 38

Page 3: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 3 / 38

Page 4: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Theories highlighted in this presentation

Programming a Computer forPlaying Chess by ClaudeShannon, 1949Digital Computers applied toGames by Alan Turing, 1953

Figure: Claude E. Shannon

Image: [11]

Jacqueline Wagner University of Heidelberg April 18 2019 4 / 38

Page 5: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Events that shaped the decade

Image 1: [8], Image 2: [14], Image 3: [19], Image 4: [6], Image 5: [10]

Jacqueline Wagner University of Heidelberg April 18 2019 5 / 38

Page 6: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Advancements made in the 1940s

Image 1: [17], Image 2: [5], Image 3: [20], Image 4: [7]

Jacqueline Wagner University of Heidelberg April 18 2019 6 / 38

Page 7: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

What you might be thinking right now...

Why are we looking at theories created in the1940s and early 1950s?Is this even relevant information for me?Are we wasting our time?Why chess?

Image: [2]

Jacqueline Wagner University of Heidelberg April 18 2019 7 / 38

Page 8: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Chess 101

a game of chess can be divided into three phasesthe longest tournament lasted for 269 moves [4]the shortest chess tournament lasted for 4 moves [4]

Image: [16]

Jacqueline Wagner University of Heidelberg April 18 2019 8 / 38

Page 9: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 9 / 38

Page 10: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 10 / 38

Page 11: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Playing a perfect game of chess

consider all possible moves in a given positionuntil an outcome has been reachedpossible since game ends after a finite numberof moves318,979,564,000 different ways of playing thefirst four moves10120 game variations to consider

Image: [9]

Jacqueline Wagner University of Heidelberg April 18 2019 11 / 38

Page 12: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 12 / 38

Page 13: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Playing a skillful game of chess

evaluate a position on the basis ofgeneral layout of the positionnumber and kind of black and whitepieces on the boardpawn formationeach players mobilitypossible legal moves

use chess principles with statistic validity

Image: [0]

Jacqueline Wagner University of Heidelberg April 18 2019 13 / 38

Page 14: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 14 / 38

Page 15: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Coming up with a first strategy

calculate all possible variations out totwo moves deep for each sideapply evaluation function f (P) afterevery moveassume that the opponent will minimizef(P)choose the variation which willmaximize f(P) given this constraint

Image: [21]

Jacqueline Wagner University of Heidelberg April 18 2019 15 / 38

Page 16: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 16 / 38

Page 17: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Necessary Hardware

Image: [21]

Jacqueline Wagner University of Heidelberg April 18 2019 17 / 38

Page 18: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 18 / 38

Page 19: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Defining building blocks

T0: Make move (a, b, c) in position P to obtain resulting positionT1: Make list of all possible moves for pawn pieces at square (x , y) inposition P

T2-T6: Perform the above evaluation on all other types of piecesT7: Make list of all possible moves for all pieces in given position P

T8: Calculate the evaluating function f (P) for position P

T9: Perform maximizing and minimizing to determine the overall bestmove

Jacqueline Wagner University of Heidelberg April 18 2019 19 / 38

Page 20: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 20 / 38

Page 21: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Some fundamental problems to consider

> 16 minutes to perform a movevariations are only considered threemoves deepstrategy is the same in calm positions

Image: [12]

Jacqueline Wagner University of Heidelberg April 18 2019 21 / 38

Page 22: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Ideas for improvement

examine forceful variations out as far aspossibleperform evaluation once a stableposition has been reachedonly evaluate worthwhile variations

Image: [3]

Jacqueline Wagner University of Heidelberg April 18 2019 22 / 38

Page 23: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 23 / 38

Page 24: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 24 / 38

Page 25: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Shannons idea

evaluate whether stability exists using a function g(P)

explore for 2 to 10 moves until g(P) = 0evaluate whether a move M in position P is worth exploring using afunction h(P,M)

forceful moves → high h(P,M)defensive moves → medium h(P,M)all other moves → low h(P,M)

with increasing depth fewer sub-variations are examined

Jacqueline Wagner University of Heidelberg April 18 2019 25 / 38

Page 26: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Turings idea

evaluate game for at least two movesdead position = no captures, recapturesor checks are possible in the next moveall other positions are considerablepositionsestimate value at the end of a sequencebased on criteria, such as material,mobility, safety or threat of checkmatechoose move which leads to the greatestvalue and the greatest positional value

Image: [3]

Jacqueline Wagner University of Heidelberg April 18 2019 26 / 38

Page 27: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 27 / 38

Page 28: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

More problems to consider

machine always makes the same move in the same position →opponent can use weak decisions to winprogram is quite complicated in opening stage where masters focus onset number of variations until one player deviates

Jacqueline Wagner University of Heidelberg April 18 2019 28 / 38

Page 29: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

More ideas for improvement

use statistical element to avoid repeating the same strategy over andover againstore few hundred standard opening strategies in slow-speed memorychange style of play by modifying selected coefficients and numericalfactorsincrease strength of the player by adjusting depth of the calculation orevaluation function

Jacqueline Wagner University of Heidelberg April 18 2019 29 / 38

Page 30: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 30 / 38

Page 31: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Conclusion

machine will not learn from its mistakesstrategy relies on brute force calculation rather than logical analysis

Image: [1]

Jacqueline Wagner University of Heidelberg April 18 2019 31 / 38

Page 32: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Conclusion

“It plays something like a beginner at chess who has been told some of theprinciples and is possessed of tremendous energy and accuracy for calculationbut has no experience with the game.”

Shannon, 1949Programming a Computer for Playing Chess, page 273

Jacqueline Wagner University of Heidelberg April 18 2019 32 / 38

Page 33: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Conclusion

“The computer is strong in speed and accuracy and weak in analytical ability andrecognition. Hence, it should make more use of brutal calculations than humans.”

Shannon, 1949Programming a Computer for Playing Chess, page 274

Jacqueline Wagner University of Heidelberg April 18 2019 33 / 38

Page 34: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

Conclusion

“If I were to sum up the weakness of the above system in a few words I woulddescribe it as a caricature of myself.”

Turing, 1953Digital Computers applied to Games, page 9

Jacqueline Wagner University of Heidelberg April 18 2019 34 / 38

Page 35: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

1 Introduction

2 The easy way outPlaying a perfect game of chessPlaying a skillful game of chessComing up with a first strategyNecessary hardwareConstructing a programSome fundamental problems to consider

3 Considering a more complex approachComing up with a better strategyMore problems to consider

4 Conclusion

5 References

Jacqueline Wagner University of Heidelberg April 18 2019 35 / 38

Page 36: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

References I

Dec. 15, 2013. URL: https://www.trivalleylifechurch.org/2013/12/15/no-brain/.

Nov. 25, 2016. URL: http://hdimages.org/question-mark-image-hd/.

Aug. 7, 2017. URL:https://tmhome.com/wp-content/uploads/2014/01/meditation-higher-intelligence-research-w2.jpg.

Apr. 16, 2019. URL: https://ohfact.com/interesting-facts-about-chess/.

Apr. 17, 2019. URL: http://worldartsme.com/abacus-clipart.html#.

Evan Ackerman. Sept. 30, 2016. URL:https://spectrum.ieee.org/tech-history/space-age/a-brief-history-of-the-microwave-oven.

Jodi Beggs. Dec. 9, 2017. URL: https://www.thoughtco.com/the-meeting-game-definition-1147465.

Detlef Borchers. Feb. 16, 2016. URL: https://www.heise.de/newsticker/meldung/Vor-70-Jahren-Amerika-lernt-den-ersten-elektronischen-Universalrechner-ENIAC-kennen-3102001.html.

Gregor Delvaux de Fenffe. July 29, 2016. URL:https://www.planet-wissen.de/geschichte/diktatoren/mao_zedong_gnadenloser_machtmensch/index.html.

Stephanie Pappas. Sept. 24, 2018. URL: https://www.livescience.com/63655-why-earth-wobbles.html.

Jacqueline Wagner University of Heidelberg April 18 2019 36 / 38

Page 37: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

References II

Scott Michael Rank. Apr. 16, 2019. URL: https://www.historyonthenet.com/when-did-america-enter-ww2.

Siobhan Roberts. Apr. 30, 2015. URL: https://www.newyorker.com/tech/annals-of-technology/claude-shannon-the-father-of-the-information-age-turns-1100100.

Ronan. July 12, 2017. URL: https://huddle.eurostarsoftwaretesting.com/when-you-have-minimum-time-for-testing-what-do-you-do/time-running-out-clock/.

Andrew Schell. Sept. 1, 2014. URL:https://www.maximumyield.com/amino-acids-the-lego-blocks-of-plant-proteins/2/2596.

Johnny Simon. Aug. 6, 2018. URL:https://qz.com/1349319/pictures-of-hiroshima-and-nagasakis-atomic-bomb-destruction/.

Jimmy Soni. Aug. 16, 2017. URL:https://www.chess.com/article/view/the-man-who-built-the-chess-machine.

Jimmy Stamp. Apr. 3, 2013. URL:https://www.smithsonianmag.com/arts-culture/how-the-chess-set-got-its-look-and-feel-14299092/.

Steemit. Apr. 16, 2019. URL:https://steemit.com/history/@steemizen/today-in-history-the-first-frisbee.

Jacqueline Wagner University of Heidelberg April 18 2019 37 / 38

Page 38: Programming a computer to play chess in the 1950s...Programmingacomputertoplaychessinthe1950s JacquelineWagner University of Heidelberg jacqueline.wagner@stud.uni-heidelberg.de April182019

References III

Martin Stezano. Aug. 29, 2017. URL: https://www.history.com/news/in-1950-alan-turing-created-a-chess-computer-program-that-prefigured-a-i.

Shashi Tharoor. Dec. 9, 2010. URL: https://www.welt.de/debatte/die-welt-in-worten/article11502690/Gandhis-Methoden-halfen-die-Welt-zu-veraendern.html.

Pamela Wiggins. June 9, 2018. URL:https://www.thesprucecrafts.com/guide-to-vintage-tupperware-4158189.

Claude E. Shannon. “XXII. Programming a computer for playing chess”. In: The London, Edinburgh, andDublin Philosophical Magazine and Journal of Science 41.314 (1950), pp. 256–275. eprint:https://doi.org/10.1080/14786445008521796. URL: https://doi.org/10.1080/14786445008521796.

Jacqueline Wagner University of Heidelberg April 18 2019 38 / 38