Trees can be expanded using the distributive property, but in order to reduce them we need to implement like terms.
Implementation
Let v be a variable, a and b be constants: av^b+a'v^b = (a+a')v^b
Therefore we need a way to determine both the power and the constant of a term. This requires some standardization for trees. An arbitrary but somewhat consistent system:
each expression is separated into terms on the top level: a + b + c + d
each term is composed of variables raised to exponents multiplied by each other and 1 constant:
a(x^2)(y^3)
ax^2
ax^0 = a
any combination of numbers that can be reduced to a constant are
the distributive property is used to expand all terms
Description
Trees can be expanded using the distributive property, but in order to reduce them we need to implement like terms.
Implementation
Let v be a variable, a and b be constants: av^b+a'v^b = (a+a')v^b Therefore we need a way to determine both the power and the constant of a term. This requires some standardization for trees. An arbitrary but somewhat consistent system:
Math