How to Convert Postfix to Infix in Algebra

There are three ways to write the function operators with the objects they operate on. Prefix means writing the operator first, so +AB means the sum of A and B. Infix is probably the most familiar system for most people. In infix notation, A + B indicates the sum of A and B. In postfix notation, AB+ indicates the sum of A and B. All three systems have advantages and disadvantages, and all three systems have been used for computer applications.

Instructions

    • 1

      Keep some simple translations in mind to guide you through the conversion process. The fundamental model is: AB+ goes to A + B. The operator on the right goes to the middle and the two expressions to the left of the postfix operator go to the left and right of the infix operator. Another model is: ABC*+ goes to A + (B * C). Once again, the rightmost operator of the postfix notation becomes the central operator of the infix notation. The tricky part is realizing that A is one term and (B * C) is the other term. The third model is: AB*C+ goes to (A * B) + C.

    • 2

      Keep things straight by using parentheses at each step and then erasing the extraneous parentheses when the conversion is complete. For example, AB+CD*E/+ goes to (AB*) + (CD*E/) goes to ((A ) + (B)) + ((CD* ) / (E)). Some of the parentheses could be removed at this point to make things clearer: ((A ) + (B)) + ((CD* ) / (E)) becomes (A * B) + ((CD*) / E), which goes to (A * B) + ((C * D) / E).

    • 3

      Learn to recognize a sub-expression so you can see things like AB+CD*E/+ goes to (AB*) + (CD*E/). The easy way to do this is to think of expressions as trees with operators as the root and interior nodes and symbols as the leaves. So CD*E/ is a tree with the root / and a left and right sub-tree. The right sub-tree starts with E, so it is a leaf. The rest of the string is CD*, which is a tree because it starts with * and the rest of the string is CD. This means that CD*E/ is a tree. The rest of the string is AB*, which is the tree A * B.

Learnify Hub © www.0685.com All Rights Reserved