DragginMath: Drag Sideways/Toward for Purple Mode
Purple Mode is about Commute and Cancel.
In the expression a+b, drag the a node toward the b node. When the nodes pass each other, the a node turns purple. Also, the b node moves to where the a node used to be. Now lift your finger. See the a node move to where the b node used to be. Or you could do it the other direction with the same final result.
This is the Commutative Property of Addition: for any numbers a and b, a+b = b+a.
If you try these same moves with the expression a∗b, you will see the Commutative Property of Multiplication: for any numbers a and b, a∗b = b∗a.
This works when dragging simple nodes like numbers or variables. It also works when dragging operators with their own subtrees. For example, in the expression 2∗a+b, you can drag ∗ toward b, or b toward ∗, to get b+2∗a.
With a commutative operator, you can change the order of its operands without changing anything else, and the result means the same thing as what you started with. DragginMath has many operators, but only addition and multiplication are truly commutative.
This does not mean we can’t change the order of operands for other operators. It just means that, if we do change the order of their operands, we have to change other things, also. An operator for which we can always make a change like this is called a commutable operator.
a−b becomes -b+a
a÷b becomes ⅟b∗a
a↑b becomes (⅟b)√a
a√b becomes b↑(⅟a)
a↓b becomes ⅟(b↓a)
There are two special cases when commuting:
a−a becomes 0
a÷a becomes 1
These are examples of cancellation. This works for simple operands like variables and numbers, and also for subtrees that are equal. For example, you can cancel a∗b−a∗b. You can also cancel a∗b−b∗a. If the operands of a subtraction or division are equal subject only to the Commutative Property, DragginMath will cancel them. If any other properties are needed to show their equality, you will have to make those transformations manually before DragginMath will be able to cancel them. For example a∗b∗c−b∗a∗c will cancel, but a∗b∗c−a∗c∗b will not because the Associative Property is needed to show the operands of − are equal.
Cancellation works even when evaluation (double-tapping) doesn’t. For example, if you evaluate a−a, you get a−a, but if you cancel a−a, you get 0. If you evaluate a÷a, you get a÷a, but if you cancel a÷a, you get 1.