stack lift and change sign
|
08-10-2014, 09:48 AM
Post: #1
|
|||
|
|||
stack lift and change sign
There was a recent thread where someone pointed to an exercise with the following recursive definition:
\[ u_1=\frac{3}{2} \\ u_{n+1}=\frac{n u_n + 1}{2(n+1)} \] For this sequence we can find a closed formula: \[u_n=\frac{2^{-n}+1}{n}\] This is the program I came up with: ENTER CHS 2 X<>Y Y^X 1 + X<>Y / Everything went fine with the HP-15c until I tried to calculate \(u_0\). My expectation was to get an error but alas I got different results. Thus I tried to find the reason: it appears that CHS doesn't enable the stack lift if the value in register X is 0. All this lead me to the following test-case: a ENTER CHS b For a and b I used different values: a = 7, b = 2 \[\begin{matrix} Model & X & Y & Z & T \\ 35 & -2 & 7 & * & * \\ 45 & 2 & 7 & * & * \\ 15c & 2 & -7 & 7 & * \\ 41c & 2 & -7 & 7 & * \\ \end{matrix}\] a = 0, b = 2 \[\begin{matrix} Model & X & Y & Z & T \\ 35 & -2 & 0 & * & * \\ 45 & 2 & 0 & * & * \\ 15c & 2 & 0 & * & * \\ 41c & 2 & 0 & 0 & * \\ \end{matrix}\] It appears that this behavior changed over time in HP-calculators. Cheers Thomas |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 8 Guest(s)