MA-351 Homework 3

Due at 4:59pm in my mailbox in SAS 3151, Tuesday, October 26, 2010



All solutions must be submitted in hardcopy either to me in class or placed in my mailbox. Note my office hours on my schedule.

  1. Consider the formula for approximating the n-th Catalan number, based on Stirling 's formula for approximating n!:
    22*n

    (n+1) * (π*n)1/2
    1. Using the binary operators + (plus), - (minus), * (times), / (divides), and ^ (exponentiation), all of which have exactly 2 operands, draw the expression tree corresponding to this expression.
    2. Convert the expression tree into a minimally parenthesized linear infix expression string, using precedence and left-to-right rules whenever possible.
    3. Write the prefix and postfix expression string equivalent to the expression tree.
  2. Consider the context-free grammar whose production/rules are <T> → λ, <T> → (<LST>) <RST>, <LST> → <T>, <RST> → <T>, where T, LST, RST in the metasymbols refers to tree, left subtree, right subtree. The terminals are (, ), λ is the empty string (tree with no vertices), and the start symbol is <T>. Please draw the parse tree for the word
    ()(()())((()))
    and then draw the binary tree.
  3. DMM §3.3, Problem 8, page 107. Note: in order to have a unique DFS tree, assume that the order of the neighboring vertices of each vertex is alphabetical and that you start at vertex labeled a.