0% found this document useful (0 votes)
11 views

01 Assignment

The document is a weekly problem set for AMFAI, dated July 25, 2024, containing ten mathematical problems related to asymptotic analysis and complexity. Topics include proving logarithmic relationships, analyzing recursive functions, and using the substitution method for solving recurrences. It also includes proofs related to Θ-notation and the relationships between different complexity classes.

Uploaded by

fpx82038
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

01 Assignment

The document is a weekly problem set for AMFAI, dated July 25, 2024, containing ten mathematical problems related to asymptotic analysis and complexity. Topics include proving logarithmic relationships, analyzing recursive functions, and using the substitution method for solving recurrences. It also includes proofs related to Θ-notation and the relationships between different complexity classes.

Uploaded by

fpx82038
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

AMFAI Weekly Problem Set: Week 1

July 25, 2024

1. Show that, n log (n) + n log (log (n)) = Θ (log (n)) ∀n ≥ n0


2. Compute asymptotic complexity of T (n, n) in terms of Θ where,

x
 if y ≤ 50
T (x, y) = y if x ≤ 50
y
x + y + T 2x
 
3 , 2 otherwise

3. Let x1 , x2 , ·, xn be a set of inputs that are received one at a time. Whenever


a new input, xi is received, we assign it to an array, Aj . If the size of the
array is full, then a new array, Aj+1 is created with its capacity twice the
size of the current array, i.e., |Aj+1 | = 2|Aj |. The old elements are then
copied and finally xi is inserted into Aj+1 . Find the asymptotic complexity
of the number of element assignments of this algorithm. Consider, |A0 | = 1
and n to be a multiple of 2.
4. Let a and c be be non-negative constants, b, d and x non-negative constants
and let n = ck for some non-negative integer k. Then, prove that the
solution to the recurrence
(
d if n = 1
f (n) =
af nc + bnx if n ≥ 2


is
f (n) = bnx logc (n) + dnx if a = cx
bcx bcx
   
logc a
f (n) = d + n − nx if a ̸= cx
a − cx a − cx

5. Let f (n) and g(n) be asymptotically nonnegative functions. Using the


basic definition of Θ-notation, prove that

max(f (n), g(n)) = Θ(f (n) + g(n)).

6. For any two functions f (n) and g(n), show that f (n) = Θ(g(n)) if and
only if f (n) = O(g(n)) and f (n) = Ω(g(n)).

1
7. Prove that if f = Ω(g) then f ∈
/ o(g).
8. To prove that o(g(n)) ∩ ω(g(n)) is the empty set.
9. Solve using Substitution Method
(a)
(
1, if n = 1
T (n) = (1)
2T ( n2 ) + n, otherwise

(b)
(
1, if n = 1
T (n) = n
(2)
T ( 2 ) + c, if n > 1

10. Find the time complexity in terms of Θ of the following algorithm


k
n ← 22
count ← 0
for i ← 1 to n do
j←2
while j ≤ n do
j ← j2
count ← count +1
end while
end for
return count

You might also like