0
$\begingroup$

I would like to solve a recurrence relation of the form

RSolve[
 {
   h[n] == p[n]*h[n + 1] + q[n]*h[n - 1] + (1 - p[n] - q[n])*h[n]
  ,h[1] == 0.5
  ,h[Nn]==0.5*h[Nn-1]
 }, h[n], n]

where Nn is some boundary condition. This runs and produces a solution, but it doesn't understands that the Nn is the upper bound for n, how can I supply this constraint?

$\endgroup$
2
  • 1
    $\begingroup$ What difference does it make if Nn is upper or not upper if Mma gives answer for all values of n? $\endgroup$
    – Andrew
    Apr 11, 2018 at 12:10
  • $\begingroup$ I can swap 'Nn' in when I see n in the answer indeed, but perhaps a neater formula would be spit out with fixing the boundary $\endgroup$
    – Three Diag
    Apr 11, 2018 at 12:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.