$U(i+j,i)=U(i+j)-U(i)$ and $P(i+j,i)=P(i+j)-P(i)$ for $j\in\mathbb{Z}^{+}$. The transition probability from state $m-1$ to state 0 is $1-q_{m}(i+m)$. Above, (\[eq:state\_transition\_probability\_2\_f\]) follows from the fact that the battery being in state $m-1$ in the $(i+m-1)^{\text{th}}$ frame has already been in states $0$ to $m-2$ in the time frames from the $i^{\text{th}}$ to the $(i+m-2)^{\text{th}}$. This also means that the battery was empty in the $i^{\text{th}}$ time frame, i.e., $e(i)=0$. In (\[eq:state\_transition\_probability\_2\_e\]), we invoke Bayes’ theorem. Moreover, since the energy arrival and demand processes are stochastic and ergodic, we can re-write (\[eq:state\_transition\_probability\_2\]) as $$\begin{aligned}
q_{m}=\frac{\Pr\left\{U(m)\geq P(m),\cdots,U(1)\geq P(1)\right\}}{\Pr\left\{U(m-1)\geq P(m-1),\cdots,U(1)\geq P(1)\right\}}\label{eq:state_transition_probability_2_add}\end{aligned}$$ for $m\in\{2,3,\cdots\}$, and $q_{1}=\Pr\left\{u(1)\geq p(1)\right\}$, where the battery is initially empty. Now, modeling the energy outages and consecutive energy supply guarantees as a Markov process, we have the state transition diagram given in Fig. \[fig:res\_2\]. Correspondingly, we can write the state transition matrix as follows: $$\begin{aligned}
\label{M}
M=\begin{pmatrix}
    1-q_1 & 1-q_2 & \cdots & 1-q_{m} & \cdots\\
    q_1 & 0 & \cdots & 0 & \cdots\\
    0 & q_2 & \cdots & 0 & \cdots\\
    \vdots &\vdots & \ddots&\vdots&\vdots\;\vdots\;\vdots\\
    0 & 0 & \cdots & q_{m} & \cdots\\
        \vdots &\vdots & \vdots\;\vdots\;\vdots&\vdots&\vdots\;\vdots\;\vdots
  \end{pmatrix}.\end{aligned}$$ Now, let $\boldsymbol{\pi}$ be the vector of steady-state probabilities, i.e., $\boldsymbol{\pi}=\{\pi_{0},\pi_{1},\cdots,\pi_{m},\cdots\}^{T}$ satisfying 