Discrete Mathematics and Its Applications, Seventh Edition

Published by McGraw-Hill Education
ISBN 10: 0073383090
ISBN 13: 978-0-07338-309-5

Chapter 11 - Section 11.3 - Tree Traversal - Exercises - Page 784: 31

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.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.