Algorithm problem
5 [3.2-3] Prove equation (3.19). Also prove that n!∈ω(2n) and
n!∈o(n^n).
5)
n! = w(2n)
small omega definition://it is lowerbound which is not tight
f(n) is w(g(n)) if c*g(n)<f(n) where n0<n , n0,c are all
values 0<c
now
f(n)=n!
g(n)=2n
now
c*g(n)<f(n)
c*2n<n!
let n=4
c*8<24
c<3
c=2
since we have c=2, n0=8 where cg(n)<f(n)
hence , n! is w(2n)
n! = o(n^n)
small-o definition//it is upperbound which is not tight
f(n) is w(g(n)) if f(n)<c*g(n)< where n0<n , n0,c are all
values 0<c
f(n)=n!
g(n)=n^n
now
f(n)<cg(n)
n!<c*n^n
let n=1
1<c
c=2
n0=1
since we have such constants,
n! = o(n^n)
Algorithm problem 5 [3.2-3] Prove equation (3.19). Also prove that n!∈ω(2n) and n!∈o(n^n).
3. Use the Division Algorithm (Theorem 6.1.1) to prove that for all n ez+ 6 I n(n +1) (2n +1).
3. Use the Division Algorithm (Theorem 6.1.1) to prove that for all n ez+ 6 I n(n +1) (2n +1).
In this problem you will prove there is a function that is in O(n, and Ω(n) but is not in Θ(nd) for any 1 sds3. State a function f(n) that is in O(3) and 2(n) but is not in (n) for anylsds3 Prove that f(n)gn forany1sds3.
Prove by Induction
24.) Prove that for all natural numbers n 2 5, (n+1)! 2n+3 b.) Prove that for all integers n (Hint: First prove the following lemma: If n E Z, n2 6 then then proceed with your proof.
a) Prove that running time T(n)=n3+30n+1 is O(n3) [1 mark] b) Prove that running time T(n)=(n+30)(n+5) is O(n2) [1 mark] c) Count the number of primitive operation of algorithm unique1 on page 174 of textbook, give a big-Oh of this algorithm and prove it. [2 mark] d) Order the following function by asymptotic growth rate [2 mark] a. 4nlogn+2n b. 210 c. 3n+100logn d. n2+10n e. n3 f. nlogn
2n 3. Prove that lim n+on+ 1 2.
Computer Algorithm question
8) Give an algorithm for building a heap in O(n)
9) Prove the algorithm given in 8) runs in O(n) time.
10) What is the asymptotic runtime of an algorithm represented
by the following recurrence equation?
11) Suppose you have the following priority queue implemented as a (max) heap. What will the heap look like when the max node is removed and the heap is readjusted? Assume on each heapify operation the largest child node is selected...
Prove that for each natural number n 26 we have 2n 3 3 2" Use the above to prove that for each natural number n 2 6 we have (n +1)2 Hint: n24n +4-(n2 +2n +1) + (2n+3).] 2"
Prove that for each natural number n 26 we have 2n 3 3 2" Use the above to prove that for each natural number n 2 6 we have (n +1)2 Hint: n24n +4-(n2 +2n +1) + (2n+3).] 2"
2. Prove that lim (-1)"+1 0. 72-00 n 2n 3. Prove that lim noon + 1 2. 80 4. Prove that lim n-+v5n 0. -7 9 - in 5. Prove that lim n0 8 + 13n 13
Prove that for n = 1, 2, 3,..., i was told i should change the cosine to it's exponential form. 1 *3* 5.. (2n 1) 2 4 6...(2n) cose2" de 1 *3* 5.. (2n 1) 2 4 6...(2n) cose2" de
Prove by induction that for every positive integer n, the following identity holds: 1+3+5+...+(2n – 1) = np. Stated in words, this identity shows that the sum of the first n odd numbers is n’.