# Predictive Scheduling with Markov Chains and ARIMA Models
## 3 Production Scheduling under Technological Machine Failure Constraint
### Prediction of Failure and Machine Repair Times  
In the paper, we analyze the system describing the shift on which a failure occurs. Additionally, the repair time [37] required for failure removal is analyzed. Let \((\Omega,\mathcal{F},P)\) be a probabilistic space: \(\Omega\)--sample space (set of elementary events, outcomes), field \(\mathcal{F}\) is a family of sample space \(\Omega\) (set of all subsets of sample space \(\Omega\)), \(P\)--probability measure (function that assigns each element from field \(\mathcal{F}\) the probability, the value between 0 and 1), \(N\)--a set of natural numbers, \(R\)--a set of real numbers, \(S=\{s_{1},s_{2},\ldots,s_{k}\}\)--a set of possible shifts, \(k\in N\), \(k<\infty\)--the number of possible shifts. **Definition 1**. : _A family \(\{X_{t}\}_{t\in N}\) of random variables \(X_{t}:\Omega\to S\) for any \(t\in N\) is called a stochastic process with discrete time [38; 39]._  
At any \(t\in N\) time, the system can take one of the possible states denoted as \(X_{t}(\omega)=x_{t}\in S\) and \(P(X_{t}(\omega)=s_{i})=p_{i}(t)\) value means the probability that the system is in a state \(s_{i}\in S,1\leq i\leq k\) at a moment \(t\in N\), and \(\sum_{i=1}^{k}p_{i}(t)\ =1\). **Definition 2**. : _A stochastic process \(\{X_{t}\}_{t\in N}\) with a discrete time is called a Markov chain [38; 39]. If for each \(n\in N\), moments \(t_{1},t_{2},\ldots,t_{n}\in N\) satisfying the condition \(t_{1}<t_{2}<\ldots<t_{n}\) and any \(x_{1},\ x_{2},\ldots,\ x_{n}\ \in S\), the equality:_  
\[P(X_{t_{n}}=x_{n}|X_{t_{n-1}}=x_{n-1},\ X_{t_{n-2}}=x_{n-2},\ \ldots,\ X_{t_{1}}=x_{1})=P(X_{t_{n}}=x_{n}|X_{t_{n-1}}=x_{n-1}), \tag{7}\]  
_holds._  
Below we assume \(t_{n}=n\in N\). If \(\{X_{t}\}_{t\in N}\) is a heterogeneous Markov chain, then for any \(t\in N\) and \(1\leq i,j\leq k\), the value:  
\[P\left(X_{t}=s_{j}|X_{t-1}=s_{i}\right)=p_{ij}(t), \tag{8}\]  
is the transition probability from \(s_{i}\) state at the moment \(t-1\) to \(s_{j}\) state at moment \(t\). From Markov property (7), the conditional probability distribution of the future process state depends only on the current state at moment \(t\), regardless of the past. The matrix \(P(t)=\left[p_{ij}(t)\right]_{1\leq i,j\leq k}\) is called the transition probabilities matrix at the moment \(t\) and the elements of the \(P(t)\) matrix satisfy the condition \(\sum_{j=1}^{k}p_{ij}(t)=1\) for \(t\in N\) and \(1\leq i\leq k\). **Definition 3**. : _The Markov chain \(\{X_{t}\}_{t\in N}\) is homogeneous, if the probabilities of transition \(p_{ij}(t)\) do not depend on the moment \(t\in N\)._  
Thus, if for a homogeneous Markov chain [39; 40] the matrix \(P=\left[p_{ij}\right]_{1\leq i,j\leq k}\) satisfies the condition \(\sum_{j=1}^{k}p_{ij}=1\), \(1\leq i\leq k\), then it is known as the one-step transition probability matrix. From the above,for a homogeneous Markov chain, the transition probability from \(s_{i}\) state at \(t\) moment to the \(s_{j}\) state at \(t+n\) moment is calculated as follows [38; 40]:  
\[P\Big{(}X_{t+n}=s_{j}\big{|}X_{t}=s_{i}\Big{)}={p_{ij}}^{(n)} \tag{9}\]  
where \(\Big{[}p_{ij}^{(n)}\Big{]}_{1\leq i,j\leq k}=P^{n}\), \(n\in N\) is the transition probability matrix in \(n\) steps. **Definition 4**. : _If \(\ \ \{X_{t}\}_{t\in N}\) is a homogeneous Markov chain and there is a distribution \(\pi=(\pi_{1},\pi_{2},\ldots,\pi_{k})\) where \(\pi_{i}\geq 0\), \(1\leq i\leq k\) and \(\sum_{i=1}^{k}\pi_{i}=1\) satisfying the equation:_  
\[\pi P=\pi \tag{10}\]  
_then the distribution \(\pi\) is called the stationary distribution of the homogeneous Markov chain._  
This property means that if at some \(n\in N\) moment the chain reaches a stationary distribution, then for each subsequent moment greater than \(n\), the distribution will remain the same. To determine the stationary distribution, we solve Equation (10).