Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Tests  >  Test: Recurrence Relations - Computer Science Engineering (CSE) MCQ

Test: Recurrence Relations - Computer Science Engineering (CSE) MCQ


Test Description

15 Questions MCQ Test - Test: Recurrence Relations

Test: Recurrence Relations for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Test: Recurrence Relations questions and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus.The Test: Recurrence Relations MCQs are made for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, notes, meanings, examples, exercises, MCQs and online tests for Test: Recurrence Relations below.
Solutions of Test: Recurrence Relations questions in English are available as part of our course for Computer Science Engineering (CSE) & Test: Recurrence Relations solutions in Hindi for Computer Science Engineering (CSE) course. Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free. Attempt Test: Recurrence Relations | 15 questions in 35 minutes | Mock test for Computer Science Engineering (CSE) preparation | Free important questions MCQ to study for Computer Science Engineering (CSE) Exam | Download free PDF with solutions
Test: Recurrence Relations - Question 1

Consider the following recurrence relation

GATECS2003Q35

The value of T(m2) for m ≥ 1 is

Detailed Solution for Test: Recurrence Relations - Question 1

One easy way to solve this is to try putting different 
values of m.

For example, we know T(1) = 1. If we put m = 1, only A
and B satisfy the result.

m = 2

T(2) = T(1) + 1 = 2
T(3) = T(2) + 1 = 3
T(4) = T(3) + 2 = 5

Both A & B produce 5

m = 3
T(9) = T(4) + 2*5 + 1 = 5 + 10 + 1 = 16
Both A & B produce 16

m = 4
T(16) = T(9) + 3*7 + 1 = 16 + 21 + 1 = 38
Only B produces 38, A produces 34 which doesn't match 

Test: Recurrence Relations - Question 2

The solution to the recurrence equation T(2k) = 3 T(2k-1) + 1, T (1) = 1, is:

Detailed Solution for Test: Recurrence Relations - Question 2

We have T (2k) = 3  T (2k-1) + 1 = 32  T (2k-2) + 1 + 3 = 33  T (2k-3) + 1 + 3 + 9 . . . (k steps of recursion (recursion depth)) = 3k  T (2k-k) + (1 + 3 + 9 + 27 + ... + 3k-1) = 3k + ( ( 3k - 1 ) / 2 ) = ( (2 * 3k) + 3k - 1 )/2 = ( (3 * 3k) - 1 ) / 2 = (3k+1 - 1) / 2 Hence, B is the correct choice.   Please comment below if you find anything wrong in the above post.

1 Crore+ students have signed up on EduRev. Have you? Download the App
Test: Recurrence Relations - Question 3

Select the correct asymptotic complexity of an algorithm with runtime T(n, n) where
T(x, c) = Θ(x) for c <= 2,
T(c, y) = Θ(y) for c <= 2, and
T(x, y) = Θ(x+y) + T(x/2, y/2)

Detailed Solution for Test: Recurrence Relations - Question 3

The recurrence is
T(x, y) = Θ(x+y) + T(x/2, y/2) 
It can be written as below.
T(x, y) = Θ(x+y) + Θ((x+y)/2) + Θ((x+y)/4) +  Θ((x+y)/8)  .....
T(x, y) = Θ((x+y) + (x+y)/2 + (x+y)/4 + (x+y)/8  ..... )
The above expression forms a geometric series with ratio as 2 and starting element as (x+y)/2 T(x, y) is upper bounded by Θ(x+y) as sum of infinite series is 2(x+y). It is lower bounded by (x+y)

Test: Recurrence Relations - Question 4

Consider the recurrence relation a1 = 8, an = 6n2 + 2n + an-1. Let a99 = k x 104. The value of K is _____   Note : This question was asked as Numerical Answer Type.

Detailed Solution for Test: Recurrence Relations - Question 4

a1 = 8 an = 6n2 + 2n + an-1   an = 6[n2 + (n-1)2] + 2[n + (n-1)] + an-2   Continuing the same way till n=2, we get an = 6[n2 + (n-1)2 + (n-2)2 + ... + (2)2] + 2[n + (n-1) + (n-2) + ... + (2)] + a1   an = 6[n2 + (n-1)2 + (n-2)2 + ... + (2)2] + 2[n + (n-1) + (n-2) + ... + (2)] + 8   an = 6[n2 + (n-1)2 + (n-2)2 + ... + (2)2] + 2[n + (n-1) + (n-2) + ... + (2)] + 6 + 2   an = 6[n2 + (n-1)2 + (n-2)2 + ... + (2)2 + 1] + 2[n + (n-1) + (n-2) + ... + (2) + 1]   an = (n)*(n+1)*(2n+1) + (n)(n+1) = (n)*(n+1)*(2n+2)   an = 2*(n)*(n+1)*(n+1) = 2*(n)*(n+1)2   Now, put n=99. a99 = 2*(99)*(100)2 = 1980000 = K * 104 Therefore, K = 198.   Thus, C is the correct choice.

Test: Recurrence Relations - Question 5

When n = 22k for some k ≥ 0, the recurrence relation
T(n) = √(2) T(n/2) + √n, T(1) = 1
evaluates to :

Detailed Solution for Test: Recurrence Relations - Question 5

Please note that the question is asking about exact solution. Master theorem provides results in the form of asymptotic notations. So we can't apply Master theorem here. We can solve this recurrence using simple expansion or recurrence tree method.

T(n) = √(2) T(n/2) + √n = √(2) [√(2) T(n/4) + √(n/2) ] + √n = 2 T(n/4) + √2 √(n/2) +√n = 2[ √2 T(n/8) + √(n/4) ]+√2 √(n/2)+√n = √(2^3) T(n/8)+ 2 √(n/4) + √2 √(n/2) +√n = √(2^3) T(n/8)+√n +√n +√n = √(2^3) T(n/(2^3))+3√n ............................................. = √(2^k) T(n/(2^k))+k√n = √(2^logn) + logn √n = √n + logn √n = √n(logn +1)

Alternate Solution : This question can be easily done by substitution method look: T(1)= 1; GIVEN. Now use n=2 in the given recurrence relation which gives 2*(1.414) (since value of root over 2 is 1.414) now by looking at the options use n=2 which satisfies option A.

Test: Recurrence Relations - Question 6

Standard planning algorithms assume environment to be __________.

Detailed Solution for Test: Recurrence Relations - Question 6

Standard planning algorithms assume environment to be both deterministic and fully observable. So, option (A) is correct.

Test: Recurrence Relations - Question 7

The worst-case running time of Merge sort algorithm is described by the following recurrence relation :

Given recurrence equation evaluates to -

Detailed Solution for Test: Recurrence Relations - Question 7

T(n) = 2T (n/2) + n = 21 T(n/21) + 1.n [ k = 1] = 2k-1 T(n/2k-1) + (k-1)n = 2k-1 (2T(n/2k + n/2k-1) + (k-1)n = 2k T(n/2k) + kn

Option (A) is Correct.

Test: Recurrence Relations - Question 8

What is the time complexity for the following C module? Assume that n>0 . int module(int n) { if (n == 1) return 1; else return (n + module(n-1)); }

Detailed Solution for Test: Recurrence Relations - Question 8

F(n) = (n + f(n-1)) → n + (n-1 + f(n-2))→ n + (n-1 + (n-2 (+...+ (n-(n-1) + f(1))) Time complexity of of code is = O(n)

Test: Recurrence Relations - Question 9

For parameters a and b, both of which are ω(1), T(n)=T(n1/a)+1, and T(b)=1. Then T(n) is

Detailed Solution for Test: Recurrence Relations - Question 9

Given,

T(n) = T(n1/a)+1, T(b) = 1

Now, using iterative method,

= T(n) = [T(n1/a2)+1] + 1 = [T(n1/a3)+1] + 2 = [T(n1/a4)+1] + 3 . . . = [T(n1/ak)+1] + (k-1) = T(n1/ak) + k

Let,

→ n1/ak = b → log(n1/ak) = log(b) → ak = log(n) / log (b) = logb(n) → k = logalogb(n)

Therefore,

= T(n1/ak) + k = T(b) + logalogb(n) = 1 + logalogb(n) = Θ(logalogb(n))

Option (A) is correct.

Test: Recurrence Relations - Question 10

Consider the following three functions.

f1 = 10n

f2 = nlogn

f3 = n√n

Which one of the following options arranges the functions in the increasing order of asymptotic growth rate?

Detailed Solution for Test: Recurrence Relations - Question 10

On comparing power of these given functions : f1 has n in power. f2 has logn in power. f3 has √n in power. Hence, f2, f3, f1 is in increasing order. Note that you can take the log of each function then compare.

Test: Recurrence Relations - Question 11

Consider the following recurrence relation.

 Which one of the following options is correct?

Detailed Solution for Test: Recurrence Relations - Question 11

Given, recurrence relation can be written as, T(n) = T(n/2) + T(2n/5) + 7n T(n) = T((5/2)n/5) + T(2n/5) + 7n Since, sum of numerator (5/2+2 = 4.5) is less than denominator (5), so time complexity would be function itself. Hence, T(n) = Θ(7n) = Θ(n)

Test: Recurrence Relations - Question 12

What is the worst-case number of arithmetic operations performed by recursive binary search on a sorted array of size n?

Detailed Solution for Test: Recurrence Relations - Question 12

Arithmetic operations performed by binary search on sorted data items means computation of mid element required arithmetic operation. So it will be computed log(n) time and Hence option (C) will be correct.

Test: Recurrence Relations - Question 13

What is the value of following recurrence.

T(n) = T(n/4) + T(n/2) + cn2
T(1) = c
T(0) = 0
Where c is a positive constant

Detailed Solution for Test: Recurrence Relations - Question 13

Following is the initial recursion tree for the given recurrence relation.

If we further break down the expression T(n/4) and T(n/2), we get following recursion tree.

Breaking down further gives us following

To know the value of T(n), we need to calculate sum of tree nodes level by level. If we sum the above tree level by level, we get the following series T(n) = c(n^2 + 5(n^2)/16 + 25(n^2)/256) + ....

The above series is geometrical progression with ratio 5/16 To get an upper bound, we can sum the above series for infinite terms. We get the sum as (n^2) / (1 - 5/16) which is O(n^2)

Test: Recurrence Relations - Question 14

The running time of an algorithm is represented by the following recurrence relation:

if n <= 3 then T(n) = n

else T(n) = T(n/3) + cn

Which one of the following represents the time complexity of the algorithm?
(A) \theta(n)
(B) \theta(n log n)
(C) \theta(n^2)
(D) \theta(n^2log n)

Detailed Solution for Test: Recurrence Relations - Question 14

T(n) = cn + T(n/3)

= cn + cn/3 + T(n/9)

= cn + cn/3 + cn/9 + T(n/27)

Taking the sum of infinite GP series. The value of T(n) will be less than this sum.

T(n) = cn(1/(1-1/3))

= 3cn/2

or we can say

cn = T(n) = 3cn/2

Therefore T(n) = \theta(n)

Test: Recurrence Relations - Question 15

Consider the following recurrence. T(n) = T(√n) + θ(Log Log n) What is the value of recurrence?
(A) θ( (Log Log n)2)
(B) θ(Log Log n)
(B) θ(n)
(B) θ(Log Log Log n)

Detailed Solution for Test: Recurrence Relations - Question 15

Change of variables: let m = lg n. Recurrence becomes S(m) = S(m/2) + θ(lgm). Case 2 of master’s theorem applies, so T(n) = θ( (log Log n) ^ 2).

Information about Test: Recurrence Relations Page
In this test you can find the Exam questions for Test: Recurrence Relations solved & explained in the simplest way possible. Besides giving Questions and answers for Test: Recurrence Relations, EduRev gives you an ample number of Online tests for practice

Top Courses for Computer Science Engineering (CSE)

Download as PDF

Top Courses for Computer Science Engineering (CSE)