The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
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.
Huh

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
Find all posts by this user
Quote this message in a reply
Post Reply 


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 - 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 - 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 - walter b - 08-29-2014, 09:47 AM
RE: stack lift and change sign - walter b - 08-29-2014, 04:11 PM
RE: stack lift and change sign - walter b - 08-29-2014, 07:54 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 - Les Bell - 08-11-2014, 01:41 AM
RE: stack lift and change sign - Paul Dale - 08-11-2014, 06:44 AM
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 - walter b - 08-29-2014, 12:55 PM
RE: stack lift and change sign - walter b - 08-29-2014, 01:25 PM
RE: stack lift and change sign - walter b - 08-29-2014, 02:04 PM
RE: stack lift and change sign - walter b - 08-29-2014, 02:25 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 - walter b - 08-29-2014, 09:21 PM



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