Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Maple T.A. algorithm variables for polynomial division excercise
$a1=range(-3,3);
$b1=range(-3,3);
$b2=range(-3,3);
: no japanese comments
: avoid $b2 being zero. ne=not equal
condition:ne($b2,0);
$p1=maple("x^2+($a1)*x+($b1)");
$p2=maple("x+($b2)");
$ans1=maple("expand(($p1)*($p2),x)");
$ans2=maple("quo(($p1),($p2),x)");
$ans3=maple("rem(($p1),($p2),x)");
: correct the source in the youtube video
$disp=maple("proc(A) printf(MathML[ExportPresentation](A)); end proc;");
$p1disp=maple("$disp($p1)");
$p2disp=maple("$disp($p2)");
$ans1disp=maple("$disp($ans1)");
$ans2disp=maple("$disp($ans2)");
$ans3disp=maple("$disp($ans2)");
: common $grade1 could be specified in every answer field
$grade1=maple("proc(A,R) evalb(A-R=0) end proc;");
$grade2=maple("proc(A,R) evalb(A-R=0) end proc;");
$grade3=maple("proc(A,R) evalb(A-R=0) end proc;");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.