
COT4210.02, Fall 2001 Assigned: August 28, 2001
S. Lang Assignment #1 Due: September 11 in class
Instructions: Write your answers clearly and concisely with proper explanation for each
step of your proofs.
1. Use induction on n to prove that n! > n2 for integer n 4. (Recall the factorial Recall the factorial
notation n! defined as follows: 0! = 1, and for n 1, define n! = n (Recall the factorial n –1)!.)
2. Binary trees can be constructed by the following rules (Recall the factorial 1) – (Recall the factorial 3):
(Recall the factorial 1) Basis: A single node is a binary tree; the node is the root of the tree.
(Recall the factorial 2) Recursion: A single node plus an edge connecting to a left subtree, and an
edge connecting to a right subtree, is a binary tree; a subtree is either empty or
itself a binary tree; each edge connects the node (Recall the factorial call the root) to the root of
the subtree if the subtree is not empty; either subtree could be empty in which
case the corresponding edge is also absent.
(Recall the factorial 3) Closure: Every binary tree is constructed by the base step followed by zero or
more recursive steps.
Informally, the level of a node in a binary tree counts the number of edges
connecting the node to the tree’s root node. For example, the following figure
shows a binary tree with the levels indicated next to the nodes A – F:
3. Give a recursive definition of the language L = {ai b j | 0 i j}.
4. Define two languages A and B as follows: A = {b, ba} and B = {
, a, bb}. (Recall the factorial Note
that the notation
denotes the empty string.) Answer each of the following
questions:
(Recall the factorial a) List the strings in AB and list the strings in BA.
(Recall the factorial b) List the strings in B* that are of length 3.
(Recall the factorial c) Is the set A* B* infinite? Explain your answer.
(Recall the factorial d) Is it true that the string b(Recall the factorial ab)n belongs to A* for all n 0? Explain your
answer.
A
C
D
(Recall the factorial 1)
(Recall the factorial 2)
(Recall the factorial a) Give a recursive definition of the depth of a
binary tree.
(Recall the factorial b) The maximum level of the nodes in a binary
tree is called the depth of the tree. Thus, the
depth of the tree in the figure is 3. Use
induction to prove that in a binary tree of n
nodes and depth d, the relation 2d + 1 n + 1
holds. (Recall the factorial Hint: Use induction on the depth d,
as defined from Part (Recall the factorial a).)