What are the rules of elementar algebra James Davenport & Chris Sangwin Universities of Bath & Birmingham 7 Jul 2010
Setting A relativel traditional mathematics course, at, sa first-ear undergraduate level. But Computer-Aided Assessment is in use. One such eample is WeBWorK, another is MapleTA. Harness the power of technolog to improve teaching and learning [AMS Notices, June 2009].
Web-based Assessment and Testing Sstems Homework software has the potential to handle the grading of homework at a low cost. While this software has the limitation of requiring a concise answer an algebraic epression or a multiple-choice response it also has an important advantage over hand grading. Namel, if a student s answer to a problem is wrong, the student learns of the mistake immediatel and can be allowed to tr the problem or a similar problem repeatedl until the right answer is obtained. [AMS]
Automaticall generated problems Means automaticall generated answers and marking schemes. Parsing the student s answer (non-trivial see net slide) Is the student s answer mathematicall correct? Is the student s answer pedagogicall correct? So what mark does it get (assuming we are doing more than true/false marking)? Marking other than true/false was not discussed b the AMS, but seems important to us.
Tpical computer aided assessment Figure: STACK sstem [?]
Phase 1: Addition and Multiplication onl This is (close to) AC-rewriting. We can distinguish levels: 1. Tetual identit. Here + and + are different (space). Similarl +10 and +010 are different (leading zero). 2. Equalit after leical analsis. Above eamples are the same, but not +*z versus +(*z). 3. Equalit as binar parse trees. This would consider +*z and +(*z) as the same. However, this interpretation would distinguish +(+z) from (+)+z, being respectivel the trees + + + and + z z Being based on binar parse trees, it requires an operator precedence rule (is + left-associative or right-associative) to decide which of these becomes the representation of ++z..
Phase 1: Addition and Multiplication (continued) 1. Tetual identit. 2. Equalit after leical analsis. 3. Equalit as binar parse trees. However, this interpretation would distinguish +(+z) from (+)+z. 4. We can avoid this if we allow n-ar trees, parsing ++z as + z, (1) but this is now a third tree, different from the two above. 5. Solved if we flatten the associative operators + and *, which would transform both trees into the tree in (1). 6. But the rules of elementar algebra include the facts that + and are commutative, as well as associative. So compare the children of a + (or *) node as (multi)sets, rather than as lists, so now the tree in (1) has the same children, admittedl in a different order, as the trees for +(z+) etc.
Addition and Multiplication (further) Beond this we are in the realm of computer algebra, rather than sntactic manipulation. 7. We remove identit elements: i.e. we remove 0 from the arguments of + and 1 from the arguments of. Where necessar, we flatten to remove operations which end up with a single argument. For eample + 0 +. 8. We combine all numerical terms in the arguments of + and, and (for the sake of user presentation) order the result so that an number appears first for and last for +. 9. We appl the distributive law (of multiplication over addition).
So far, so good Depending on the precise definition of obviousl equal, somewhere between levels 6 and 9 lies a sstem that gets man eamples right, in the sense that the user is not upset that the sstem refuses to recognise as equal epressions in + and * that are obviousl equal. However, the grammar of even elementar algebra is larger than this, and includes (in both unar and binar forms) and /. Practicall an sstem for processing mathematics has to deal with these, and their impact on the problem of equalit modulo the usual rules of elementar algebra. It might be thought that / and (binar) - posed the same problems, being the inverse operations to * and + respectivel, but in fact the unar operators behave differentl.
Subtraction Here we have both unar and binar -. We seem to make the transformation a-b a+(-b) at a ver earl stage in our mental processing. Hence the epression a-b-c is thought of as a+(-b)+(-c), and, in levels 4 and beond, becomes the tree + a b c. Level 6 would then regard this as equal to the tree from a-c-b. It would, however, also regard this as equal to the epression -b+a-c. Logicall, one cannot object to this, but nonetheless we tend to prefer one of the other forms. Convention urges minimalit here, since the other forms require one less smbol.
Negation in Parse Trees Does -* parse as -(*) or (-)*? These are obviousl equal.
Our solution In STACK we replace unar minus b multiplication b a special token, hereafter U. Hence -(*), (-)* and *(-) become the trees U, U and U respectivel. In the presence of flattening and commutativit of *, these trees are regarded as equal.
What about (-)*(-)? This corresponds to the tree U U, (2) which is equivalent to the tree from -(-(*)) and man other variants with (multi)set of children {U, U,, }, but not equivalent to the tree from * until we get to level 7. Algebraicall U behaves like 1, but is distinguished from it at this level so as not to be confused with an eplicit 1 entered b the user, i.e. -* versus *(-1)*.
Division We use reduction to the unar case, even though the surface representation is different. We consider a unar reciprocal operator R, and regard / as generating the tree R. We need one further rule R distributes over multiplication, i.e. R R R.
Division continued (/)/z, //z and /(*z) all generate /(/z) generates R R z R R Doesn t simplif at level 6, but R(R(z)) z should be readil available in the toolkit of an eercise writer (e.g. at level 7). R z :,
(Integer) Powers The first challenge is that the distributive law for eponentiation over multiplication (ab) c = a c b c seems different from the distributive law for multiplication over addition: we do not regard () 2 as better or worse than 2 2. This is easil implemented as a tree transformation: ^ z ^ ^ z z
(Integer) Powers continued ( ) 2 We do not regard as better or worse than 2. The previous 2 transformation automaticall leads to ^ R z ^ ^ z R z but this is not quite what was desired. It is tempting to tr to fi this b rules taking R() to R( ).
(Integer) Powers continued However, we accept that R is reall raising to the power 1, and introduce the rules R ^ z, R ^ z ^ U z. 1/^(-2) is then represented as UU2. Author choice whether to regards 1/^(-2) as a clums epression which does not deserve to be simplified, or work at level 7, in which case U U z z (or the pair U U 1 and 1 z z) need to be added to the ruleset.
Conclusion Straight AC rewriting of +, * is relativel eas Adding - and / is not eas But the unar operator technique seems promising Integer powers aren t that eas, but doable There are good mathematical reasons wh using non-integer powers is harder!