[HP-Prime CAS] Bugs and more Bugs ...



#47

[HP-Prime CAS] Bugs and more Bugs ... =( =[ ={ =0

Report #??

http://www.adictoshp.org/topic/350-emulator-review-hp-prime-virtual-calculator-on-pc/page-7

Thanks for your reply

Edited: 28 July 2013, 11:28 a.m.


#48

Only square matrices can have powers and inverses. This is common sense. I don't see any problem with their re-definition of powers and inverses for non-square matrices.

Edited: 29 July 2013, 11:25 a.m.


#49

Quote:
I don't see any problem with their re-definition of powers and inverses for non-square matrices

Poder se puede pero no se debe!

sorry google translator

It would be a poor tool in the teaching and learning of mathematics, confused, which violates the rules of vector and matrix algebra

There is also a command that executes "extra" math features dot to dot (.^) & (./) & (.*)

mat1/vector (.^ || .* || ./ ) mat2/vector // is allowed but no,

vector * vector, matrix / matrix, vector ^ n, vector / vector etc ...

PD see pseudoinverse for non-square matrices http://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_pseudoinverse

others BUGs


http://en.wikipedia.org/wiki/Linear_algebra


Edited: 1 Aug 2013, 2:30 p.m. after one or more responses were posted


#50

1/

I desagree with you about LINSOVE-SOLVE and {} or [] on the 50G

The first argmument _must be_ an array of equation and not a list.
It's important for parallel processing. We can say that [...] is one object and {..} is a collection of objects.

It's the logic of the 50G and it's very convenient, practical and powerfull

@ Here you solve a "system of equations" :

['4*x+3*y=10','5*x-2*y=1']
['x' 'y']
SOLVE

One solution only :


@ Here you solve another "system of equations" :

['4*x^2+3*y=10','5*x-2*y=1']
['x' 'y']
SOLVE

One system with 2 solutions :


@ Here you solve 2 systems of equations with the same unknows

  {['4*x+3*y=10','5*x-2*y=1']
['4*x^2+3*y=10','5*x-2*y=1']}
['x' 'y']
SOLVE

This returns a list of 1 solution for eq1 and 2 solutions for eq2
{ {[x=1 y=2]} {[x=1 y=2][x=-23/8 y=-123/16]} }

@ Here you solve à list of equation (each equation is independant)

{'4*x+3*y=10','5*x-2*y=1'}
{'x' 'y'}
SOLVE

This returns 2 independant solutions

2/

about A.X=B

I don't understand why you say that the "error" of the TI for B/A is a good thing and that the 50G does bad.

X=A^(-1) * B

B/A is a shortcut for A^(-1) * B (read the doc, since the 48SX. It'a far more easy that to search 'simult' or equivalent).

B [10 1]
- = ------ -> [1 2]
A [[4 3]
[5 -2]]
It's very convenient in real life. If you don't like this you can inverse the matrix and multiply

[10 1] is a vector and can be used in most case as [[10][1]]
(there is a flag if you prefer vertical display for vectors but it's less efficiant on the screen)

Why do you put ->V2 ->V3 in red ? These commands allows to create 2D and 3D vectors from reals. They are very usefull

5 6 ->V2 gives [5. 6.] or [7.81 <\ 50.3] with polar presentation in degree ( wich is interesting in physics)

The TI display { 1 2 } is very ambigous for me (for a 50G user) because I understand this as : There are 2 solutions 1 and 2, but in fact there is only ONE solution {[1 2]}
For the same reason I disagree totaly for your proposition of {x=1, y=2} for the Prime. It's {[x=1 y=2]} or {[1 2]} or [1 2] but I prefer always a list (and {} if no solution) because it's more coherent that a command always return the same type of object and it's more efficiant in programmation if you need to use the result. It's not ugly at all, it's logic

The TI returns 'x=1 and y=2' I wonder how you decrypt this in a program in wich you have to solve such things


Edited: 1 Aug 2013, 6:04 a.m.


#51

Quote:

2/

about A.X=B

I don't understand why you say that the "error" of the TI for B/A is a good thing and that the 50G does bad.
[pre]
X=A^(-1) * B

B/A is a shortcut for A^(-1) * B (read the doc, since the 48SX. It'a far more easy that to search 'simult' or equivalent).

B [10 1]
- = ------ -> [1 2]
A [[4 3]
[5 -2]]
It's very convenient in real life. If you don't like this you can inverse the matrix and multiply


Emphasis mine -- because that is the ONLY way we "divide" matrices. So let's call it what it is. From a mathematical point of view, there is NO such thing as matrix division. As I am sure you know, we do not use "/" or any "division" symbol for matrices because unlike non-zero real numbers, not all matrices have a multiplicative inverse. The older HP48 series may have allowed division as a shortcut, but to display it like division suggests that division is a valid binary operation over matrices -- this is just wrong.

I do agree with the other parts of your post regarding the display of solutions for systems of equations.


#52

I understand but with this logic

- "A"+"B" -> "AB" bug . must be fordidden

- RPN 2 2 + -> bug . must be forbidden

- And what about { 1 2 3 } 4 * in RPL ?

Excerpt of the user guide :

"An array B divided by a matrix A solves the system of equations AX=B for X; that is, X = A^–1 B.
This operation uses 15-digit internal precision, providing a more precise result than the calculation INV(A)*B. The matrix must be square, and must have the same number of columns as the array has rows (or elements, if the array is a vector)."

I like the idea to use only a key for doing this.

Edited: 1 Aug 2013, 11:21 a.m.


#53

Perdon bad english

- "A"+"B" -> "AB" bug . must be fordidden

No is Error, there is no logic in chains (mathematics) that I know

- And what about { 1 2 3 } 4 * in RPL ? // valid

Parallel objects Operation // valid

if V1 = [ 1, 2, 3 ] // vector

then V1^4 // not valid for the algebra of vectors, in physics also has no logic

if L1 = { "&*^" , [ 1, 2 3 ] }

then V1^L1 // " Error: incompatible data types" so simple and formal

I (or the majority of teachers in the world) do not share the philosophy of xcas (HP-Prime) to apply to all data parallel operation

Yo (ni la mayoría de docentes del mundo) no comparto la filosofia, del xCAS (HP-Prime) en aplicar a todos los datos operación paralela

[ 1, 2, 3 ] ^ 4 /=/ [ 1^4, 2 ^4, 3^4 ] // invalid

{ 1, 2, 3 } ^ 4 == { 1^4, 2 ^4, 3^4 } // valid

one thing is a vector, a matrix, and another data list here and in Timbuktu

Edited: 1 Aug 2013, 12:29 p.m.

#54

Quote:
I understand but with this logic

- "A"+"B" -> "AB" bug . must be fordidden

- RPN 2 2 + -> bug . must be forbidden

- And what about { 1 2 3 } 4 * in RPL ?

Excerpt of the user guide :

"An array B divided by a matrix A solves the system of equations AX=B for X; that is, X = A^–1 B.
This operation uses 15-digit internal precision, providing a more precise result than the calculation INV(A)*B. The matrix must be square, and must have the same number of columns as the array has rows (or elements, if the array is a vector)."

I like the idea to use only a key for doing this.


There is nothing wrong with "A" + "B" producing "AB" because strings are not mathematical objects. They are abstract objects most relevant in computer programming, not mathematical constructs.

2 2 + (in RPN) is not a bug because it the assumption is that we are using RPN. On the other hand, if we are using algebraic input, then yes, 2 2 + SHOULD produce an error.

{ 1 2 4 } * 4 in RPL should also work as expected and produce { 4 8 16 }, because the assumption is that we are working with RPL. However, even outside of the notion of RPL, the majority of folks who understand basic mathematics and programming will naturally conclude that the result should be { 4 8 16 }. On the other hand, the ambiguous case would be { 1 2 4 } + 4 -- should this be { 5 6 8 } or should the answer be { 1 2 4 4 } ?

Again, none of your examples shows a mathematical (a matrix) object being ambiguously used (as a vector of vectors) in a non-conventional way. The real question that needs to be raised is:

What happens when I want to take a square matrix and treat it like a vector of vectors, as the author interprets it, and then use inversion in the same manner of non-square matrices? Do you see the issue, now?

Edited: 1 Aug 2013, 9:29 p.m.


#55

Quote:
There is nothing wrong with "A" + "B" producing "AB" because strings are not mathematical objects.

Except that + is not commutative with strings: "AB" is not the same as "BA". So it might be not so clever to overload this operation. The same could be said about using + to add an element to a list:

{ 1 2 3 } 4 *  ->  { 4 8 12 }
But:
{ 1 2 3 } 4 +  ->  { 1 2 3 4 }
Never understood this in the HP-48GX.

Cheers

Thomas


#56

HP48/49/50

{ 1 2 3 } 4 + -> { 1 2 3 4 } // OK // [+] == Append or augment ( Bad Logic with operator + )

{ 1 2 3 } 4 ADD -> { 5, 6, 7 } // OK // [ADD] == Parallel Object Operation

HP-Prime CAS

{ 1 2 3 } + 4 -> { 5, 6, 7 } // Ok and best that logic of HP48/49/50

// New BUG
[ 1 2 3 ] + 4 -> [ 1, 2, 7 ] // 2 BUG: first wrong doing parallel processing, second no sense in physics add a scalar to a vector

[ 1 2 3 ] .+ 4 -> [ 5, 6, 7 ] // OK

// Other

[ 1 2 3 ] - 4 -> [ 1, 2, -1 ] // ??

[ 1 2 3 ] .- 4 -> [ 1, 2, -1 ] // ??

Edited: 2 Aug 2013, 7:10 a.m.

#57

Quote:
{ 1 2 3 } 4 * -> { 4 8 12 }

But:

{ 1 2 3 } 4 + -> { 1 2 3 4 }

Never understood this in the HP-48GX.


That's what I say in the previous post.

ADD and + were switched in a bad way

{ 1 2 3 } 4 ADD -> {5 6 7}

Must be exactly the contrary. Just switch ADD and + behavior and all becomes logic. Not sure but I think that this come frome the 48S legacy in wich paralel list programming is very 'light' (non existant ?) and after it can't be changed for compatibility.


Edited: 2 Aug 2013, 8:28 p.m.

#58

Quote:
Except that + is not commutative with strings: "AB" is not the same as "BA". So it might be not so clever to overload this operation. The same could be said about using + to add an element to a list:
{ 1 2 3 } 4 *  ->  { 4 8 12 }
But:
{ 1 2 3 } 4 +  ->  { 1 2 3 4 }
Never understood this in the HP-48GX.

Cheers

Thomas


I see your point. However, we seem to be focusing on the programming aspects of functions and operations. The original issue was on the _mathematical_ issues of overloading an operation (inverse) in such a way as to cause _mathematical_ ambiguity.

As for as programming is concerned, whether strings are added non-commutatively or not, or syntax such as using + vs ADD... those are all going to be different based on the language used. There is no universal programming language. So while + and ADD may behave one way (say in RPL), they may behave differently in some other hypothetical architecture / language. The same does not apply to mathematics.

When you start treating [ [ 1 2 3 ] [ 4 5 6 ] ] differently from [ [ 1 2 ] [ 3 4 ] ] (the first a vector of vectors and the latter a matrix), you get inconsistencies. How does the user then explicitly force the square matrix to be treated as a vector of vectors so that its "inverse" is [ [ 1 1/2 ] [ 1/3 1/4 ] ] ? Moreover, should that even be an option? To me, the answer is no. Inverses on matrices should only take square matrices as input, and error out otherwise. No one seems to be addressing these basic questions.


#59

I think, for me, the solution could be as simple as a flag that toggles whether or not mathematical operations should error out or overload in the event that the input is not the expected type/size/etc.

#60

Quote:

When you start treating [ [ 1 2 3 ] [ 4 5 6 ] ] differently from [ [ 1 2 ] [ 3 4 ] ] (the first a vector of vectors and the latter a matrix), you get inconsistencies. How does the user then explicitly force the square matrix to be treated as a vector of vectors so that its "inverse" is [ [ 1 1/2 ] [ 1/3 1/4 ] ] ?


There is no problem both on 50G and Prime :

INVERT A SQUARE MATRIX :
On 50G (RPL)

INV (wich is the 1/x key) or -1 ^ inverse a square matrix

Same thing with the Prime (in algebraic syntax)

INVERT EACH ELEMENT OF a MATRIX (square or not)

On 50G

[ [ 1 2 ] [ 3 4 ] ] << INV >> MAP

On Prime

apply( x->1/x,[ [ 1 2 ] [ 3 4 ] ])

or (does not work with pre-release)

[ [ 1 2 ] [ 3 4 ] ] .^(-1)

The difference between 50/Prime is :

1/The Prime allows 'vector of vectors' (that could not be a matrix) mixing dimensions
2/ The Prime allows special rules for these objects

Edited: 2 Aug 2013, 11:26 a.m.


#61

The concern is not whether the HP Prime (or 50G) has the ability to invert (reciprocal) the elements of a square matrix.

The point was that you have to rely on a completely different input syntax, or even use a totally different command. This is what is inconsistent. Look at the original screenshot -- it shows a non-square matrix with an exponent of -1, and the result is a matrix whose elements are reciprocals of elements of the original matrix. This _suggests_ that one _should_ be able to do the SAME with a square matrix using the SAME syntax (power of -1). However, I would bet that one cannot do this using a square matrix.

Look at it from another point of view. Suppose someone is working with only vectors of vectors. They use ^-1 to get reciprocals of each element. Everything works so far, until suddenly they try a square matrix ...

Calculators should NOT have ambiguous results when inputs look essentially the same (matrix vs vector of vectors).

#62

Completely agree with you. But I think we should in general be cautious when overloading functions. These are only two examples to illustrate my point. The whole calculator appears to be rather inconsistent. For instance I still don't get what CONCAT does.

But then probably I was never much interested in this model.

Quote:
Turn the calculator into a customizable testing tool with exam mode configuration that makes only pre-approved functions available.

As a student, I would never buy a calculator that can be crippled by my teacher at his will. This feature shows me that this calculator is not intended to be sold to students but to teachers. But of course the students are still forced to pay.

Cheers

Thomas

#63

>> The TI returns 'x=1 and y=2' I wonder how you decrypt this in a program in wich you have to solve such things

expresion to list command

TIcalcs: [TI89/NSPIRE] expr>List( x=1 AND y=2 , { x, y } ) [Enter] return [ 1, 2 ]

expr>List( x=1 OR x=-1 , x ) [Enter] return { -1, 1 }

/! \ If a list has matrix dimension, the calculators [TI89/NSPIRE...] consider it a matrix

example

[TI89/NSPIRE]
{{1,2},{3,4}} == [[1,2],[3,4]]

[TI89/NSPIRE]
{{1,2},{3,4},5} // Invalid list =(

HP Calculators, accept multiple objects within a list =) =], the TIcalcs not =(

but a trick to store several object in a list with TI-Calcs, assigning an identifier to each object

{ M1 = [[1,2],[3,4]], S1 = "x^4=1", G1=G010101... } // valid

{[[1,2],[3,4]], "x^4=1", G010101... }// invalid =(

>> Why do you put [->V2] [->V3] in red?

Perdon [CYLIN],[SPHERE] menus In the HP-Prime as I can see a vector in different coordinate?

Ans: In HP50G does not work CYLIN ans SPHERE.


Edited: 1 Aug 2013, 3:39 p.m.

#64

Quote:
Only square matrices can have powers and inverses. This is common sense. I don't see any problem with their re-definition of powers and inverses for non-square matrices.

I hope the software engineers disagree with last sentence of this comment and fix the issue as a bug. The first two sentences are precisely why any attempt to invert a non-square matrix should be an error.


#65

For a matrix, yes, I 100% agree. That is not a matrix though - it is a vector of vectors.

I'd be more then happy if someone could convince the author it should be changed. Feel free to make the attempt. Here's the forum to talk to him about it. http://xcas.e.ujf-grenoble.fr/XCAS/

TW


Edited: 29 July 2013, 8:42 p.m.


#66

That looks plausible for French-speaking Forum members; for others, not so much.


#67

"That looks plausible for French-speaking Forum members; for others, not so much. "

I think you can post in english ;)


http://xcas.e.ujf-grenoble.fr/XCAS/viewforum.php?f=19&sid=7416d4f784a2ce6c7d05ea4479c89601


Edited: 30 July 2013, 5:38 a.m.

#68

That's my real problem with this calculator. An integral part of the product is not in HP's hands, and HP denies responsibility about it... This is just amazing. What's the point in building a device around some code you have no word in? The whole approach is wrong. Say I've spent 100€+ on this calculator and then there is a bug or something should work better. I expect that this behaviour is eventually fixed by HP. But no, I have to hope that a single independent developer really feels like to fix it in his spare time.




I'm sorry Tim, this can't be your fault, yet it is amateurish. You know what TI did with the 92, they rewrote Stoutmeyer's algorithms in C for the 68000 (apparently keeping them in lisp was not an option) and some time later they not only bought Derive, but Soft Warehouse (and then they killed it, shame on them). I can run Giac/Xcas for free, why should I buy yet another calculator? At least your company could fork the code and tailor it to your needs, but shipping a console with no real support for a CAS? I have to pass on this one.




Some people just love HP no matter what, too much love is blindness.


#69

I completely lost any interest in the Prime when I discovered its CAS doesn't support RPN entry and HP won't do anything about that.


#70

Nothing was said about never supporting RPN in the CAS. All that was said is that it would take a while to do...

TW


#71

Quote:
All that was said is that it would take a while to do...

So much the better! I thought I heard that was going to be difficult since XCAS had stopped supporting it. To me, RPN is the most convenient way to enter complicated algebraic expressions.

Gerson.


#72

Quote:
So much the better! I thought I heard that was going to be difficult since XCAS had stopped supporting it.

Well, yes. If it hasn't been supported or running there for many years, getting it back running and working will take time and is much more difficult then if it already works! :-)

Timing is often a very difficult thing.

TW


Edited: 30 July 2013, 10:32 p.m.

#73

You are perfectly correct in that one of the downsides of not building everything from scratch is that you sometimes do not get exactly what is wanted because it doesn't exist. You can then take the time to make it yourself and possibly never do it because of <time/cost/capability/insert_factor_here>, or license/buy what is available (as you have rightly pointed out) and move from there.

Denied responsibility? Eh? All that has happened is that a pre-release, unfinished software version of the calculator was leaked by a Chinese company and everyone has been commenting on it. I comment that some things will not be resolved by first release, and that if anyone would like to talk directly with the author of that logic and code it can be done on the author's site.

Quote:
Say I've spent 100€+ on this calculator and then there is a bug or something should work better. I expect that this behaviour is eventually fixed by HP. But no, I have to hope that a single independent developer really feels like to fix it in his spare time.

This seems like quite a large jump in logic to me personally. There is a leaked version of an unreleased product, yet it is already certain that HP will never resolve issues with that product and it has already been abandoned? :-?




Early 2012: First versions of the 39gII use xcas as as the primary interface and it handles parsing, evaluation, printing, and so on. However, since xcas is primarily a symbolic only system, numerical calculations have quite a few issues that essentially all pure symbolic systems also exhibit. Quite annoying...

Fall 2012: Second major firmware version of the 39gII. Resolves the numerical annoyances by introducing a completely HP designed and build numerical evaluator, parser and printer. Only symbolic operations and a small selection of others are done through xcas. Symbolic capability is not user accessible. Quite annoying...

Fall 2013: In Prime, the internal numerical parser is improved upon and takes up even more capability. It is now unquestionably more powerful then anything on an HP calculator before in the majority of areas while still trailing in a small few. Symbolic capability given to end users by exposing a large, but not complete selection of symbolic calculation commands available in xcas. In many ways, the symbolic capability is already far beyond the 50g and in many cases more powerful then anything ever available in a traditional calculator. Yet there are definitely some problem areas mostly centered around a universal, clean integration of system conventions and objects. Quite annoying....

TW


Edited: 31 July 2013, 10:40 p.m. after one or more responses were posted


#74

Quote:
All that has happened is that a pre-release, unfinished software version of the calculator was leaked by a Chinese company and everyone has been commenting on it. I comment that some things will not be resolved by first release, and that if anyone would like to talk directly with the author of that logic and code it can be done on the author's site.



Well, that makes sense. But just referring to the Giac/Xcas forum after acknowledging any CAS bug is puzzling... more so after getting the general idea of how the system works. I was (maybe some were) expecting something like "We are working closely WITH B. Parisse on that" instead of the "go tell Parisse about it" vibe.




Maybe it's going to be great when it's finished, I'm sure you have the skill to get it right despite all the constraints. However, "ship early, ship often" was never really meant for hardware IMHO. I don't know, maybe you have to bury Giac/Xcas under a driver program that fixes syntax, allowed types and basically handles it... or else rewrite large sections of it :-(

#75

All this thread is a little sureal...

I can summarize all the thread in 2 lines

1/ no automatic simplifcation at this time
2/ If you use matrix and vectors as defined in math, the result is what is expected. But you can mix matrix, vectors, list (add, multiply etc.) with no errors at this time and the whole thing operates like lists with his proper logic (but not with a math logic where you can't add a matrix and a vector for example)

#76

Hi Tim,

Do you know if the 39gII will be available in the U.S.? This fall?

When you say the 39gII's symbolic capability is far beyond the 50g, what might be the most notable examples? Where is it the lesser machine symbolically?

Is the 1st edition of Prime ahead of the 50g or 39gII symbolically?

Graphingwise, Prime looks to be quite amazing although I understand that the 39gII is outstanding as well.

Quite interested in both machines, and hope both will be available soon!


#77

Hello,

Definitely made a minor mistake there in that last bit. I've added the phrase "In Prime" to clarify. The whole last paragraph there was in reference to Prime.

There is no symbolic capability exposed to the end user in the 39gII.

TW

Edited: 31 July 2013, 10:43 p.m.

#78

Quote:
Say I've spent 100€+ on this calculator and then there is a bug or something should work better. I expect that this behaviour is eventually fixed by HP.

"Expect" you say? Consumer law doesn't work that way: either you return it promptly to the shop for a refund or you keep it.

#79

There is something called warranty, there's another thing called support, and then there is the brand, so if the company wants to kill itself I will help them by not buying from them again. Hence, I expect.

#80

Quote:
For a matrix, yes, I 100% agree. That is not a matrix though - it is a vector of vectors.

I'd be more then happy if someone could convince the author it should be changed. Feel free to make the attempt. Here's the forum to talk to him about it. http://xcas.e.ujf-grenoble.fr/XCAS/

TW


Calling a non-square matrix a "vector of vectors" does not appropriately address the issue. The issue is that (going off of the screenshot), there is nothing that distinguishes a matrix from a "vector of vectors" -- and mathematically speaking, there should not be any difference. They are mathematically the same. If you want to start distinguishing "vector of vectors" as something different from a matrix, then require the user to use something like: { [ 1 2 ] [ 3 4 ] }. This would be more appropriate so that inverting this list produces the result seen in the screenshot (and the outer delimeter should also use { } in the result).

Having only glanced at the XCAS web page, it appears the project is open source (GPL3). Why can we not just change the behavior as needed?

#81

Quote:
For a matrix, yes, I 100% agree. That is not a matrix though - it is a vector of vectors.

I'd be more then happy if someone could convince the author it should be changed. Feel free to make the attempt. Here's the forum to talk to him about it. http://xcas.e.ujf-grenoble.fr/XCAS/

TW


From a previous post of mine:

What happens when I want to take a square matrix and treat it like a vector of vectors, as the author interprets it, and then use inversion in the same manner of non-square matrices? I don't have XCAS installed (don't find it interesting enough).


#82

Quote:
What happens when I want to take a square matrix and treat it like a vector of vectors, as the author interprets it, and then use inversion in the same manner of non-square matrices? I don't have XCAS installed (don't find it interesting enough).

Not sure to understand your question but, for all commands about matrix :

- If it is a square matrix, it works like it has to work with math rules

- If it is not a square matrix, it works like a 'vector of vector' with special rules ... A 'vector of vector' could be something 'exotic' like : [[1 2 3] 3 [1 2] 4] wich is (if i understand well !) a vector of 4 vectors of 3D, 1D 2D 1D dimensions.

- If you want to treat a square matrix like a 'vector of vector' there is two ways

1/ Use Apply (same that MAP in 50G)

apply(x->x^2,[[1,2],[3,4]])

x->x^2 could be a function and there is no limitations here.


2/ For simple operations, Use the .* ./ etc syntax (this does'nt work with the pre-release)

[[1,2][3,4]] .^2

The Prime does nothing else it has to do with square matrix, but it uses in this pre-release some "non standard" extension with 'vectors of vectors' (for example the Prime ddcide to apply a .* operator if * is not allowed with the object)

The question is if these extensions have a sense or not

Edited: 2 Aug 2013, 11:01 a.m.


#83

>> - If it is not a square matrix, it works like a 'vector of vector' with special rules ... A 'vector of vector' could be something 'exotic' like : [[1 2 3] 3 [1 2] 4] wich is (if i understand well !) a vector of 4 vectors of 3D, 1D 2D 1D dimensions.

but much better, it would define a new data type, special matrices and vectors
so let the matrices and vectors well defined and ready the problem

« [1 2 3] 3 [1 2] 4 » // valid a new data type

« == CHAR #171

» == CHAR #187

The CAS for the student should be transparent, unambiguous, the student would have to think this is a matrix y no a vector of vectors or n dimensional matrix or pseudo-matrix or pseudo-vector or

>> The question is if these extensions (.*) (./) (.+) (.-) (.^) have a sense or not other object

If they have sense, not to violate the linear algebra

(.*) (./) (.+) (.-) (.^) consider dots commands as functions no operators =) like matLab and TI-derive/TI89/Nspire

(.*) == Hadamard function of matrix

(*) no dotProduct

(*) no crossProduct

[HP-Prime CAS++]

[ 1 2 3 ] .+ 4 -> [ 5, 6, 7 ] // OK

[ 1 2 3 ] + 4 -> "Error data type" // OK

[ 1 2 3 ] .- 4 -> [ -3, -2, -1 ] // OK

[ 1 2 3 ] - 4 -> "Error data type" // OK

[ 1 2 3 ] .^ 4 -> [ 1^4, 2^4, 3^4 ] // OK

[ 1 2 3 ] ^ 4 -> "Error data type" // OK

M1 :=

[[ 3, 2, 4 ],

[ 2, 0, 2 ]] // OK

M1^3 -> "Error data type" // OK

M2 :=

[[ 3, 2, 4 ],

[ 2, 0, 2 ],

[4, 2, 3]] // OK

M2 ^ 2 ->

[[ 29, 14, 28 ],

[ 14, 8, 14 ]

[ 28, 14, 29]] // OK

L1 := {

3+4*i, // Dom_Complex

3*x+2*y+4=0, // Dom_Symbolic

"3*x+2*y+4=0" , // Dom_String

"x: =", // Dom_String

[[ 3, 2, 4 ], [ 2, 0, 2 ]], // Dom_matrix =) not List

2, // Dom_Int

2,7182, // Dom_Float

[ 1, 2 ], // Dom_Vector, not list

{ A, Z0, L0, M0, G0 } // Dom_List With A = #, B = complex#, L0 =List, M0 = Matrix, G0 = Graphic

}

L1 ^ 3 -> "Error data type" // ...

L1(1) ^ 3 == (3+4*i) ^ 3 // valid

L1(2) ^ 3 == (3*x+2*y+4=0) ^ 3 // valid

L1(3) ^ 3 == "3*x+2*y+4=0" ^ 3 // invalid

L1(4) ^ 3 == "x: =" ^ 3 // invalid

L1(5) ^ 3 == [[ 3, 2, 4 ], [ 2, 0, 2 ]]^3 // invalid

L1(6) ^ 3 == 2^3 // valid

L1(7) ^ 3 == 2,7182^3 // valid

>>

[HP-Prime CAS] current

L1^3 [Enter] return { BUG LIST } =(

// [Request] please do not make sense to apply an operator (*,^,/,+,-) and others commands to all types of objects in the calculator

Other BUG

[+/-]"HPPrime" [Enter] return "-HPPrime" ???

"HPprimeCAS"-"-" return "HPprimeCAS--" ???

"HPprimeCAS" + "++ > TInspireCAS" return "HPprimeCAS++ > TInspireCAS" // OK HP CAS > TI CAS

EXPR("X =" + 3 ) [Enter] return X=3 // OK

EXPR("X =" ^ 3 ) [Enter] "Error data type" // OK

>> 2/ Use the .* ./ etc syntax (this does'nt work with the pre-release)

[[1,2][3,4]] .^ 2

if work with the pre-release firts place [.], then from the character 'window" [Shift]+[Var] insert "^" character and run =)

[Request] [Shift-Lock]+[x^y] = '^' no template x^y

[Shift-Lock]+[+/-]= '|' evaluate

Edited: 2 Aug 2013, 9:49 p.m.

#84

Quote:
If it is not a square matrix, it works like a 'vector of vector' with special rules ... A 'vector of vector' could be something 'exotic' like : [[1 2 3] 3 [1 2] 4] wich is (if i understand well !) a vector of 4 vectors of 3D, 1D 2D 1D dimensions.

A matrix _IS_ a vector of vectors. And a vector of vectors _IS_ a matrix. Whether the matrix (or vector of vectors) is square is irrelevant. They should be treated one and the same. The only time they could possibly be different is if by vector of vectors we actually mean a list of vectors. In which case, { } should be used as the outer delimiters, and not [ ].

And [ [ 1 2 3 ] 3 [ 1 3 ] 4 ] is NOT a proper vector of vectors. By your reasoning, [ "A" 1 ] should also be a valid vector of vectors since you are using "vector" in an abstract sense here (in the same way a textbook uses a bold x to denote a vector). Of course, the "inverse" of [ "A" 1 ] would be what? [ 1/"A" 1 ]? Nonsense!

As a mathematical operation, an inverse should only be applicable to properly formed arguments. Next you'll start to suggest that it's OK to return anything we want when taking the reciprocal or "inverse" of the number 0 since it would just be an "exotic" case of a real number.

As for my original question: what if I wanted the calculator to return [ [ 1/a 1/b ] [ 1/c 1/d ] ] when given the square matrix [ [ a b ] [ c d ] ]? Your proposed solution now introduces special cases of "inverses" for vectors of vectors -- requiring a different method of input which should have been uniform for all cases of vectors of vectors.

Conclusion: don't mix mathematical convention and ease of programming (by overloading operators) in such a way that introduces ambiguity. Either have a flag that users can enable if they wish to have that "feature" but leave it disabled by default so as to not cause any confusion. A calculator should not just facilitate computations, but if intended as a learning tool, it should provide useful information when we make mistakes (such as trying to take an inverse of a non-square matrix).

Edited: 2 Aug 2013, 3:12 p.m.


#85

Quote:
And [ [ 1 2 3 ] 3 [ 1 3 ] 4 ] is NOT a proper vector of vectors.

A vector is formally defined as an element of a vector space.

Consider the following base:

e1 = [ [ 1 0 0 ] 0 [ 0 0 ] 0 ]
e2 = [ [ 0 1 0 ] 0 [ 0 0 ] 0 ]
e3 = [ [ 0 0 1 ] 0 [ 0 0 ] 0 ]
e4 = [ [ 0 0 0 ] 1 [ 0 0 ] 0 ]
e5 = [ [ 0 0 0 ] 0 [ 1 0 ] 0 ]
e6 = [ [ 0 0 0 ] 0 [ 0 1 ] 0 ]
e7 = [ [ 0 0 0 ] 0 [ 0 0 ] 1 ]

So: [ [ 1 2 3 ] 3 [ 1 3 ] 4 ] =
e1 +
2e2 +
3e3 +
3e4 +
e5 +
3e6 +
4e7.

Thus I don't see a problem with that. Of course this vector space is isomorphic to R7. But you may ask yourself: What exactly do we gain by adding these additional brackets?

Quote:
By your reasoning, [ "A" 1 ] should also be a valid vector of vectors

Depends on the field F but it will possibly be difficult to define scalar multiplication: What's k"A" if k is not an integer? And even if we assume for instance F = Z5. Does it make sense to say: 4"AAA" = "AA"?

Kind regards

Thomas


Edited: 2 Aug 2013, 5:58 p.m.


#86

Here, my math level is overflowed :)


#87

Maybe I just didn't explain it well enough. Which part is confusing?

#88

Yes, you are correct that it is a vector of vectors in the abstract (as in abstract algebra) sense. I should have clarified that "vector" here was intended to mean the HP Prime or HP 50G syntax of vector (i.e. that which is enclosed by [ ]).

Using { [ 1 2 3 ] 3 [ 1 3 ] 4 } is much better in representing a vector of vectors (in the abstract sense). Based on prior HP models, this list syntax is a better means of representing an abstract collection of vectors (mathematical definition of vectors, not the HP interpretation generally surrounded by []'s) because a list can contain any type of object. If you stick with the HP-syntax for vectors, then each vector within the containing vector should be enclosed within []s. That is,

[ [ 1 2 3 ] 3 [ 1 3 ] 4 ]

should then be written as

[ [ 1 2 3 ] [3] [ 1 3 ] [4] ]

(and possibly even padding in 0's so that the nested vectors have the same length). Back on the HP48 series, one could type:

[ [ 1 2 3 ] 4 5 6 7 8

and press ENTER and the result would be a proper matrix. But it would not look like our example... try it for yourself, and see.

#89

Quote:
As for my original question: what if I wanted the calculator to return [ [ 1/a 1/b ] [ 1/c 1/d ] ] when given the square matrix [ [ a b ] [ c d ] ]?

Edited: 2 Aug 2013, 7:02 p.m.


#90

But [ [ a b ] ]-1 magically falls back to [ [ a b ] ].^(-1). That should lead to an error. Because if you really want to calculate [ [ 1/a 1/b ] ] you can use .^(1).

Cheers

Thomas


#91

"But [ [ a b ] ]-1 magically falls back to [ [ a b ] ].^(-1). That should lead to an error. Because if you really want to calculate [ [ 1/a 1/b ] ] you can use .^(1).3

I totally agree... I would prefer the behavior you explain

#92

Semantics aside, a vector of vectors is a construct more suited to the computer science realm than to Math. IMHO introducing such ambiguous terms and object types is detrimental to the main goal of a device like the Prime. Let alone the confusion and flat down errors it'll cause amongst poorly-informed audiences, it'll also slide intermediate errors unnoticed to everyone.


Possibly Related Threads...
Thread Author Replies Views Last Post
  HP Prime: CAS taylor Alberto Candel 5 1,022 12-13-2013, 09:45 PM
Last Post: Alberto Candel
  HP Prime CAS curiosity bluesun08 11 1,591 12-10-2013, 01:03 PM
Last Post: Han
  [HP-Prime CAS] "Warning, ^ (Command) Is ambiguous on non square matrices"?? CompSystems 1 721 12-07-2013, 07:15 PM
Last Post: CompSystems
  HP Prime: complex numbers in CAS. Alberto Candel 1 595 12-06-2013, 02:36 PM
Last Post: parisse
  HP Prime: Proper Use of Home View and CAS View James Williams 9 1,416 12-05-2013, 02:44 PM
Last Post: James Williams
  [HP Prime] plotfunc() bug in CAS Chris Pem10 2 724 12-04-2013, 02:46 PM
Last Post: Chris Pem10
  HP Prime: Home/CAS? Alasdair McAndrew 11 1,374 11-26-2013, 02:48 PM
Last Post: Alberto Candel
  HP Prime numerical precision in CAS and HOME Javier Goizueta 5 810 11-16-2013, 03:51 AM
Last Post: Paul Dale
  Digging for bugs Stefan Dröge (Germany) 2 529 11-13-2013, 04:39 PM
Last Post: Stefan Dröge (Germany)
  Need CAS help Michael de Estrada 6 892 11-13-2013, 01:29 AM
Last Post: cyrille de Brébisson

Forum Jump: