Post Reply 
Two calculator exam problems
05-27-2014, 01:47 PM
Post: #1
Two calculator exam problems
I would greatly appreciate seeing solutions to the following problem:

A. Let f(x) = 1 +x(2 - x(3 - x(4 - x(1 + x)))). Find the solution to
f(f(x)) = 1/2 that is nearest to x = 0.


And, especially if they would provide further insight, solutions to this:

B. Let f(x) = sin (1/x) and define g(x) = f(f(f(f(x)))). Find the maximum value of g(x) for x in the range 102 to 103.2.

Many thanks in advance.
Find all posts by this user
Quote this message in a reply
05-27-2014, 02:48 PM
Post: #2
RE: Two calculator exam problems
Tailor series ?
Find all posts by this user
Quote this message in a reply
05-27-2014, 03:24 PM (This post was last modified: 05-27-2014 03:30 PM by CR Haeger.)
Post: #3
RE: Two calculator exam problems
(05-27-2014 01:47 PM)Peter Murphy Wrote:  I would greatly appreciate seeing solutions to the following problem:

A. Let f(x) = 1 +x(2 - x(3 - x(4 - x(1 + x)))). Find the solution to
f(f(x)) = 1/2 that is nearest to x = 0.


And, especially if they would provide further insight, solutions to this:

B. Let f(x) = sin (1/x) and define g(x) = f(f(f(f(x)))). Find the maximum value of g(x) for x in the range 102 to 103.2.

Many thanks in advance.
Using HP Prime

A. Defining f(x):=1 +x(2 - x(3 - x(4 - x(1 + x)))), then g(x):=f(f(x)) then fsolve(g(x)=1/2, x, -1..1) yields five roots between -1 to +1 with +0.21399.... closest to zero. Defining Function.F1:=g(x)-1/2 lets you view this interesting curve.

B. Similarly. define f(x):=sin(1/x) then g(x):=f(f(f(f(x))). Defining Function.F2:=g(x) lets you graphically explore g(x) in the range 102-103.2 (assumed degrees?). Although 102 appears highest, 103.2 is max at 0.9459... - there seems to be a local max of ~1.00 at ~103.25 degrees..

Best,
Carl
Find all posts by this user
Quote this message in a reply
05-28-2014, 02:11 PM
Post: #4
RE: Two calculator exam problems
Carl, the Prime seems ideally suited for such problems.

Can you (or anyone) show me how to set up and solve them on a 50g (in RPN mode) or a 48G? I've puzzled over this for a good while.

The concept of the user-defined function (UDF) for the 48/50 calculators seems promising, but what I've done hasn't produced the structure that you exhibit in your Prime examples.

I now find that David Hayden solved such a problem (problem 13) back in 2009:

[url:http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv019.cgi?read=159915]

but he's taking for granted what I cannot see at all, namely how one sets up such nested functions in the first place.
Find all posts by this user
Quote this message in a reply
05-28-2014, 05:02 PM
Post: #5
RE: Two calculator exam problems
Peter - Im not very expert at the HP50G so I hope others will provide you (and I) some tips on how to setup these problems.

I will say that the HP Prime has been very nice to work with when in comes to symbolic/numerical solving and function graphing analysis tasks.
Find all posts by this user
Quote this message in a reply
05-28-2014, 06:30 PM
Post: #6
RE: Two calculator exam problems
(05-28-2014 02:11 PM)Peter Murphy Wrote:  but he's taking for granted what I cannot see at all, namely how one sets up such nested functions in the first place.

Code:
'f(x)=SIN(1/x)' ENTER
DEFINE
'g(x)=f(f(f(f(x))))' ENTER
DEFINE

You can have a look at how these function are defined. Just push them on the stack. For instance f(x):
Code:
\<< \-> x 'SIN(1/x)' \>>

Should you prefer RPL you could use this instead:
Code:
\<< \-> x \<< INV SIN \>> \>>

HTH
Thomas
Find all posts by this user
Quote this message in a reply
05-28-2014, 06:54 PM (This post was last modified: 05-28-2014 06:57 PM by dizzy.)
Post: #7
RE: Two calculator exam problems
The first one is easy:

Code:
\<<
  'F(X)'
  '1 + X*(2 - X*(3 - X*(4 - X*(1 + X))))'
  DUP UNROT = DEF
  F
  '1/2' -
  SOLVEVX
\>>

Which yields:

Quote:{X=0.213992196216 X=... }

Similarly:

Code:
\<<
'F(X)=SIN(1/X)' DEF
'SIN(1/X)' F F F
\>>

You could graph this or use try to optimize it somehow.
Find all posts by this user
Quote this message in a reply
05-28-2014, 09:29 PM
Post: #8
RE: Two calculator exam problems
Thanks Thomas and Dizzy for exactly what I was hoping to see.

Now to sit down and work out your solutions; I'll report back tomorrow.

Peter
Find all posts by this user
Quote this message in a reply
05-29-2014, 02:32 PM
Post: #9
RE: Two calculator exam problems
Thanks again Thomas and Dizzy. Your suggestions helped me break through my mental barrier on this stuff.

I still must explore Dizzy's solution to problem A, but I rendered f(x) as the corresponding coefficient array [ -1 -1 4 -3 2 1] 'F' STO.

Then this programmed expression

<< F F * PEVAL PEVAL .5 - >> STEQ

allowed me to plot g(x) and find x = 0.21399.

Now for problem B.

I am grateful for the existence of this Forum and for the generosity of its Users.
Find all posts by this user
Quote this message in a reply
Post Reply 




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