Post Reply 
Why won't the prime graph correctly?
05-22-2019, 02:16 PM
Post: #1
Why won't the prime graph correctly?
I'm trying to graph f(x) = x^0.4 * (x+3). However, it doesn't graph anything lower than x=0. Desmos graphs it correctly, but this doesn't. Any help?
Find all posts by this user
Quote this message in a reply
05-22-2019, 02:56 PM (This post was last modified: 05-22-2019 02:57 PM by Aries.)
Post: #2
RE: Why won't the prime graph correctly?
Try y = x^(2/5)*(x+3) Wink
Best,

Aries Smile
Find all posts by this user
Quote this message in a reply
05-22-2019, 03:08 PM (This post was last modified: 05-22-2019 03:17 PM by ijabbott.)
Post: #3
RE: Why won't the prime graph correctly?
(05-22-2019 02:16 PM)gba456 Wrote:  I'm trying to graph f(x) = x^0.4 * (x+3). However, it doesn't graph anything lower than x=0. Desmos graphs it correctly, but this doesn't. Any help?

It doesn't like fractional powers of negative numbers. Try this instead:

F1(X) = (5 NTHROOT X)^2 * (X+3)

Or:

F1(X) = (X^2)^0.2 * (X+3)

— Ian Abbott
Find all posts by this user
Quote this message in a reply
05-22-2019, 04:34 PM (This post was last modified: 05-22-2019 04:34 PM by DrD.)
Post: #4
RE: Why won't the prime graph correctly?
In Advanced Graphing, (using upper case variables): V1: Y=X^0.4*(X+3)

[attachment=7279]
Find all posts by this user
Quote this message in a reply
05-23-2019, 06:13 AM
Post: #5
RE: Why won't the prime graph correctly?
Hello

The "problem" is that (-2)^0.4 is a complex number, not a real as most people have been lead to expect by their math teachers.

Prime does indeed graph the graph as mathematician would expect it.

power of a non decimal number is only equivalent to a nth root when x>=0, this "equivalence" does not carry on when x<0.

If you do want to calculate/draw the nth root, use the nthroot function.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
05-23-2019, 09:14 AM
Post: #6
RE: Why won't the prime graph correctly?
Quite the contrary, teachers know very well what they are teaching, calculators are stupid and/or badly programmed Wink

[Image: funcgraph.jpg]

Best,

Aries Smile
Find all posts by this user
Quote this message in a reply
05-23-2019, 03:42 PM
Post: #7
RE: Why won't the prime graph correctly?
(05-23-2019 09:14 AM)Aries Wrote:  Quite the contrary, teachers know very well what they are teaching, calculators are stupid and/or badly programmed Wink
Best,

Aries Smile
I suppose different people have different opinions. Here are what the four calculators with me at school (I teach Physics) today say:
  • DM42: doing 1 +/- ENTER 3 1/x y^x gives the first complex cube root of -1, rather than -1.
  • WP34S: doing 1 +/- ENTER 3 1/x y^x gives DOMAIN ERROR.
  • Casio Classwiz fx-85GTX: doing (-1)^(1/3) gives -1.
  • HP Prime: (-1)^(1/3) gives an error in Home mode (only integral powers of negative numbers allowed) and a complex result in CAS mode.
I like all of these calculators and I think they behave well.

On a calculator that can handle complex numbers, the complex result is what I would expect. If a calculator tells me that \((-1)^{1/3}\) is \(-1\), I don't know what result it will give me for \((-1\pm{\bf i}\epsilon)^{1/3}\). The cut in the complex plane must be somewhere unusual.

On a calculator that handles only real numbers, I prefer an error. The problem is that when the power is a real number - for example, \(-0.4\) - a calculator that tries to give a real answer must first turn the power into a rational number, express it in its lowest terms, and then throw an error only if the denominator is even. The Casio appears to do this - \((-1)^{0.4}\) gives 1, powers of 0.401 up to 0.407 give Math Error, and a power of 0.408 gives -1. It's logical, it's consistent, but is it sensible?

I think that to put the Prime's behaviour down to being "badly programmed" is to miss the point. There is a conceptual difference between a fractional power and an integral nth root: whether to ignore this difference, or if not, how to address it, aren't trivial questions. I think the Prime gets it right by having two separate functions, each behaving as I'd expect. If I were a maths teacher teaching fractional powers at a basic level, I might prefer the behaviour of the Casio. I'm surprised to hear that the TI NSpire appears to follow the Casio - is there a complex mode that needs to be turned on, and if so, does this change the behaviour?

Nigel (UK)
Find all posts by this user
Quote this message in a reply
05-23-2019, 06:21 PM (This post was last modified: 05-23-2019 06:24 PM by Gilles.)
Post: #8
RE: Why won't the prime graph correctly?
(05-23-2019 03:42 PM)Nigel (UK) Wrote:  
(05-23-2019 09:14 AM)Aries Wrote:  Quite the contrary, teachers know very well what they are teaching, calculators are stupid and/or badly programmed Wink
Best,

Aries Smile
I suppose different people have different opinions. Here are what the four calculators with me at school (I teach Physics) today say:
  • DM42: doing 1 +/- ENTER 3 1/x y^x gives the first complex cube root of -1, rather than -1.
  • WP34S: doing 1 +/- ENTER 3 1/x y^x gives DOMAIN ERROR.
  • Casio Classwiz fx-85GTX: doing (-1)^(1/3) gives -1.
  • HP Prime: (-1)^(1/3) gives an error in Home mode (only integral powers of negative numbers allowed) and a complex result in CAS mode.
I like all of these calculators and I think they behave well.

Nigel (UK)

WolframAlpha gives the same complex result as does the HP50g, newRPL, HPPrime (in home mode,set allow complex number). There is a bug in the NSpire here
Find all posts by this user
Quote this message in a reply
05-23-2019, 06:38 PM
Post: #9
RE: Why won't the prime graph correctly?
(05-23-2019 03:42 PM)Nigel (UK) Wrote:  is there a complex mode that needs to be turned on, and if so, does this change the behaviour?

Nigel (UK)

Complex on left, complex off right:

   

-road
Find all posts by this user
Quote this message in a reply
05-23-2019, 06:59 PM (This post was last modified: 05-23-2019 07:01 PM by toml_12953.)
Post: #10
RE: Why won't the prime graph correctly?
(05-23-2019 03:42 PM)Nigel (UK) Wrote:  HP Prime: (-1)^(1/3) gives an error in Home mode (only integral powers of negative numbers allowed) and a complex result in CAS mode.

On my Prime in Home mode I get 0.500000000001+0.866025403784*i

I have "Allow complex output from real input" checked in settings.

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
05-23-2019, 07:27 PM (This post was last modified: 05-23-2019 07:33 PM by Gilles.)
Post: #11
RE: Why won't the prime graph correctly?
(05-23-2019 06:59 PM)toml_12953 Wrote:  
(05-23-2019 03:42 PM)Nigel (UK) Wrote:  HP Prime: (-1)^(1/3) gives an error in Home mode (only integral powers of negative numbers allowed) and a complex result in CAS mode.

On my Prime in Home mode I get 0.500000000001+0.866025403784*i

I have "Allow complex output from real input" checked in settings.

I think that's the correct behavior. It's old for me but my teachers always teached me that the |C set is a superset of |R (wich is a superset of |Q, which is superset of Z, wich is superset of |N). From a mathematical point of view, you can have no solution in |R and one (or more) solution in |C, but you cant have a principal solution in |R wich is different in |C : it is not consistant. It will be like to get a different result in |N and in |R: a nonsense. But i'm not mathematician and I'm interested of mathematicien point of view. Perhaps i'm wrong.

Edit : the graph of the NSPIRE (up), are inconsistant in this point of view.
Find all posts by this user
Quote this message in a reply
05-24-2019, 09:16 AM
Post: #12
RE: Why won't the prime graph correctly?
(05-23-2019 06:59 PM)toml_12953 Wrote:  
(05-23-2019 03:42 PM)Nigel (UK) Wrote:  HP Prime: (-1)^(1/3) gives an error in Home mode (only integral powers of negative numbers allowed) and a complex result in CAS mode.

On my Prime in Home mode I get 0.500000000001+0.866025403784*i

I have "Allow complex output from real input" checked in settings.
You are correct. I wanted to see what the Prime would do if complex output was disallowed, so I had "Allow complex output from real input" unticked. I should have made that clear. Thank you!

Nigel (UK)
Find all posts by this user
Quote this message in a reply
05-24-2019, 10:04 AM
Post: #13
RE: Why won't the prime graph correctly?
(05-23-2019 06:21 PM)Gilles Wrote:  WolframAlpha gives the same complex result as does the HP50g, newRPL, HPPrime (in home mode,set allow complex number). There is a bug in the NSpire here

The Nspire CX CAS and Nspire CX II CAS give the complex answer if complex is turned on in settings and -1 if complex results are turned off. In real mode, -1 could be considered correct since cubing the cube root of -1 gives the original number:

((-1)^(1/3))^3 = -1

(-1)^(1/3) = -1
Ans^3 = -1

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
05-24-2019, 10:43 AM (This post was last modified: 05-24-2019 10:44 AM by Tim Wessman.)
Post: #14
RE: Why won't the prime graph correctly?
So basically...

[Image: lknmh.jpg]

The issue with any mathematical device is when people just say "I didn't get what I thought, so therefore it is wrong" when the correct response is "Why?".

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
05-24-2019, 12:46 PM
Post: #15
RE: Why won't the prime graph correctly?
(05-24-2019 10:43 AM)Tim Wessman Wrote:  So basically...

[Image: lknmh.jpg]

The issue with any mathematical device is when people just say "I didn't get what I thought, so therefore it is wrong" when the correct response is "Why?".

But what I thought was right otherwise why would I think it? Big Grin

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
05-24-2019, 03:36 PM (This post was last modified: 05-24-2019 05:22 PM by ijabbott.)
Post: #16
RE: Why won't the prime graph correctly?
I was playing around with plotting (in the Function app) the following function, which is a variant of the original function in this thread (I added the ABS()):

F1(X)=ABS(X^0.4)*(X+3)

As expected, values for X>=0 are plotted always, but values for X<0 are only plotted when "Allow complex output from real input" is selected in the Home Settings.

EDIT - THIS BIT IS WRONG:
Then I tried to override the "Allow complex output from real input" setting in the Symbolic Setup, but changing the "Complex" setting from "System" to "Off" or "On" didn't seem to have any effect on the values plotted - it still only depended on the setting in Home Settings. Any idea why that should be the case?

After repeating the above test, the "Complex" setting in "Symbolic Setup" does have an effect, although the On/Off setting is inverted (see below). I'm not sure what I was doing wrong the first time (I have installed a connectivity kit since then).

There are some other oddities about configuring the Complex setting in the Symbolic Setup. First of all, the setting here seems to be inverted. Setting it to "On" disables complex output from real inputs in the calculator. Setting it to "Off" enables complex output from real inputs in the calculator. Secondly, setting Complex to "Off" or "On" in the Symbolic Setup hides the complex display format setting in Home Settings. You just get a string that says "See Symbolic Setup", but the complex display format is not configurable in the Symbolic Setup.

(Note: I was using the HP Prime virtual calculator version from 2018-10-16 for the above tests.)

— Ian Abbott
Find all posts by this user
Quote this message in a reply
05-24-2019, 04:06 PM
Post: #17
RE: Why won't the prime graph correctly?
(05-24-2019 03:36 PM)ijabbott Wrote:  There are some other oddities about configuring the Complex setting in the Symbolic Setup. First of all, the setting here seems to be inverted. Setting it to "On" disables complex output from real inputs in the calculator. Setting it to "Off" enables complex output from real inputs in the calculator. Secondly, setting Complex to "Off" or "On" in the Symbolic Setup hides the complex display format setting in Home Settings. You just get a string that says "See Symbolic Setup", but the complex display format is not configurable in the Symbolic Setup.

Thanks a lot! Your post gave me a headache just trying to follow the settings! Smile

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
05-24-2019, 04:44 PM (This post was last modified: 05-24-2019 05:27 PM by ijabbott.)
Post: #18
RE: Why won't the prime graph correctly?
(05-24-2019 04:06 PM)toml_12953 Wrote:  
(05-24-2019 03:36 PM)ijabbott Wrote:  There are some other oddities about configuring the Complex setting in the Symbolic Setup. First of all, the setting here seems to be inverted. Setting it to "On" disables complex output from real inputs in the calculator. Setting it to "Off" enables complex output from real inputs in the calculator. Secondly, setting Complex to "Off" or "On" in the Symbolic Setup hides the complex display format setting in Home Settings. You just get a string that says "See Symbolic Setup", but the complex display format is not configurable in the Symbolic Setup.

Thanks a lot! Your post gave me a headache just trying to follow the settings! Smile

Actually, I made a mistake in the bit before that paragraph, and have edited the post to correct it.

To illustrate: go to Symbolic Setup (Shift - Symb) and set Complex to On. Then press the Home key and try and take the square root of -1. (Fail!) Now go back to Symbolic Setup and set Complex to Off. Now try and take the square root of -1 again. (Success!)

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 




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