Answer
Showing that any well-formed formula in prefix notation over a set of symbols and a set of binary operators contains exactly one more symbol than the number of operators.
Work Step by Step
Proof by mathematical induction.
--Let S(X) andO(X) represent the number of symbols and number of operators in the well-formed formulaX,
-respectively.
The statement is true for well-formed formulae of length 1, because they have 1 symbol and 0 operators.
-Assume the statement is true for all wellformed formulae of length less than n.A well-formed formula of length n must be of the form ∗XY, where ∗ is an operator and X and Y are well-formed formulae of length less than n.
-Then by the inductive hypothesis
--S(∗XY) = S(X)+S(Y) = [O(X) + 1] + [O(Y) + 1] = O(X) + O(Y) + 2.
Because
-O(∗XY) = 1 + O(X) + O(Y), it follows that S(∗XY) =O(∗XY) + 1.