Answers for Homework 1
Abbreviations. IH = Induction Hypothesis.
TLR = The Limit Rule.
(i) PG Problem 20.
We take the hint and rst show: 2n > 2n + 1 for all
n 3.
B ASE CASE . 23 = 8 > 7 = 2 3 + 1.
I NDUCTION STEP. IH: 2n > 2n + 1 for some n 3.
We need to
CIS 675 Fall 2015 Homework 1
Instructions: Submit your solutions in a pdf le to Blackboard by midnight
Eastern time on September 24, 2015. Late submissions will not be accepted!
All answers must be proved: it is not sucient to simply state the answer.
You
Homework 1 - Solutions
Question 0.3
In this problem we will conrm that this sequence grows exponentially fast and obtain some bounds on its
growth.
(a) Use induction to prove that Fn 20.5n for n 6.
Ans:
Proving the result for the base case
Let n = 6
F6
F6
Homework 3 - Solutions
Question 2.5
Solve the following recurrence relations and give bound for each of them.
(a) T (n) = 2T ( n ) + 1
3
Ans:
Use Master Theorem; a = 2, b = 3 and d = 0.
logb a = log3 2 = 0.63
So, logb a > d and T (n) = (nlog3 2 )
(b) T (n
CIS 675, Spring 2012
Homework 3
Due on Thursday, February 16
Problems There are ve problems in this homework; solve problems 2.5, 2.12, 2.13, 2.17
and 2.19 from Chapter 2 of the text.
CIS 675, Spring 2012
Solution of Homework 2
Solution of 1.2:
Take any number N , where (N 1). The number of bits needed to represent N in
binary is log2 (N + 1) and the number of digits needed to represent N is log10 (N + 1) .
But, we know that log2 (N +
Homework3
Problem1
We can visit the nearest unvisited city then return to C0 at each step.
It doesnt always find the correct answer. For example, suppose the cities are on a number line, we
start at the city at position 0. The next city visited will be at
Answers for Homework 2
CIS 675 ? Algorithms
September 7, 2009
(i) DPV Problem 1.1.
The largest 2-digit base b number is (b 1) b + (b 1) = b2 1. The
largest sum of three 1-digit base b numbers is 3 (b 1) = 3b 3. We
need to show that b2 1 3b 3 for all b 2.
Answers for Homework 3
CIS 575 ? Algorithms
September 11, 2008
(i) Fermats Corollary.
(iv) DPV Problem 1.39.
c
c
Suppose p is prime, 1 a < p, and n > 0. Show that: am an By Fermats Little Theorem: ab ab mod ( p1) (mod p).
c
(mod p), where n is m mod ( p 1
Answers for Homework 4
CIS 675 ? Algorithms
(i) DPV Problem 2.5.
September 21, 2009
So the recursive call is search( A, x, m, r). But since m = , this is an
innite recursion.
(a) T (n) = 2T (n/3) + 1. So a = 2, b = 3, and d = 0. Thus 0 = d <
logb a = log3
Mid-term Exam Answers and Final Exam
Study Guide
CIS 675
Summer 2010
Midterm Problem 1: Recall that for two functions g : N N+ and
h : N N+ , h = (g ) i for some positive integer N and positive real
numbers c1 and c2 , for every n N , c1 g (n) h(n) c2 g (
CIS 675, Spring 2012
Homework1
Due on Thursday, February 2
Note: This homework is worth two homeworks; take two weeks to do it.
Problem
Problem 0.4 (page 9) of the text (Dasgupta et al.)
1
CIS 675, Spring 2012
Homework 2
Due on Thursday, February 9
Problems There are ve problems in this homework; solve problems 1.2, 1.5, 1.6, 1.10,
and 1.13 from Chapter 1 of the text.
CIS 675, Spring 2011
Quiz 1
Thursday, February 23
Name
Problem 1
Is (530,000 6123,456 ) a multiple of 31?.
Solution:
1
2
Problem 2 Find the inverse of 20 modulo 79. That is, nd an integer a, 1 a 78
such that a 20 = 1 modulo 79.
Solution:
3
Problem 3 Suppo
SOLUTION
CS515: Algorithms
Fall 2010
Midterm
Name:
Instructions: Each question is worth 10 points. There are 4 questions. Write the answer to each question
in the space provided, using the back of each sheet as necessary. The nal sheet is blank and may be
CIS 675, Spring 2012
Solutions of Homework 3
Question 2.4
Suppose you are choosing between the following three algorithms.
Algorithm A solves problems by dividing them into ve sub-problems of half the
size, recursively solving each sub-problem, and then
CIS 675, Spring 2012
Solution of Homework 2
Question 1.15 Determine necessary and sucient conditions on x and c so that the
following holds: for any a, b, if ax bx mod c, then a b mod c.
Answer: The necessary and sucient condition is that x and c must be
Homework 1 Solutions
0.4
a) Show that two 22 matrices can be multiplied using 4 additions and 8 multiplications?
Lets take any two 22 matrices denoted by X and Y.
Let X = [
So, XY = [
] and Y = [
][
]
] =[
]
So it is evident that every entry of XY is the