stack lift and change sign
08-10-2014, 09:48 AM
Post: #1
 Thomas Klemm Senior Member Posts: 1,993 Joined: Dec 2013
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 »

 Messages In This Thread stack lift and change sign - Thomas Klemm - 08-10-2014 09:48 AM RE: stack lift and change sign - walter b - 08-10-2014, 11:44 AM RE: stack lift and change sign - d b - 08-11-2014, 06:08 AM RE: stack lift and change sign - Paul Dale - 08-11-2014, 06:21 AM RE: stack lift and change sign - Massimo Gnerucci - 08-11-2014, 06:23 AM RE: stack lift and change sign - walter b - 08-27-2014, 11:30 AM RE: stack lift and change sign - d b - 08-27-2014, 02:32 PM RE: stack lift and change sign - walter b - 08-27-2014, 03:57 PM RE: stack lift and change sign - Massimo Gnerucci - 08-27-2014, 06:41 PM RE: stack lift and change sign - Andreas - 08-27-2014, 07:40 PM RE: stack lift and change sign - d b - 08-29-2014, 04:45 AM RE: stack lift and change sign - walter b - 08-29-2014, 09:15 AM RE: stack lift and change sign - Massimo Gnerucci - 08-29-2014, 09:29 AM RE: stack lift and change sign - walter b - 08-29-2014, 09:47 AM RE: stack lift and change sign - Mark Hardman - 08-29-2014, 03:56 PM RE: stack lift and change sign - walter b - 08-29-2014, 04:11 PM RE: stack lift and change sign - Mark Hardman - 08-29-2014, 05:16 PM RE: stack lift and change sign - walter b - 08-29-2014, 07:54 PM RE: stack lift and change sign - Gerson W. Barbosa - 08-29-2014, 06:15 PM RE: stack lift and change sign - walter b - 08-31-2014, 06:23 AM RE: stack lift and change sign - walter b - 08-29-2014, 08:21 PM RE: stack lift and change sign - Mark Hardman - 08-29-2014, 08:51 PM RE: stack lift and change sign - Thomas Radtke - 08-10-2014, 12:14 PM RE: stack lift and change sign - Thomas Klemm - 08-10-2014, 12:44 PM RE: stack lift and change sign - Thomas Ritschel - 08-10-2014, 01:27 PM RE: stack lift and change sign - Katie Wasserman - 08-10-2014, 01:50 PM RE: stack lift and change sign - Les Bell - 08-11-2014, 01:41 AM RE: stack lift and change sign - Sylvain Cote - 08-10-2014, 02:00 PM RE: stack lift and change sign - Paul Dale - 08-11-2014, 06:44 AM RE: stack lift and change sign - ElectroDuende - 08-28-2014, 12:18 PM RE: stack lift and change sign - Thomas Radtke - 08-28-2014, 02:21 PM RE: stack lift and change sign - Marcus von Cube - 08-28-2014, 08:07 PM RE: stack lift and change sign - walter b - 08-28-2014, 08:33 PM RE: stack lift and change sign - Paul Dale - 08-28-2014, 10:05 PM RE: stack lift and change sign - Thomas Radtke - 08-28-2014, 10:17 PM RE: stack lift and change sign - walter b - 08-29-2014, 12:55 PM RE: stack lift and change sign - Thomas Radtke - 08-29-2014, 01:10 PM RE: stack lift and change sign - walter b - 08-29-2014, 01:25 PM RE: stack lift and change sign - Thomas Radtke - 08-29-2014, 01:43 PM RE: stack lift and change sign - walter b - 08-29-2014, 02:04 PM RE: stack lift and change sign - Thomas Radtke - 08-29-2014, 02:13 PM RE: stack lift and change sign - walter b - 08-29-2014, 02:25 PM RE: stack lift and change sign - Thomas Radtke - 08-29-2014, 02:37 PM RE: stack lift and change sign - walter b - 08-29-2014, 03:05 PM RE: stack lift and change sign - Paul Dale - 08-31-2014, 07:25 AM RE: stack lift and change sign - RMollov - 08-31-2014, 09:40 AM RE: stack lift and change sign - walter b - 08-31-2014, 11:26 AM RE: stack lift and change sign - walter b - 08-31-2014, 08:50 PM RE: stack lift and change sign - Paul Dale - 08-31-2014, 09:52 PM RE: stack lift and change sign - walter b - 09-01-2014, 10:36 AM RE: stack lift and change sign - Paul Dale - 09-01-2014, 11:38 AM RE: stack lift and change sign - walter b - 09-01-2014, 06:56 PM RE: stack lift and change sign - ElectroDuende - 08-29-2014, 01:00 PM RE: stack lift and change sign - walter b - 08-29-2014, 09:21 PM RE: stack lift and change sign - Thomas Klemm - 08-29-2014, 07:40 PM RE: stack lift and change sign - Thomas Klemm - 06-23-2015, 07:43 PM

User(s) browsing this thread: 1 Guest(s)