User:Numiri/KinderCalculus/syntax

Fences
aka. "Layer Vision", aka. syntax, aka. order of operation, is the ability to correctly see the order of operation. Associativity is a special case of Layer Vision with verb purity -- that is all + verbs or all * verbs. The following explains to students the necessity of Layer Vision.

Fences are shapes or parentheses marks that define the span of a layer.



(\ ) \ \ \ \Bigg(\qquad \Bigg) $$

Take a look at the phrase



\left(\left(\frac{((4\times x)+1)}{3}\right)^2 - 5\right) $$

When we do arithmetic, we work from the innermost layer outwards. The fences tells us to start with x. Working outward, we times 4, then add 1, then divide by 3, then self-times 2, then minus 5. But as you can see, a lot of fences can clutter up the phrase. We'd rather write



\left(\frac{4x+1}{3}\right)^2 - 5 $$

and have set rules to tell us the layering order. This is "layer vision" -- the ability to see the layers even when fences and verbs are invisible.

It's important to get the layering right because an incorrect reading of the layers will give wrong answers. For example, 4*5+1 may be read as (4*5)+1 or 4*(5+1). If we chose the wrong layering, we may answer 24 instead of 21.

When parentheses become too cluttered, we can also use shapes.

Invisible Verbs
Often expressions can be really cluttered such as



\frac{-b + (((b^2) -(4 \times (a\times c)))^{1/2})}{(2\times a)} $$

We would like to write cleaner expressions so we make the following noun-placement rules that makes a verb invisible.

With verbless & fenceless notation, the messy expression above rewrites as the cleaner standard quadratic formula.

Invisible Fences
Here are the standard rules, in authoritative pecking order, that defines fenceless layering:

With these fenceless & verbless invisibility rules, the nasty phrase above becomes a cleaner

$$ \frac{-b +\sqrt{b^2-4ac}}{2a} $$

Syntax diagram
Mathematical expressions have a syntactic structure that can be drawn as a "branch". For example, .                          3             3                                     .            3  3            \           /                                      .           a  b      is      ^ -- * -- ^. /          \                                      .                           a             b. . and. .                           a. 3           \                                                 .            (ab)      is      * -- ^ -- 3. /                                                .                            b. . In this diagram, the first operations (inner layers) are leaf nodes while the later operations (outer layer) are the inner nodes. This diagram will come in handy as we consolidate the many algebraic operations (see section on algebraic identities).