Checkmate, artificial intelligence: what Garry Kasparov's experience teaches us. Artificial intelligence has become smarter than human. What's next? Educational project chess and artificial intelligence

Developed by engineers at the Massachusetts Institute of Technology. Fischer checkmated the computer three times and won by a landslide. In his letters, the chess player wrote that programs make "blunders", and called the computers themselves "useless pieces of iron."

But in the same year, Monty Newborn, one of the first scientists to study computer chess, said prophetic words:

“Grandmasters used to come to computer chess tournaments to have a laugh. Now they come to observe, and in the future they will study there.”

Bobby Fischer after defeating the computer. Photo: Getty Images

It seems that people have some kind of innate love for mind games. When King Charles I of England was sentenced to death in 1649, he took two things with him to his execution - a bible and a set of chess. The famous artist of the 20th century, Marcel Duchamp, at the peak of his career, suddenly left for Argentina and began carving chess pieces from wood, and in general became interested in chess. In the 19th century, a mysterious story related to the game of Go occurred in Japan. According to legend, the spirits prompted one famous player three brilliant moves. As a result, he was able to win, and his opponent after the game fell to the floor, choked with blood and died.

Computers are far from all this mysticism, but in just a couple of decades they have studied mind games more deeply than humanity has in millennia. In 2014, the company acquired DeepMind for $400 million to "carry out the most unusual and complex research, the ultimate goal of which is to unravel the essence of intelligence." In particular, scientists wanted to teach a computer to play Go. This game is much more difficult than chess. In 1985, a Taiwanese industrial magnate said he would pay $1.4 million for a program that could beat the best Go player. In 1997, the magnate died, and three years later his offer expired - no one was able to take the prize.

Now it could belong to the DeepMind AlphaGo program, which uses modern neural networks. A year ago, she was international go champion Lee Sedol. In May of this year, she again defeated the best Go player, as well as a team of five other professional players.

AlphaGo has become the absolute champion. But soon after her high-profile victories, oblivion awaits her. At the end of May, DeepMind quietly announced that AlphaGo was leaving the competitive scene. To mark the occasion, the company published 50 variations of the games that the program played against itself. In the future, DeepMind wants to release a final research paper that will describe the effectiveness of the program's algorithm.

As for chess, mankind lost the palm in them 20 years before these events, when chess player Garry Kasparov lost to the IBM Deep Blue supercomputer. Chess and Go are not the only games AI is trying to teach. They tried to teach the computer checkers, short backgammon, reversi, poker and many other board games. And human intelligence can no longer be compared with artificial intelligence. This is partly due to advances in technology. For example, back in 1997, the Deep Blue computer ranked 259th in the list of the fastest supercomputers in the world and could perform about 11 billion operations per second. Now, thanks to modern algorithms, even your smartphone is able to defeat Kasparov.

Garry Kasparov vs Deep Blue computer. On the left is one of the IBM engineers, Xiong Feixiong. Photo: Getty Images

Such achievements of AI have caused quite human emotions in people: sadness, depression and despair. After Lee Sedol was defeated by AlphaGo, he went through an existential crisis. “I questioned human ingenuity,” he admitted after the match. “I wondered if all the moves in Go that I knew were correct.” According to one eyewitness, after the defeat, Lee looked like he was "physically ill." Kasparov felt no better after losing to the computer. When he returned to the hotel, he simply undressed, got into bed and stared at the ceiling.

"The computer analyzes some positions so deeply that it plays like a god," Kasparov said.

Deep Blue showed the public for the first time that a computer can outperform humans in solving intellectual problems. “Then it was a shock,” said Murray Campbell, co-founder of Deep Blue. “Now we are gradually getting used to this idea.” However, it is not clear what awaits humanity in the future. How can achievements be used in the real world in games? Campbell's answer to this question sounds pessimistic. "It's hard to find a good example of such success in board games," he said. - In the early 90's, an IBM employee named Gerald Tesauro tried to teach AI to play backgammon and made some advances in stimulated learning. Now his methods are often used in robotics. However, his case is rather an exception to the rule.

Let's look at some basic concepts that will help us create a simple artificial intelligence that can play chess:

  • moving;
  • evaluation of the chessboard;
  • minimax;
  • alpha beta clipping.

At each step, we will improve our algorithm with one of these time-tested chess programming techniques. You will see how each of them affects the algorithm's play style.

The finished algorithm can be found on GitHub.

Step 1. Generation of moves and visualization of the chessboard

We will use the chess.js libraries to generate moves and chessboard.js to render the board. The library for generating moves implements all the rules of chess. Based on this, we can calculate all the moves for a given state of the board.

Visualization of the motion generation function. The starting position is used as the input, and the output is all possible moves from that position.

Using these libraries will help us focus only on the most interesting task - creating an algorithm that finds the best move. We'll start by writing a function that returns a random move from all possible moves:

Var calculateBestMove = function(game) ( //Generate all moves for a given position var newGameMoves = game.ugly_moves(); return newGameMoves; );

Although this algorithm is not a very solid chess player, but it is a good starting point, since its level is enough to play with us:

Black plays random moves

JSFiddle .

Step 2. Evaluate the board

Now let's try to understand which side is stronger in a certain position. The easiest way to achieve this is to calculate the relative strength of the pieces on the board using the following table:

With the score function, we can create an algorithm that chooses the move with the highest score:

Var calculateBestMove = function (game) ( var newGameMoves = game.ugly_moves(); var bestMove = null; //Use any negative number var bestValue = -9999; for (var i = 0; i< newGameMoves.length; i++) { var newGameMove = newGameMoves[i]; game.ugly_move(newGameMove); //Возьмите отрицательное число, поскольку ИИ играет черными var boardValue = -evaluateBoard(game.board()) game.undo(); if (boardValue >bestValue) ( ​​bestValue = boardValue; bestMove = newGameMove ) ) return bestMove; );

The only tangible improvement is that our algorithm will now eat a piece if possible:

Black plays with a simple evaluation function

You can see what happened at this stage on JSFiddle .

Step 3 Search Tree and Minimax

We will then create a search tree from which the algorithm can choose the best move. This is done using the minimax algorithm.

Note. transl. In one of our articles, we already dealt with - we learned how to create an AI that cannot be beaten in tic-tac-toe.

In this algorithm, a recursive tree of all possible moves is explored to a given depth, and the position is evaluated on the "leaves" of the tree.

After that, we return either the smallest or largest child value to the parent node, depending on whose turn is calculated (that is, we try to minimize or maximize the result at each level).

Minimax visualization in artificial position. The best move for white is b2-c3, so we can guarantee that we get to a position where the score is -50

Var minimax = function (depth, game, isMaximisingPlayer) ( if (depth === 0) ( return -evaluateBoard(game.board()); ) var newGameMoves = game.ugly_moves(); if (isMaximisingPlayer) ( var bestMove = -9999; for (var i = 0; i< newGameMoves.length; i++) { game.ugly_move(newGameMoves[i]); bestMove = Math.max(bestMove, minimax(depth - 1, game, !isMaximisingPlayer)); game.undo(); } return bestMove; } else { var bestMove = 9999; for (var i = 0; i < newGameMoves.length; i++) { game.ugly_move(newGameMoves[i]); bestMove = Math.min(bestMove, minimax(depth - 1, game, !isMaximisingPlayer)); game.undo(); } return bestMove; } };

With minimax, our algorithm begins to understand basic chess tactics:

Minimax with depth level 2

You can see what happened at this stage on JSFiddle .

The effectiveness of minimax depends largely on the achievable search depth. This is what we will improve in the next step.

Step 4 Alpha Beta Clipping

Positions we don't need if alpha-beta pruning is used. The tree is visited in the order described.

With alpha-beta clipping, we get a significant improvement in minimax, as shown in the following example:

The number of positions to evaluate in the case of a search with a depth of 4 and the starting position shown in the picture.

You can see what happened at this stage on JSFiddle .

Step 5. Improved scoring function

The original scoring function is rather naive, since we simply calculate the scores of the pieces that are on the board. To improve it, we will start to take into account the position of the figures. For example, a knight in the center of the board is "more expensive" because it has more moves available and is therefore more active than a knight on the edge of the board.

Photos from open sources

The new artificial intelligence has become the best chess player on Earth in just 4 hours of training! (website)

Do you remember what a sensation the Deep Blue chess supercomputer made in 1996 when it won the first game against the Russian champion Garry Kasparov? Despite the fact that our compatriot nevertheless won this game, even then it became clear that artificial intelligence is rapidly progressing and will someday become the best chess player, after which it will be useless for people to play with the program. The only question left was when that would happen.

Representatives of the well-known corporation "Google" said that this time has finally come. According to experts, the AlphaZero neural network developed by them in just 4 hours of self-study turned into the most virtuoso and flawless chess player in the history of this game. A super-powerful artificial intelligence learned to play chess, knowing only its rules. After playing with itself for 4 hours, the robot learned to play perfectly, easily defeating the Stockfish chess program, which was considered the most perfect before. Computers played 100 games - AlphaZero managed to win 28 of them and draw the remaining 72. An advanced neural network that mimics the work of the human brain is able to take risks and even use a kind of intuition.

It is no longer necessary to dream of victory over artificial intelligence

Earlier "AlphaZero" models learned the game by watching live chess players. The developers assumed that this would help artificial intelligence to better understand the strategies of the game. In fact, it turned out that watching people only slows down the development of the program. When the neural network was left to its own devices, its abilities skyrocketed. Now Google engineers are thinking about how to apply such technologies for real benefit to mankind, since a chess game, even the most virtuoso one, has no practical purpose.

In 1968, the famous David Levy made a bet that no program would beat him for the next decade. All this time, the grandmaster was constantly competing with various chess computers and each time he beat them. In 1978, he defeated Chess 4.7, the strongest program at the time, winning a bet. Unfortunately, these days there will be no such interesting fights - we now have to learn only about how one fantastic neural network defeated another. Living chess players can no longer even dream of defeating such monsters. And this is just the beginning of such AI victories over humans…

culture. Dissertation. Cand. Ped Sciences. Rostov-on-Don. 2003.

2. Azarova E.A. Destructive forms of family education, topical problems of our time, crimes of recent times: spiritual, moral and forensic aspects. - Rostov-on-Don: Publishing House of the Russian State Pedagogical University, 2005.

3.Gabdrev GSH. The main aspects of the problem of anxiety in psychology // School psychologist. - 2004. - N ° 8. - S. 9.

4. Enikolopov S.N. Problems of family violence // Problems of psychology. -2002. -#5-6.

5. Tseluiko V.M. Psychology of a dysfunctional family: A book for teachers and parents. - M.: Publishing house VLADOS-PRESS, 2003.

6. Shapar V.B. Practical psychology. Psychodiagnostics of relations between parents and children. - Rostov n / a: Phoenix, 2006.

© Azarova E.A., Zhulina G.N., 2016

A.I. Alifirov

cand. ped. Sciences, Associate Professor, RSSU, Moscow, Russian Federation

I.V. Mikhailova Cand. ped. Sciences, Associate Professor, RSSU, Moscow, Russian Federation

"ARTIFICIAL INTELLIGENCE" IN CHESS

annotation

The article discusses the genesis of the use of software and hardware capable of carrying out intellectual activity comparable to the intellectual activity of a person.

Keywords

Computer technologies in chess, chess programs, chess.

Today, the term "artificial intelligence" (AI) refers to the theory of creating software and hardware capable of carrying out intellectual activity comparable to human intellectual activity. When solving practical problems, they most often use the task from the list, while considering that if a computer system is able to solve these problems, then it is an AI system. Often this list includes playing chess, proving theorems, solving diagnostic problems on an initial incomplete data set, understanding natural language, the ability to learn and self-learn, the ability to classify objects, and the ability to generate new knowledge based on the generation of new rules and regularization models. knowledge .

One of the most important problems of the new science - cybernetics was the problem of how to improve management, how to improve decision-making. One of the founders of cybernetics C. Shannon proposed to formalize and program chess in order to use a chess computer as a model for solving similar control problems. The authority of K. Shannon was so great that his ideas immediately laid the foundation for a new scientific direction. The ideas of K. Shannon were used in the works of A. Turing, K. Zuse, D. Prince.

Author of information theory. K. Shannon, wrote: "The chess machine is ideal to start with, because (1) the task is clearly defined by permissible operations (moves) and the ultimate goal (checkmate); (2) it is not too simple to be trivial, and not too difficult to obtain a satisfactory solution; (3) believe that chess requires "thinking" for skillful play, the solution of this problem will lead us either to admire the ability of mechanized thinking, or to limit our concept of "thinking"; (4) The discrete structure of chess fits well with the digital nature of modern computers."

Later, chess became the subject of a competition between natural and artificial intelligence, and a number of matches were played by the world's leading chess players against computers. In 1995, in an interview with the popular Wired magazine, G.K. Kasparov outlined his view of the game of chess: "Chess is not mathematics. It is fantasy and imagination, it is human logic, not a game with a predictable result. I don't think that theoretically the game of chess can fit into a set of formulas or algorithms." Two years later, the DEEP BLUE supercomputer, having defeated the 13th world champion G.K. Kasparova in a rematch of six games, removed the question of the possibilities of chess artificial intelligence from the agenda. DEEP BLUE kept in memory a complete database of all games and analyzed strategy by calculation only. After the match, G.K. Kasparov changed his point of view, admitting that: "Chess is the only field where one can compare human intuition and creativity with the power and the machine." The match changed the course of development of both classical and computer chess. Artificial intelligence assistance has become widely used in the training system. DI. Bronstein in his book "David vs. Goliath" (2003) wrote: "Botvinnik believed that chess is the art of analysis, and the time of lone improvisers like Andersen, Morphy, Zuckertort is gone forever. Looking at modern chess, we must admit that Botvinnik turned out to be right. The "computer boys" took his idea of ​​the need for home analysis to the point of absurdity. They do not even hide the fact that they are polishing opening variations to a clear result. At the tournament in Linares (2000), the Hungarian Leko admitted without a shadow of embarrassment that the entire game with Anand was on his computer!".

List of used literature:

1. Alifirov A.I. Career guidance work in secondary schools by means of chess / Alifirov A.I. // Problems of development of science and education: theory and practice. Collection of scientific papers based on the materials of the International Scientific and Practical Conference August 31, 2015: in 3 parts. Part II. M.: "AR-Consult", 2015 - S. 13-14.

2. Mikhailova I.V., Alifirov A.I. Tactical actions of chess players / Mikhailova I.V., Alifirov A.I. // Results of scientific research Collection of articles of the International scientific-practical conference. Managing editor: Sukiasyan Asatur Albertovich (February 15, 2016) at 4 h. P/3 - Ufa: AETERNA. -2016.S. 119-121.

3. Mikhailova I.V., Alifirov A.I. Theoretical and methodological foundations of the method of thinking by schemes of chess players / Mikhailova I.V., Alifirov A.I. // Results of scientific research Collection of articles of the International scientific-practical conference. Managing editor: Sukiasyan Asatur Albertovich (February 15, 2016) at 4 h. P/3 - Ufa: AETERNA. - 2016. S. 123-125.

4. Mikhailova I.V. Training of young highly qualified chess players with the help of computer chess programs and the "Internet": author. dis. ... cand. ped. Sciences: 13.00.04 / Mikhailova Irina Vitalievna; RSUPC. - M., 2005. - 24 p.

© Alifirov A.I., Mikhailova I.V., 2016

UDC 378.046.2

A.I. Alifirov

Candidate of Pediatric Sciences, Associate Professor of RSSU, Moscow, RF V.V. Fedchuk, Ph.D.

LLC "Prosperity", senior instructor methodologist, Moscow, Russian Federation STUDY OF THE LEVEL OF PHYSICAL HEALTH OF ADOLESCENTS

annotation

The article deals with the problem of physical health of adolescents and the influence of various factors

Grishanin E.A. Durin S.V. Contents 1. What is artificial intelligence? 2. About knowledge bases. 3. Test tasks. Artificial intelligence. In the 60s of the XX century, a new branch of computer science appeared, which was called "Artificial Intelligence". The encyclopedic dictionary says: "Intellect (from Latin intellectus - knowledge, understanding, reason) - the ability to think, rational knowledge." To the fullest extent, this ability is peculiar only to people. The subject of study of the science "Artificial Intelligence" is human thinking. Scientists are looking for an answer to the question: how does a person think? The goal of these studies is to create a model of human intelligence and implement it on a computer. Somewhat simplified, the above goal sounds like this: - To teach the machine to think. Starting to solve a problem, a person often does not have a clear program of action. He builds this program himself in the course of work. For example, when playing chess, a chess player knows the rules of the game and has the goal of winning the game. His actions are not pre-programmed. They depend on the actions of the opponent, on the emerging position on the board, on the wit and personal experience of the chess player. There are many other human activities that cannot be programmed in advance. For example, composing music and poetry, proving a theorem, literary translation from a foreign language, diagnosing and treating diseases, and much more. You are well aware that any work the computer performs according to the program. Programs are written by people, and the computer formally executes them. The developers of artificial intelligence systems are just trying to teach a machine, like a person, to independently build a program of its actions, based on the condition of the problem. You can also say this: the goal is to turn the computer from a formal executor into an intellectual executor. Formal executor data program Execution of the program results Intelligent executor data Construction of the program Execution of the program results Model of functioning of formal and intellectual executor Any artificial intelligence system operates within a specific subject area (medical diagnostics, legislation, mathematics, economics, etc.). Like a specialist, a computer must have knowledge in this area. Knowledge in a specific subject area, formalized in a certain way and embedded in the memory of a computer, is called a computer knowledge base. For example, you want to use a computer to solve problems in geometry. If there are 500 tasks of different content in the problem book, then with the traditional use of a computer, 500 programs will have to be written. If an artificial intelligence specialist takes up this problem, then he will approach it in a completely different way. He will put the knowledge of geometry into the computer (as the teacher's knowledge is laid in you). Based on this knowledge and with the help of a special algorithm of logical reasoning, the computer will solve any of the 500 problems. To do this, it will be enough to tell him only the condition of the problem. Artificial intelligence systems operate on the basis of the knowledge bases embedded in them. Every student knows that in order to solve any problem, it is not enough to remember the rules, laws, formulas, but you still need to be able to think, reason, and apply this knowledge. Human thinking is based on two components: a stock of knowledge and the ability to reason logically. Hence, two main tasks follow when creating intelligent systems on a computer: - knowledge modeling (development of knowledge formalization methods for entering them into computer memory as a knowledge base); - modeling of reasoning (creation of computer programs that imitate the logic of human thinking in solving various problems). Expert systems are one of the types of artificial intelligence systems. Usually the word "expert" refers to a person with great knowledge and experience in a particular area. Knowledge of this level is embedded in computer expert systems. The purpose of expert systems is to consult the user, help in making decisions. Such assistance becomes especially important in extreme situations, for example, in conditions of a technical accident, an emergency operation, while driving. The computer is not subject to stress. He will quickly find the optimal, safe solution and offer it to the person. However, the final decision is made by the individual. Briefly about the main Artificial intelligence (AI) is a branch of computer science. The subject of AI is human thinking; the goal is to create intelligent systems on a computer. Examples of areas in which artificial intelligence systems are being created: chess and other games, writing poetry and music, translating texts from one language to another, robotics, forensics (fingerprint identification, etc.), medical diagnostics. Artificial intelligence systems work on the basis of the knowledge embedded in them in a certain area. The knowledge model embedded in the memory of a computer is called a computer knowledge base. Human thinking is based on two components: the stock of knowledge and the ability to reason logically. AI systems implement a reasoning model (human logic). Based on the knowledge base and the reasoning model, the AI ​​system itself programs its work when solving any problem. An expert system is an AI system that contains the knowledge and experience of an expert in a given subject area. Here is the composition of the knowledge base "Relatives": Facts: Leo is Andrey's father; Leo is Peter's father; Andrei - Alexei's father; Peter is Michael's father; Peter is Dmitry's father. Rules: every man is the son of his father; grandfather - father's father; brothers are sons of the same father; uncle - father's brother; nephew - brother's son; grandson is the son of a son. Based on these facts and rules, it is possible, by logical reasoning, to establish all kinds of family ties between the men of this family. Pay attention to two features of the knowledge base: - the facts are private, and the rules are general (fair for any family); - only basic facts are included in the knowledge base. Indeed, it is enough to know who is the father of whom in order to use the rules to determine other family ties. On the basis of such a knowledge base, it is possible to build an expert system in the field of kinship between men. To use it in relation to another family, it is enough to change the list of facts, and the rules, of course, will remain the same. Comparing the database with the knowledge base, we come to the conclusion: the database contains only facts, the knowledge base contains facts and rules. Home About knowledge bases. You are already familiar with the concept of "database". A database (DB) is an information model of some real system in computer memory. It was said above that the knowledge base (KB) is a model of human knowledge in a particular subject area. Let's show the difference between a database and a knowledge base using a specific example. Consider this issue on the example of family ties between men of the same family. Here is how they look in the graphical form of a family tree: Leo Petr Andrey Mikhail Dmitry Alexey Family tree Here the lines represent the relationship between a father (at the top level) and a son (at the bottom level). Family ties Male Leo Sons Father Grandfather Brothers Uncles Nephews Don't know Don't know Grandchildren Andrey, Peter Don't know Don't know Don't know Andrey Alexey Lev Don't know Peter Don't know Mikhail Dmitry no Peter Mikhail, Dmitry Lev Don't know Andrey Don't know Alexey no Alexey No Andrey Lev no no Mikhail No Peter Lev Dmitry Andrey no no Dmitry No Peter Lev Mikhail no no no Peter Andrey Alexey Mikhail Dmitry In Table 9.1, information about family ties between the same men is presented in expanded form. Using a relational DBMS, it is easy to create a relational database based on this table. Turning to her with requests, you can determine who is the father, grandfather, brother of whom. This table is an information model of the "family" object. Now let's move on to building the knowledge base. The subject area here is family ties between men of the same family. There are various types of knowledge models in artificial intelligence. We will consider only one of them, which is called the logical knowledge model. This approach is used in the PROLOG programming system (Prolog is discussed in the second part of the book). According to the logical model, the knowledge base consists of facts and rules. And now let's give a general definition of the concepts of "fact" and "rule". A fact is a message (information) about a specific event, about a property of a specific object, about its connection with other objects. For example, the following statements are facts: - pine - coniferous tree; - Columbus discovered America in 1492; - the density of water is 1 g/cm; - King Solomon - son of King David; - Leo Tolstoy is a Russian writer. A rule is a statement that has more generality than a fact. Rules define some concepts through others, establish the relationship between various properties of objects, formulate the laws of nature or society. The knowledge base is a collection of fundamental facts and rules in a particular subject area. Recently, a new specialty “knowledge engineer” has appeared, whose task is to formalize knowledge, develop knowledge bases and create artificial intelligence systems based on them. Our example is very simple. Here it is not difficult to guess what facts are fundamental, and to formulate a complete set of rules. In more complex subject areas, this task is much more difficult. Often only a major specialist (expert) or a team of specialists with great knowledge in this field can solve it. Briefly about the main thing. The logical model of knowledge in a particular subject area is represented by a knowledge base composed of facts and rules. A fact is information about a specific event, about a property of a specific object, about its connection with other objects. Rules define some concepts through others, establish the relationship between various properties of objects, formulate the laws of nature or society. The knowledge base includes "only the fundamental facts for this subject area. Home Test tasks 1. 2. 3. 4. Task No. 1 Task No. 2 Task No. 3 Task No. 4 End When did the direction called "Artificial Intelligence" appear in computer science? A. In the 50s B. In the 60s C. In the 70s D. In the 80s Right Next Think Next What is a knowledge base? A. The knowledge base is information about a specific event, about the property of a specific object, about its connection with other objects. B. A knowledge base is a set of fundamental facts and rules in a particular subject area C. A knowledge base is D. A knowledge base is a development statement that has more generality than a fact. knowledge formalization methods for entering them into computer memory as a knowledge base What is reasoning modeling? A. Creation of computer programs, B. Development of methods that imitate the logic of human thinking in solving various problems. formalization of knowledge to enter them into computer soldering as a knowledge base. C. This is a model of human knowledge in D. This is an algorithm for a specific subject area. recorded in the language of the performer. What is a FACT? A. Any object consisting of B. This information about the composition and C. A message about a specific D. This is a certain order of many interconnected parts and the structure of the system, presented in a graphic existing as a whole. form. event and property of a particular object, its relationship with other objects. combining the elements that make up the system.

Related articles: