Deprecated: Implicit conversion from float-string "1587191312.569" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1587191312.569" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1587191312.569" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1587191312.569" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1587191312.569" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594

Deprecated: Implicit conversion from float-string "1587182238.841" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1587182238.841" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1587182238.841" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1587182238.841" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803

Deprecated: Implicit conversion from float-string "1587182238.841" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 594
Peter Linz, 3rd Ed, Chapter 1, Pg 15, Ques 19 / GATE Overflow for GATE CSE
retagged by
444 views

2 Answers

1 votes
1 votes

Given f(n)=O(n$^{2}$) and g(n)=O(n$^{3}$)

Hence as per definition,

f(n)<=c*n$^{2}$, f(n) can be n$^{2}$, n$^{2}$/logn, nlogn,n,constant,1/n,1/n$^{2}$,1/2$^{n}$,...

Similarly,

g(n)<=c*n$^{3}$, f(n) can be n$^{3}$, n$^{2}$, nlogn,n,constant,1/n,1/n$^{2}$,1/2$^{n}$,...

Solution:

[I] f(n)*g(n) <= [constant *largest possibile eqn in f(n) ]*[constant *largest possibile eqn in g(n) ]=constant*n$^{2}$*constant*n$^{3}$

i.e. f(n)*g(n)<=c*n$^{5}$,

Hence f(n)*g(n)=O(n$^{5}$).

[II] f(n)/g(n) <= [constant *largest possibile eqn in f(n) ] [constant *smallest eqn in g(n) ]

Since the lowest equation is not bounded for g(n), it can be 1/n, 1/n!,1/2$^{n}$,1/n$^{n}$, and even lower than that

Hence f(n)/g(n) does not have an upper bound. 

0 votes
0 votes

 f(n) = O(n2)

 g(n) = O(n3)

 f(n) * g(n) = O(n^2)  * O(n^3) = O(n^5)

f(n) / g(n)  = O(n^2) /  O(n^3) = O(1/n)

Related questions


Deprecated: Implicit conversion from float-string "1535310304.658" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 796

Deprecated: Implicit conversion from float-string "1535310304.658" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 801

Deprecated: Implicit conversion from float-string "1535310304.658" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 802

Deprecated: Implicit conversion from float-string "1535310304.658" to int loses precision in /var/www/html/qadb/qa-include/app/format.php on line 803
1.7k
views
3 answers
0 votes
Shubham Pande asked Jun 29, 2017
1,705 views
With Σ = {a,b}, give a dfa for L= w1aw2 :|w1|≥ 3,|w2|≤ 5
352
views
1 answers
0 votes
Shubham Pande asked Jul 1, 2017
352 views
Is it true that for any nfa M = (Q,Σ,δ,q 0 ,F) the complement of L(M)is equal to the set {w ∈ Σ * : δ *(q 0 ,w) F= Ø}?
536
views
1 answers
0 votes
Nam14 asked Apr 5, 2023
536 views
Please read below passage from 10th edition Operating System Concepts, pg. 202:5.1.3 Preemptive and Nonpreemptive SchedulingCPU-scheduling decisions may take place under ...
348
views
0 answers
0 votes
Mudita asked Aug 26, 2018
348 views
Total PHP MySQL Other RAM
Time (ms) % Time (ms) % File count Time (ms) % Query count Time (ms) % Amount %
Setup 4.7 3% 3.2 2% 72 1.7 1% 2 0.0 0% 569k 48%
Control 16.4 13% 2.1 1% 5 14.7 12% 12 0.0 0% 213k 18%
View 2.7 2% 2.7 2% 12 0.0 0% 0 0.0 0% 109k 9%
Theme 91.6 75% 6.5 5% 15 85.3 70% 3 0.0 0% 281k 23%
Stats 6.3 5% 0.1 0% 0 6.2 5% 1 0.0 0% 0k 0%
Total 121.7 100% 14.7 12% 104 107.9 88% 18 0.0 0% 1174k 100%