I'm using Maple TA with first-year business students.
How do I control the display of numbers in Maple TA questions? If I define a variable to be 10000, it shows up as 100,000, which is easy to read. If I do some simple arithmetic, the result may show as 50000, which is easy for students to mistake as 500000 or 5000.
Another example is when I try rounding numbers. For instance, I want a random sample of size 8 from a normal distribution, and I'll have students do some calculations. I am going to call these numbers incomes, and I would like them to be rounded to the nearest 100. I've used the following algorithm, which works in Maple:
$a = maple("Statistics[Sample]('Normal'(30000, 10000), 8)");
$v1 = maple("evalf($a[1],3)");
...
However, in Maple TA, the result is written in scientific notation, like .315E05. I have business students and the notation is irrelevant and confusing. Can I control how numbers display, in ordinary "comma" notation?
Thanks in advance
Some help
If you want to get out that format you can try the following code
in MapleTA:
$d=maple("Statistics[Sample]('Normal'(30000, 10000), 8);
map(x->100*(round(x/100)),%);
");
$e=maple("$d[1];
");
$f=$e;
I do not know how to make Maple put in the commas,
but MapleTA does it automatically for integrers.
Does this help?
Controlling the display of numbers
That works very well, with the f's being printed with commas.
Just to make sure I understand it:
The map function applies the rounding to all the members of the array. The e and f variables are just to change the variable type. The e seems to be exactly an integer, but displays with no comma, so it is still floating point. The f is an integer, and displays with a comma. Perfect.
Why the repeated semicolons and the quote and bracket on a separate line?
Thanks for the help
Stephen
Strange things
The extra semicolons are from force of habit with Maple and the extra lines are put in by the MapleTA question editor.
Your understanding is the same as mine. The $e is a Maple variable, with its formatting. The $f is a MapleTA variable, with its formatting.