Question: Question regarding Recurrence function. I've written my answer, please help me to check my answer. If there's something wrong, please explain and correct for me

Question regarding Recurrence function. I've written my answer, please help me to check my answer. If there's something wrong, please explain and correct for me so I can improve the concept.

Question regarding Recurrence function. I've

Question regarding Recurrence function. I've

My answer:

Question 1(a)

(i) Describe what the function compute?

Ans: Question regarding Recurrence function. I've (assume that n >= 0)

(ii) Give recurrence relation.

Ans:

Base case: Question regarding Recurrence function. I've

Recursive: Question regarding Recurrence function. I've

(ii) Solve recurrence to get Question regarding Recurrence function. I've running time for the function.

Ans:

Question 1(b):

(i) Describe what the function compute?

Ans: Question regarding Recurrence function. I've written my answer, please help me to (assume that n >= 0)

(ii) Give recurrence relation.

Ans:

Base case: Question regarding Recurrence function. I've

Recursive: Question regarding Recurrence function. I've

(ii) Solve recurrence to get Question regarding Recurrence function. I've running time for the function.

Ans:

Question 1(c):

(i) Describe what the function compute?

Ans: check my answer. If there's something wrong, please explain and correct for

(ii) Give recurrence relation.

Ans:

Base case: Question regarding Recurrence function. I've

Recursive: Question regarding Recurrence function. I've

(ii) Solve recurrence to get Question regarding Recurrence function. I've running time for the function.

Ans:

Question 1(d):

(i) Describe what the function compute?

Ans: me so I can improve the concept. My answer: Question 1(a) (i)

(ii) Give recurrence relation.

Ans:

Base case: Question regarding Recurrence function. I've for n

Recursive: Question regarding Recurrence function. I've for n > 1

(ii) Solve recurrence to get Question regarding Recurrence function. I've running time for the function.

Ans: Question regarding Recurrence function. I've

Question 2(a)

To prove Question regarding Recurrence function. I've bound for follow recurrence relation:

Since we assume that Question regarding Recurrence function. I've (an element of big theta(n^2))

Proof from base case:

which is not true for all C, so this base case don't holds. Try next:

Describe what the function compute? Ans: (assume that n >= 0) (ii) true if Question regarding Recurrence function. I've, so base case holds.

Next, we show that Question regarding Recurrence function. I've :

Give recurrence relation. Ans: Base case: Recursive: (ii) Solve recurrence to get

Question regarding Recurrence function. I've

Question regarding Recurrence function. I've , is true if Question regarding Recurrence function. I've

(hence by principle of mathematical induction, proven)

Please let me know if I've did any of the problems wrongly and explain why its wrong so I can learn.

Best Regards.

1. For each of the following recursive functions: (1 point) Describe what the function computes (careful, some of these are tricky!) (1 point) Give a recurrence relation that describes the running time of the function (Give both base and recursive cases) (2 point) Solve the recurrence to get a running time for the function. Use either the repeated substitution method, or the recursion tree method (which is essentially the same as the repeated substitution method, just a little more graphical). Do not use the master method for this question (you will have a chance to use the master method on later questions!) (a) int recursive1(int n) if (n=0) return 0; else 1 recursive1(n-1); (b) int recursive2(int n) if (n== 0) return 1; else recursive2(n-1)recursive2 (n-1); (c) int rui(int n) if (n== 0) return 1; else 2recursive3(n-1) (d) int recursive4(int n) int no op; if (n > 1) for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!