[HP-Prime CAS] Bugs and more Bugs ... « Next Oldest | Next Newest »

 ▼ CompSystems Member Posts: 213 Threads: 60 Joined: Mar 2013 07-28-2013, 11:20 AM [HP-Prime CAS] Bugs and more Bugs ... =( =[ ={ =0 Report #?? Thanks for your reply Edited: 28 July 2013, 11:28 a.m. ▼ From Hong Kong Member Posts: 125 Threads: 5 Joined: Jun 2008 07-29-2013, 11:22 AM 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. ▼ CompSystems Member Posts: 213 Threads: 60 Joined: Mar 2013 07-29-2013, 12:00 PM 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 Edited: 1 Aug 2013, 2:30 p.m. after one or more responses were posted ▼ Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 07-31-2013, 06:25 PM 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. ▼ Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 08-01-2013, 10:20 AM 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. ▼ Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 08-01-2013, 11:12 AM 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. ▼ CompSystems Member Posts: 213 Threads: 60 Joined: Mar 2013 08-01-2013, 12:03 PM 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. Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 08-01-2013, 09:23 PM 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. ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 08-01-2013, 09:38 PM 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 ▼ CompSystems Member Posts: 213 Threads: 60 Joined: Mar 2013 08-01-2013, 11:01 PM 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. Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 08-02-2013, 02:46 AM 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. Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 08-02-2013, 10:26 AM 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. ▼ Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 08-02-2013, 10:30 AM 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. Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 08-02-2013, 11:23 AM 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. ▼ Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 08-03-2013, 04:57 PM 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). Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 08-02-2013, 12:57 PM 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 CompSystems Member Posts: 213 Threads: 60 Joined: Mar 2013 08-01-2013, 10:22 AM >> 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. Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 07-29-2013, 07:22 PM 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. ▼ Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 07-29-2013, 08:37 PM 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. ▼ Peter Murphy (Livermore) Member Posts: 167 Threads: 33 Joined: Jul 2011 07-29-2013, 09:39 PM That looks plausible for French-speaking Forum members; for others, not so much. ▼ Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 07-30-2013, 04:01 AM "That looks plausible for French-speaking Forum members; for others, not so much. " I think you can post in english ;)Edited: 30 July 2013, 5:38 a.m. Manolo Sobrino Member Posts: 79 Threads: 3 Joined: Jun 2010 07-30-2013, 08:09 PM 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. ▼ Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 07-30-2013, 09:39 PM 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. ▼ Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 07-30-2013, 09:44 PM Nothing was said about never supporting RPN in the CAS. All that was said is that it would take a while to do... TW ▼ Gerson W. Barbosa Posting Freak Posts: 2,761 Threads: 100 Joined: Jul 2005 07-30-2013, 09:52 PM 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. ▼ Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 07-30-2013, 10:13 PM 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. Tim Wessman Posting Freak Posts: 1,278 Threads: 44 Joined: Jul 2007 07-30-2013, 10:10 PM 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

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

Forum Jump: