hw3-sol - CSC236H: Introduction to the Theory of...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/11/2010 for the course CSC CSC236 taught by Professor Farzanazadeh during the Spring '10 term at University of Toronto- Toronto.

Page1 / 3

hw3-sol - CSC236H: Introduction to the Theory of...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online