# Buggy rules

In order to establish that the student has done something particular but wrong, it is useful for us to be able to apply wrong or buggy rules to expressions. A typical example would be to expand out powers in the wrong way, e.g.

# Powers obey linearity

buggy_pow(ex) Implements the buggy linearity rule for exponentiation, i.e.

This is useful if we want to compare a student's answer to the result of having done something wrong.

mediant(ex1,ex2) calculates the mediant of two rational expressions. The mediant of two fractions
Note that both denom and num work on non-rational expressions, assuming the expression to be "over one" by implication. Hence mediant will also assume the denominator is also one in such cases.