This

**preview**shows pages 1-3. to view the full**16 pages of the document.**RYERSON UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE

CPS 420

FINAL EXAM

WINTER 2017

NAME:

STUDENT ID:

INSTRUCTIONS

This exam is 3 hours long.

This exam is out of 80 and is worth 40% of the course mark.

This is a closed book exam. However, one double-sided letter-sized crib sheet is

allowed. No other aids are allowed.

This exam is single-sided and has 8 pages including this front page.

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

This exam is single-sided and has 8 pages including this front page.

Please answer all questions directly on this exam.

The exam is divided into 4 parts ordered chronologically as the material was covered in

the course. You might find it helpful to read the whole exam and start with the sections

you find easiest.

For Grading Purposes

A1-2

/10

A3

/10

B

/10

C

/20

D1-2

/12

D3

/11

D4

/7

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

CPS 420 W2017 FINAL 2

PART A – INDUCTION AND RECURSION – 20 MARKS

Given the sequence an defined recursively as follows:

a0 = 1

an = 3an-1+2 for n 1

A1 Terms of a Sequence (5 marks)

Calculate a1, a2, a3, a4, a5

Keep your intermediate answers as you will need them in the next question.

A2 Iteration (5 marks)

Using iteration, solve the recurrence relation when n1 (i.e. find an analytic formula for an).

Simplify your answer as much as possible, showing your work and quoting any formula or rule

that you use. In particular, your final answer should not contain sums and products.

###### You're Reading a Preview

Unlock to view full version