ANSWER[row] as synonymous of $row cmd

Jaime shared this idea 6 years ago
Declined

Idea, please GG TEAM add the ANSWER[row] command as synonymous with the $row command to make the instruction sequences in the CAS view more understandable for the students.

The following sequence of statements, show step by step the solution of a simple list of equations.


with $ cmd


  1. { y = x^2, y = 2*x + 3 } { y = x^2, y = 2*x + 3 }
  2. Substitute[Element[$1,2],Element[$1,1]] x^(2) = (2 * x) + 3
  3. $2 - (2x + 3) x^(2) - (2 * x) - 3 = 0
  4. Factor[LeftSide[$3]] ((x - 3) * (x + 1))
  5. {Element[$4,1] = 0, Element[$4,2] = 0} {x - 3 = 0, x + 1 = 0}
  6. {Element[$5,1] + 3, Element[$5,2] - 1} {x = 3, x = (-1)}
  7. Substitute[Element[$1,1],Element[$6,1]] y=9
  8. Substitute[Element[$1,2],Element[$6,1]] y=9
  9. Substitute[Element[$1,1],{$8, Element[$6,1]}] 9=9
  10. LeftSide[$9] ≟ RightSide[$9] -> true

with ANSWER CMD


  1. { y = x^2, y = 2*x + 3 } { y = x^2, y = 2*x + 3 }
  2. Substitute[Element[answer[1],2],Element[answer(1),1]] x^(2) = (2 * x) + 3
  3. answer[2] - (2x + 3) x^(2) - (2 * x) - 3 = 0
  4. Factor[LeftSide[answer[3]]] ((x - 3) * (x + 1))
  5. {Element[answer[4],1] = 0, Element[answer[4],2] = 0} {x - 3 = 0, x + 1 = 0}
  6. {Element[answer[5],1] + 3, Element[answer[5],2] - 1} {x = 3, x = (-1)}
  7. Substitute[Element[answer[1],1],Element[answer[6],1]] y=9
  8. Substitute[Element[answer[1],2],Element[answer[6],1]] y=9
  9. Substitute[Element[answer[1],1],{answer[8], Element[answer[6],1]}] 9=9
  10. LeftSide[answer[9]] ≟ RightSide[answer[9]] true


Syntax in XCAS


  1. [ y = x^2, y = 2*x + 3 ] returns [ y = x^2, y = 2*x + 3 ]
  2. subst((ans(-1)(2)),ans(-1)(1)) returns x^2=(2*x+3)
  3. ans(-1) - (2*x + 3) returns x^2-2*x-3=0
  4. factor(ans(-1)) returns (x-3)*(x+1)=0
  5. [ part(left(ans(-1)),1)=0, part(left(ans(-1)),2)=0 ] returns [x-3=0,x+1=0]
  6. ans(-1)(1)+3, ans(-1)(2)-1 ] returns [x=3,x=-1]
  7. subst(y=x^2,ans(-1)(1)) returns y=9
  8. subst(y=2*x + 3,ans(-2)(1)) returns y=9
  9. subst(y=2*x + 3,[ans(-3)(1),ans(-1)]) returns 9=9
  10. evalb(ans(-1)) returns 1 (true)

Comments (4)

photo
1

Why do you think that's clearer?

photo
1

Sorry for my bad English

Now I'm starting with GG and in my presentations in the classroom, students tell me that the $ symbol is not very natural in functional algebraic syntax

photo
1

OK, see if they get used to it soon :)

photo
1

We (Teacher, students) really do not like the $ command as a call to a position in a history stack., it's not natural notation about calculators (ti-nspire [cx cas] family , hp-prime cas, etc. [Portable device and computer software])

I'm going to create several CAS type scripts that will soon share them, but I insist that there should be a synonym for the $ command, I think that there is no need to make any big changes in the interpretation of expressions. But the idea is not to use CAS proprietary $$ [MATLAB (SYM TOOLBOX), MATHEMATICA, etc] software, to switch to free software as the GG calculator, xCAS

As an extra suggestion, accept a second parameter to compact the sentence

I propose that the ans command can accept an optional second argument, extract the x element from the previous list of objects

current


  1. { y = x^2, y = 2*x + 3 } { y = x^2, y = 2*x + 3 }
  2. Substitute[Element[$1,2],Element[$1,1]] → x^(2) = (2 * x) + 3

In a future GG update (As a Optional notation)


  1. { y = x^2, y = 2*x + 3 } { y = x^2, y = 2*x + 3 }
  2. Substitute[ answer[1,2], [answer[1,2] ] x^(2) = (2 * x) + 3

Thanks

photo
© 2023 International GeoGebra Institute