Through converting the binary tree into one that represents math in a more humanly intuitive way, it becomes much easier to perform step-by-step simplifications.
For example, consider the expression The transformed tree is a lot closer to the way we all intuitively view addition.
Sympy introduces ambiguity; given a sympy tree, there are multiple user inputs that could have yielded it, which are mathematically equivalent but not necessarily the same to a student.
When building a CAS, it’s beneficial to reduce the problem to make it easier to achieve the goal.
We would love for you to join us in making math easy and fun to learn.
We use mathsteps to power the math experience in our latest update.It’s important to note that when creates an expression tree, it represents all operations as binary (ie a node can have maximum two children).This can be explained by the textbook definition of arithmetic operations. This means has to make a choice about which two things are being added together.After using to create a tree from a string of math, we transform the tree by flattening operations.This flattening step removes grouping choices made by the parser.Upon diving into the code, however, we realized that the structure of Sym Py expression trees are optimized for finding answers, but not for teaching.Its trees don’t store division or subtraction because these operations can be represented by multiplication, addition, and exponents.We looked around for existing solutions that we could integrate into our app, but the ones we found were closed-source, behind paywalls, or did not focus on the teaching behind the steps, so we decided to build our own.Today we’re thrilled to release mathsteps — the first open-source project that teaches math step-by-step.It implicitly adds parenthesis when constructing its tree to make the operations binary.But because and * are commutative and associative binary operations, they feel intuitively like they aren’t binary but could have any number of arguments.