Instead of probability, find the expected number of moves before the knight leaves the board. Let = expected moves from . If on board: where are valid destinations. Off-board destinations contribute 0 (no future moves).
This creates a system of equations. Solve iteratively: initialize all , then update until convergence. Or use Gaussian elimination for exact solution.