Exam_03

# Exam_03 - ArsDigita University Month 2: Discrete...

This preview shows pages 1–4. Sign up to view the full content.

ArsDigita University Month 2: Discrete Mathematics - Professor Shai Simonson Examination 3 – 100 points Show all work for partial credit. You may use two hours for this exam. After one hour, raise your hand if you feel that the time constraint will be too tight. Name: ______________________________________________________________ 1. /30 2. /20 3. /15 4. /15 5. /20 Total: /100

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

View Full Document
1. Recurrence Equations (30 points) a. Solve the following recurrence equation: a n = 2a n-1 - a n-2 , a 0 = 2 , a 1 = 1. b. The scheme function below calculates the sum of a list of elements. (define (sumup alist) (cond ((null? alist) 0) ((null? (cdr alist)) (car alist)) (else (+ (car alist) (cadr alist) (sumup (cddr alist)))))) Write a recurrence equation for the time complexity of the algorithm, and solve it showing a closed form answer. Assume that each car and cdr can be done in one step.
2. Recurrence Equations (20 points) a. What is the order of complexity of each of the following recurrence equations?

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.

## This document was uploaded on 10/01/2011.

### Page1 / 5

Exam_03 - ArsDigita University Month 2: Discrete...

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

View Full Document
Ask a homework question - tutors are online