Wald’s identity governs sums SN=∑i=1NXi where N is a stopping time for the i.i.d. sequence Xi (determined by the process up to time N, with E[N]<∞):
E[SN]=E[N]E[X].
For “first time exceeding a threshold” problems, when N is defined by SN−1≤x<SN, the overshoot and N itself can be studied via the renewal-type function m(x)=E[Nx], satisfying
m(x)=1+∫max(0,x−1)xm(u−t)f(t)dt
(conditioning on the first step), or in closed form m(x)=ex for Unif(0,1) steps on [0,1], extended piecewise beyond. For a Markov chain on residues mod k with each step uniformly permuting the residue, hitting a fixed residue is geometric with success probability 1/k regardless of current state.