# HP Forums

Full Version: HP Prime CAS curiosity
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

If i define in CAS the function f(x)=a*x^4+b*x^3+c*x^2+d*x+e then f(0)=EXP(1).

How can i understand this?

I would define any function with:

f(x):= Something[x]
g(x):= a*x

e=EXP(1)

e is the exp function/constant. replace e with some other letter and it will work as expected. I believe it is exactly the same on the 50g if you use the lower e

TW

It depends on whether you have exact mode checked in the CAS settings or Flag 2 unchecked on the 50g. Then, it will become a symbolic e.

But, yes, better to avoid using reserved constant names like e and i.

Edited: 9 Dec 2013, 6:13 p.m.

hmm ... suggestion: Let e be a letter (or variable) and if i want the EXP-function, i could type in "EXP". But different people means different opinions about that. You can never satisfy anybody

So my suggestion: Let the user decide, how the HP Prime interpret the "e". Make a flag in the settings ...

Be brave, Tim, be user-friendly!

I disagree on this one. Certain letters are universally accepted as constants, and lower case "e" is one of them. Why not let people use the Greek letter pi as an undefined symbolic variable ? The fact is that most people use "e" in formulas to mean the exponential function, just as they use Greek pi to mean 3.14159.... It's no accident that the HP 50g 48S etc all work the same way.

Quote:
hmm ... suggestion: Let e be a letter (or variable) and if i want the EXP-function, i could type in "EXP". But different people means different opinions about that. You can never satisfy anybody

So my suggestion: Let the user decide, how the HP Prime interpret the "e". Make a flag in the settings ...

Be brave, Tim, be user-friendly!

I completely disagree. For the same reason we avoid using "pi" and "i" as variables, users should avoid "e" as a variable as well. Having "e" be a variable does NOT make it user-friendly. Most calculators and computer algebra systems complain when a user tries to use a built-in name as a variable name. The same applies to "e" and "pi" and "i" and other constants pre-defined in the calculator. The fact that there exists an EXP() function does not change the fact that the letter "e" is generally considered a constant.

If the character "e" should be allowed as a variable, then where does this stop? Why not allow "+" be used as a variable? It's just as valid as a symbol. Do you see where this is going?

How i said: Different people means different opinions. Therefore my suggestion was: a flag. Why you disagree with a flag in the settings?

Quote:
How i said: Different people means different opinions. Therefore my suggestion was: a flag. Why you disagree with a flag in the settings?

Even with a flag setting, it would be a bad idea. Every time someone runs a program that you wrote that involves 'e', they would have to make sure their settings are correct. Now, maybe you were nice and you actually preserve the user's settings before code execution, and you properly restore it after your code is done. Except if the user ever aborts your program mid-way, their settings may not necessarily be restored.

Another issue with 'e' as a variable is what happens when users use 'e' in their symbolic computations. If a value is stored into 'e', then ln(e) no longer behaves as one would expect because this expression is now ambiguous. The same goes for any named constant in mathematics (e.g. pi).

Then your convenience becomes a problem for others (and I would be willing to bet more people would prefer 'e' as a constant only).

If we were somehow artificially limited to only a few variables, I could see why it would be necessary to make a universal mathematical constant behave as a variable. However, this is clearly not the case.

Quote:
It depends on whether you have exact mode checked in the CAS settings or Flag 2 unchecked on the 50g. Then, it will become a symbolic e.

But, yes, better to avoid using reserved constant names like e and i.

Flag 2 on the HP50G only affects whether e is converted to its decimal approximation. However, e is still the natural number e and is not allowed as a variable even on the HP50G.

Yes, but by setting flag 2 on the HP 50g I can use e purely symbolically if I want to. For example, on the HP 50g, I can create a symbolic matrix [['a','b'],['c','e']], and it will display as a 2x2 matrix with symbolic elements a,b,c,e. I can then enter it on the stack and type <alpha> D E T Enter (determinant) and the result shown will be a*e-c*b.

Furthermore, once I have created this matrix with e as a symbol, it will remain so in the matrix even if I clear flag 2, such the determinant will still evaluate to a*e-c*b, even though e entered directly into the stack will now display numerically as 2.7183...

Edited: 10 Dec 2013, 1:29 p.m.