ANALYSIS OF BASKETBALL GAME STATES AND TRANSITION PROBABILITIES USING THE MARKOV CHAINS

The abstract system of a basketball game has been established in the paper. Parts of the game are marked with the common characteristics; they are repeated, therefore, they can be denoted with the category: game states. The presented model enables the recognition and analysis of interaction between the set of system states. The discretization of the continuous course or ﬂ ow of a basketball game and the de ﬁ nition of equivalence among game states have given the prerequisites for the determination of transition probabilities between system states. Discrete stochastic processes and Markov chains were used for events modeling and transition probabilities calculation between the states. The matrix of transition probabilities has been structured between particular states of the Markov chain. The proposed model differentiates game states within four phases of game ﬂ ow and enables the prediction of the future states.

ciations of offensive and defensive tactical intentions (Hernandez, 1987;Trninić, 1995).It also gives opportunity for mathematical formalization and for the analysis of complex interactions within the system of the game of basketball (Trninić, Perica, & Pavičić, 1994).Lapham and Bartlett (1995), McGarry et al. (2002) and Lees (2002) consider research into the complex interactions that occur in sport competition very important and propose further explorations of them.
The processes of cooperation and opposition emphasize the cognitive component of the game.They are treated as the process of interaction in which team-mates cooperate while performing innumerable Igor Jelaska 1  Slavko Trninić 1  796.323.2.052.244Ante Perica 2  Original scientifi c paper 1 University of Split, Faculty of Kinesiology 2 KK "ECE Bulls" Kapfenberg, Austria

INTRODUCTION
Worldwide popular team sport game with the ball known as basketball has its specifi c structural and functional characteristics which separate it from the other team sports, although they all belong to the same tree of ball sports games, like soccer, team handball, hockey, rugby, water-polo, the core of their nature being simultaneous existence of relationships of cooperation and opposition within the system of the game (Trninić, 1995;Trninić et al., 2010aTrninić et al., , 2010b)).Functional approach to the analysis of basketball game enables the decomposition of the system of interaction and interdependence of parameters within the structure of the game as well as the functional analysis of relationships and asso-tasks/jobs in the game.Simultaneously, players of the two intra cooperating systems on the court belong to the two opposing teams which employ the results of their cooperation to resist and outplay each other and win over each other (Trninić, 1995).
Therefore, basketball game must be observed as a complex phenomenon.In top-level sport that complexity, depending on the observer's standpoint, may be highlighted from the perspective of: players, expert coaches, managers, or scientists (Trninić, Jelaska, & Papić, 2009a).In this paper basketball is observed as a set of knowledge composed of several layers; it is called the body of basketball knowledge (Trninić, 1995;Trninić, Trninić, & Jelaska, 2010).In a competition, during a match, practical and conceptual knowledge of individual players and of the whole team is constantly scrutinized.
Basketball game can be observed, from the expert coaches and players' point of view, as the arranged, ordered sequence of game tasks each and every player must carry out relative to his/her playing position and role within a particular model of play tactics (Trninić, 1995;Trninić, et al., 2010aTrninić, et al., , 2010b)).The realization of the game tasks implies successful application of individual technical-tactical knowledge and skills on the court in the actual game situations.Successful application of individual technical skills and tactics is not possible if not coordinated with team-mates' individual technical skills and tactics through the collective team tactics the aim of which is accomplishment of individual and common goals, that is, to win a match by counter playing the same intentions of the opposing team and players.Trninić (1995) explains that game tasks individually classify motor activities and motor behavior of particular players in respect to playing position and the role within a team and a model of play tactics.That primarily regards basketball specifi c anthropological demands including: cognitive-motor (technical-tactical), energy-related (intensity of play) and socio-motor components of activities performed on the court i.e. coordination and opposition (Trninić, 1995).All the three components are manifested in solving and realizing particular game situations and in the fl ow of actions within game phases and models of play tactics, then in the intrinsic and extrinsic loads in training and competition activities as well as in the constellation of relevant sport-specifi c characteristics and state of players, being responsible for successful realization of particular playing positionspecifi c tasks in a game.
Trninić, Perica and Pavičić (1994) as well as Perica, (2011) and Jelaska (2011) described mathematically the system "basketball game".The achievement of that model is the recognition of the two basic system states -position and transition, from the aspect of the kinematic description.These states are (1) position, or in the vocabulary of basketball practice the positional/set offense and the positional/set defense, and (2) conversion -transition (Knight, 1994), the state of transmuting defense into offense, and vice versa.Conversion -transition are interpreted as a switch, a connection between the phases of defense and offense.The tasks players of both (opposed) teams carry out on the court on particular playing positions, in relation to the position of the ball as the centre of communication, structure and generate various game states.

SYSTEM MODELLING
During the game the players recognize and anticipate events in play and, in accord with that, they make selective decisions and react (Trninić, 1995;Trninić, et al., 2010aTrninić, et al., , 2010b)).The system in basketball can be understood as a set of all participants in a match.In consideration the limitation can be put on just the ball and the players.However, in the context of actual competition one must include also referees, coaches and other offi cials, bench players, and even spectators (Trninić, Perica, & Pavičić, 1994).Further, in the context of structural analysis of knowledge in the game of basketball the category of game states has been established using kinematic description of the game.The position of game states in the hierarchical structure of basketball tree has been defi ned in the space between game tasks (bellow) and play tactics (above) (Trninić, 1995(Trninić, , 2006)).

Previous research using the Markov chains in sports
Team sports games are multilayer and complex sports activities in which a symbiosis of abundant cyclic and acyclic movements with the ball and without it can be seen (Trninić, 1995).They are de-termined by the relationships of cooperation between team-mates and of opposition between the opposing players and teams.A basketball match has its continuous course or game fl ow.It can be presented as an arranged sequence of tasks which, when realized on the court, generate game states (Trninić, Perica, & Pavičić, 1994).Within our model of basketball game states analysis it is assumed that the game fl ow has been discretized into defi nitely many moments or time parts.Also, the game fl ow has its three basic game states or phases: offense, defense and conversion (Jelaska, 2011;Knight & Newell, 1986;Perica, 2011).
Each phase of game fl ow has its specifi c characteristics conditioned by very specifi c and particularly defi ned goals within the complex collective tactical operation, which corroborate the notion that basketball game is high level tactical complexity sport.
The Markov chains have appeared in kinesiology/sports science for the fi rst time in 1977 applied in Bellman's paper.Norman (1999) made an overview of 17 scientifi c papers in which he analyzed the possibilities to use stochastic processes for modeling in kinesiology/sports sciences, whereas Clarke and Norman (1998) utilized stochastic techniques to investigate various decision-making processes in the game of cricket.Lees (2002) advocates for new methods, for example, the use of artifi cial neural networks, to be used in kinesiology for establishing characteristics of the whole (biomechanical) skills, instead of quantitative analysis because these new methods can be a useful tool to overcome limitations of classical statistical methods.
For example, Hirotsu and Wright (2003b) analyzed the game of baseball using the Markov chains.
They demonstrated how that approach might help to select optimal hitting strategies and how much the probability of winning increases if obtained strategy is followed.Also, the probability of winning in any state in the course of a game was calculated by using the Markov model -they solved the linear system of over one million simultaneous equations.
Bukiet, Harold and Palacios (1997) proposed an approach adoptable to be able to directly include the effects of pitching and defensive abilities.The approach can also be applied to fi nd optimal batting orders, run distributions per half inning and per game, and so on… Hirotsu and Wright (2003a) proposed, based on the actual data, a statistical model of an American football match that could be useful in providing deeper insights into team characteristics.
Lames used the fi nite Markov chains as a model for game sports, including its calculus (Kemeny, & Snell, 1976).Simulations were undertaken to assess the usefulness of certain tactical behaviors, as well as to assess the performance of individual players in team games.This idea was applied to tennis (Lames, 1988;1991) (Zhang, 2003) and team handball (Pfeiffer, 2003).Shirley (2007) indicates the states of the Markov chain are defi ned in terms of three factors: 1. which team has the ball possession (2 factors): Home or Away (Host or Guest); 2. How that team gained the ball possession (5 factors): Inbound pass, Steal, Offensive Rebound, Defensive Rebound, Free Throws; 3. the number of points that were scored on the previous possession (4 factors): 0, 1, 2, or 3. the largest possible model would have 2  5  4 = 40 states, but since certain combinations of the 3 factors are impossible, the largest model has 30 states.Also, making certain assumptions about the course of action in a basketball game can further reduce the number of game states.If one assumes, for example, that rare events like 4-point plays or loose ball fouls following missed free throws are impossible, then certain states can be eliminated without seriously affecting the usefulness of the model.The proposed model can provide a very detailed "micro simulation" of a basketball game.Quantities of interest can be computed via simulation.Some examples of these might be: 1. in-game win probabilities for a given team; 2. the expected number of points scored in a possession gained in different ways, such as offensive rebounds vs. defensive rebounds; and 3. the change in win probability as a function of the number of the ball possessions in a game; i.e. how useful a strategy is to "slow down the game?".

Basketball game modeling using the Markov chain
Within the context of the mentioned defi nition of basketball game states (Jelaska, 2011;Perica, 2011;Trninić, Perica, & Pavičić, 1994), it is obvious there are infi nitely many different states of the game.Such defi nition of the basketball game states, although formal and scientifi c, is not practical to be submitted to the Markov chains analysis.Therefore, we have to get defi nite number of game states.It would be done by equivalency analysis.We defi ne that two states are equivalent if they are alike in terms of space-time relationship.The feature of transitivity should be emphasized here, that is, if A and B are equivalent states and if C and D are also equivalent states, then A and C will be also equivalent states.Now the state of the Markov chain can be defi ned as the set of the entire states equivalent to a certain state.
Apparently, a single state of the Markov chain consists of infi nitely many interequivalent states, as well as a particular game state can be found only in one state of the Markov chain.A single state of the Markov chain occurs in the interval     t t t i i , where t  is selected empirically, so that our consid- eration would have a practical purpose.
From the Markov chains' aspect, the momentary state of the Markov chain has all the information needed for the decision-making about the selection of its immediately following state, that is, for the calculation of transition probability into the future state.It is an adequate model for our approach to the analysis of basketball game states, since any action in the state of position/transition in the moment t is a consequence, result of previous game states, therefore, no any additional information is needed for the determination of transition probability into the future game state.
The assumption is that the realization of tasks of individual players within a particular play tactics model generates the total of 1.We introduce states in four phases of game fl ow: • positional/set defense (n 1 states) -the fi rst set of states • transition defense (n 2 states) -the second set of states • transition offense (n 3 states) -the third set of states • positional/set offense (n 4 states) -the fourth set of states 2. The states with the unsuccessful outcome (n 5 states) -the fi fth set of states 3. The states with the successful outcome (n 6 states) -the sixth set of states 4. The state of a starting jump for the ball (one state) -the seventh set of states.
The standard assumption is that probability is for the transition between the states of the Markov chains being independent of the moment t for all the game states i,j and for all moments t.The equation probability of the transition into the state j in the moment (t+1) if in the previous moment t the chain has been in the state i.We will use the following notation the state of positional/set offense.The states from the other sets of game states are noted accordingly.
A particular phase of a game can be divided into the initial, intermediate and fi nal sub phases (Perica, 2011;Jelaska, 2011), where it is possible to have I i initial states, M i intermediate states and F i fi nal states, and where the following is valid I i +M i +F i =n i .
The matrix containing transition probabilities for the phases of positional/set and transition offense, P i,i i=3,4 (a diagonal elements of the block matrix P) will be a squared matrix with n i rows and n i columns of the following shape: Further, we assume that in the initial moment, t = 0, the starting jump for the ball is actively recognizable.That is, if with k we denote the state of the starting jump for the ball, then it would be valid that: Consequently, the Markov chain transition matrix is a block matrix P of the order N represented by:   7 ,..., 1 , ,   j i j i P P (2) where P i,j , i,j=1,...,7 are matrices of transition probabilities from the n i state of the i set states into the n j state of the j set of states.In it, the single block matrix P i,j is the dimension As, for example, the following is true 0 then in the proposed model it is not possible to transmute directly from the state of set/positional defense into the state of transition offense.That is because to transit from the set defense into the transition offense the decisive state of either success or failure of any previous play action should occur and, secondly, because it is not possible to transit directly from the transition offense into the set defense.Out of this follows that P 1,3 = P 3,1 = 0 (null matrix).Similar is valid for the transition from the set offense into the transition defense, and vice versa.Further analysis of game structure discloses the matrix P is the block matrix of the following form: The elements of the matrix P are interpreted in the following way: 1. Matrices P i,5 , P i,6 and P i,7 for i=1,...,4 are performance indicators within a particular game phase, because they contain probabilities of entering the states of success/failure.2. P 2,1 and P 3,4 are the basketball game intensity (tempo) control indicators.In borderline instances, when blocks P 2,1 and P 3,4 converge to null matrix, that indicates high intensity and uncontrolled play.
The future experimental research studies should reveal preferred game models (combinatory) in every individual team as well as in the elite class of European basketball as a whole (Euroleague).In other words, the preferred "walks" along the Markov chain should be found within a particular phase and sub phase of game fl ow.
The process of in-season sports preparation and team play coordination improvement will probably change values of certain matrix elements, that is, transition probabilities will change.Effi ciency, or successfulness increase of the preferred combinatory is expected in all phases of game fl ow.
The fi rst block matrix of transition probabilities is the null matrix according to the defi nition of variables of the initial states of the positional/set and transition offense (Jelaska, 2011;Perica, 2011).
The matrix containing transition probabilities for the phase of positional/set and set defense P i,i i=1,2 will be a squared matrix with n i rows and n i columns of the following shape: The matrix has a structure in accord with the defi nition of variables of the positional/set and transition defense (Jelaska, 2011;Perica, 2011).
The upper right sub block of the matrix P i,i indicate again game intensity or tempo of play.When it tends to the null block matrix, it indicates the controlled game fl ow ("prolonged offense").
Our assumption is also that the process is stationary within the framework of one match, that is, particular probabilities do not change during a match.

CONCLUSIONS
Investigations, validation, and evaluation of events in the game of basketball are necessary for scientifi c foundation of applicative kinesiology in sport.In the present paper the concept of game states has been defi ned from the aspect of the Markov chains' application in the theory of complex sports activities.The continuous game fl ow has been discretized and explained as one characteristic sequence, order of game states.An abstract system of basketball game has been shaped in the paper as the theoretical foundation for its later detailed elaboration and verifi cation of its operation.The discretization of the continuous course or fl ow of a basketball game and the defi nition of equivalence among game states have given the prerequisites for the determination of transition probabilities between system states.A mathematical model, the Markov chain and discrete stochastic process have been used to describe the interaction among the system states.The matrix of transition probabilities has been structured between particular states of the Markov chain.The proposed model differentiates game states within four phases of game fl ow and enables the prediction of the future states.The application of the model in kinesiology/ sport science research studies will allow the recognition of prevailing game tendencies in the European elite basketball, thus enabling, through the calculated parameters, the recognition whether there are any tendencies to control game intensity, what are the levels of tactical combinatory, and what are the preferred tactical models of particular teams.
The future research guidelines should establish and explain the relationships and connections between particular game states and game phases, and the determination of numerical values in the proposed operational model.So, the analysis of transition probabilities matrix values should probably be a considerable contribution to the situational approach in the empirical verifi cation of basketball regularities and balanced game principle.
From the aspect of sports games theory, the continuation of research is necessary on intrinsic set of information (internal states of players and the demands specifi c for a particular type of players), game states, game fl ow and balanced game as components of the system "basketball game".The fi nal, eventual aim should be the determination of relations and correlations between kinematic parameters of game states and intrinsic parameters of balanced game, as well as the construction of a mathematical model which will embrace these associations also.
the four basic groups of game states: