HP Forums
On the format of the output of fMax - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: On the format of the output of fMax (/thread-1728.html)



On the format of the output of fMax - Alberto Candel - 06-27-2014 12:32 AM

In CAS, the input fMax(f(x),x=a..b) returns a sequence consisting of the numbers x between a and b where the function f attains a Max value. For example, fMax(x^2, x=-2..2) returns -2,2. However, if there is just one such value x, it returns seq[x], like fMax(x+1,x=-2..2) returning seq[2].
Why not just 2, or even better, {2} (or {-2,2} above)?

Some of my Adv Calc students have a Prime (because I suggested it to them) and at first could not understand the "seq[x]" thing.

(As Helge points out below, there was a typo. I have replaced fMax(x+1,x=-2,2) with fMax(x+1,x=-2..2).)


RE: On the format of the output of fMax - Helge Gabert - 06-27-2014 01:50 PM

Not sure what you are meaning to say, and there must be a typo somewhere in the OP, because fMax(x+1,x=-2,2) is non-sensical and returns an error message for me "Bad argument value."

fMax(x+1,x=-2..2) returns 2 (correct). I don't get the seq[.] output at all.


RE: On the format of the output of fMax - parisse - 06-27-2014 04:27 PM

The output of fMax is a sequence, that is a list of values without delimiters. Since you could not make the distinction between a sequence of one element and the element, the sequence is printed with seq[ ... ] if there is one element inside.


RE: On the format of the output of fMax - Alberto Candel - 06-27-2014 04:30 PM

(06-27-2014 01:50 PM)Helge Gabert Wrote:  Not sure what you are meaning to say, and there must be a typo somewhere in the OP, because fMax(x+1,x=-2,2) is non-sensical and returns an error message for me "Bad argument value."

fMax(x+1,x=-2..2) returns 2 (correct). I don't get the seq[.] output at all.

Yes, there was a typo. Fixed it. Thanks!
But I do get seq[2]. Maybe we have different settings somewhere in the Prime system?


RE: On the format of the output of fMax - Helge Gabert - 06-27-2014 05:26 PM

Yes, we must have different CAS settings.

I have angle measure: rad, number format: std, integers: dec, simplify: min, exact, use sqrt, principal, use i checked.

The second settings page probably doesn't matter.

[By the way, it would be neat, if at some point in the future fMin and fMax could be expanded to also find minima and maxima in two (or more) dimensions . . . just dreaming].


RE: On the format of the output of fMax - Alberto Candel - 06-27-2014 07:53 PM

(06-27-2014 05:26 PM)Helge Gabert Wrote:  Yes, we must have different CAS settings.

I have angle measure: rad, number format: std, integers: dec, simplify: min, exact, use sqrt, principal, use i checked.

The second settings page probably doesn't matter.

[By the way, it would be neat, if at some point in the future fMin and fMax could be expanded to also find minima and maxima in two (or more) dimensions . . . just dreaming].

well, i have the same settings as you, but still get seq[.].


RE: On the format of the output of fMax - Helge Gabert - 06-27-2014 08:51 PM

[attachment=903]


OK, here is the emulator screen (physical prime is the same).


RE: On the format of the output of fMax - DrD - 06-27-2014 09:09 PM

After purge(x):

fMax(x+1,x=-2..2) results in seq[2]

At first the "error: Bad Argument" result was received because x had a previous value. I used purge to remove the x variable before this would work.

-Dale-


RE: On the format of the output of fMax - Alberto Candel - 06-28-2014 04:53 AM

(06-27-2014 05:26 PM)Helge Gabert Wrote:  Yes, we must have different CAS settings.

I have angle measure: rad, number format: std, integers: dec, simplify: min, exact, use sqrt, principal, use i checked.

The second settings page probably doesn't matter.

[By the way, it would be neat, if at some point in the future fMin and fMax could be expanded to also find minima and maxima in two (or more) dimensions . . . just dreaming].

well, i have the same settings as you, but still get seq[.].


RE: On the format of the output of fMax - parisse - 06-28-2014 06:11 AM

seq[...] is displayed if textbook display is not checked.


RE: On the format of the output of fMax - Alberto Candel - 06-28-2014 02:36 PM

(06-28-2014 06:11 AM)parisse Wrote:  seq[...] is displayed if textbook display is not checked.

Yes! thank you! i forget that there is textbook display and textbook entry.