CSC236H: Introduction to the Theory of Computation
Homework 3 Solutions
1. Early members of the Pythagorean Society defined figurate numbers to be the number of dots in certain
geometrical configurations.
(a) The first four triangular numbers are 1, 3, 6, and 10.
Find a recursive expression for the nth triangular number.
Guess (you may use substitution, but note
that the answer is very easy, and you have seen it before) the closed form for this function and prove your
answer to be correct.
Solution.
Let
T
(
n
) represent the
n
th triangular number. By examining the figure, it is easy to observe
that each figure is obtained from the previous one by adding an extra row of dots. The number of dots
in the new row is exactly the side length of the resulting triangle. Thus we get the recurrence relation:
T
(1) = 1
,
T
(
n
) =
T
(
n

1) +
n
n
≥
2
.
If we expand this, we get
T
(
n
) = 1 +
· · ·
+
n
. We know from the course notes that the solution to this is
T
(
n
) =
n
(
n
+ 1)
/
2 (see the notes for the inductive proof).
(a) The first four pentagonal numbers are 1, 5, 12, and 22.
Find a recursive expression for the nth pentagonal number. Guess the closed form for this function and
prove your answer to be correct.
Solution.
Let
P
(
n
) represent the
n
th pentagonal number. Clearly
P
(1) = 1 Examining the figure, we
observe that to go from the pentagon of side length
i
to the next (of side length
i
+ 1) we add three sets
of
i
+ 1 dots each to three of the sides of the previous pentagon. However, two of the dots are each shared
between two out of the three sets of
i
+ 1 dots that are added. Therefore, the total number of dots added
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 FarzanAzadeh
 Mathematical Induction, Recursion, Inductive Reasoning, Natural number, inductive hypothesis

Click to edit the document details