MA-351 Homework 3
Due at 9:50 in class, Thursday October 11, 2001
Calculations necessary for these problems may be done either by
hand or with Maple.
Solutions may be submitted in person in class,
or you may email an ASCII text,
Maple Worksheet (.mws),
html, or postscipt/pdf-formatted document to
me (kaltofen@math.ncsu.edu).
Note my office hours on my schedule.
- Consider
Stirling's formula for approximating n!:
-
Using the binary operators + (plus), - (minus),
* (times), / (divides),
and ** (exponentiation),
all of which have exactly 2 operands,
and assuming left-to-right grouping of operators of equal precedence,
draw the expression tree corresponding to this expression.
-
Convert the expression tree into a fully parenthesized linear infix
expression string.
-
Write the prefix expression string equivalent to the expression tree.
-
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 always start at the vertex labelled a.
-
Consider the formula a+b+c/d*(e*f).
Please give the parse tree for this expression
according to the context free grammar for expressions given in class.