0% found this document useful (0 votes)
64 views4 pages

Little O, Assignment

The document discusses asymptotic notation and provides examples to check if certain functions are little-o of other functions. It defines little-o notation as providing a loose upper bound on the growth of a function. Examples show checking if functions like 7n+8 and 9n are little-o of n^2 and n^3 respectively by determining if they satisfy the condition that f(n) is less than c*g(n) for some constant c and all n greater than a positive integer n0. The last example shows checking if 3n+2 is little-o of n^2.

Uploaded by

Rewina zerou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views4 pages

Little O, Assignment

The document discusses asymptotic notation and provides examples to check if certain functions are little-o of other functions. It defines little-o notation as providing a loose upper bound on the growth of a function. Examples show checking if functions like 7n+8 and 9n are little-o of n^2 and n^3 respectively by determining if they satisfy the condition that f(n) is less than c*g(n) for some constant c and all n greater than a positive integer n0. The last example shows checking if 3n+2 is little-o of n^2.

Uploaded by

Rewina zerou
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer science department

Data structure and algorithm


Assignment

Group members
Name ID
1. Natnael Legesse UU83429R
2. Rewina Zerou UU83473R
3. Yohannes Wolde UU75374R
4. Zelalem Zerihun UU83540R

Date September-28-2021
Little ο asymptotic notation

 Big-Ο is used as a tight upper-bound on the growth of an algorithm’s effort (this


effort is described by the function f(n)), even though, as written, it can also be a
loose upper-bound. “Little-ο” (ο()) notation is used to describe an upper-bound
that cannot be tight.
EXAMPLE; O(n^2)={n^2,100n+5, log n……}
 In general we can conclude as
O(f(n))={T(n)/for some c>0such that for all n>=some +ve no T(n)<=c.f(n)}

 Definition: Let f(n) and g(n) be functions that map positive integers to positive
real numbers. We say that f(n) is ο(g(n)) (or f(n) Ε ο(g(n))) if for any real constant
c > 0, there exists an integer constant n0 ≥ 1 such that 0 ≤ f(n) < c*g(n).
 In general we can say
o (f(n))={T(n)for all c>0, T(n)<=c.f(n) for n>=some +ve no}
 o (f(n)) is the set of all functions with a smaller rate of growth than f(n)
example ; o(n^2)={100n+5, log n …}
 Thus, little o() means loose upper-boundof f(n). Little o is a rough estimate of
the maximum order of growth whereas Big-Ο may be the actual order of growth.

Using mathematical relation, we can say that f(n) = o(g(n)) means,

Examples:

1. If f(n) = n2 and g(n) = n3 then check whether f(n) = o(g(n)) or not.

1|Page
The result is 0, and it satisfies the equation mentioned above. So we can say that
f(n) = o(g(n)).

n2∈o(n3)

2, Is 7n + 8 ∈o(n2)?

 In order for that to be true, for any c, we have to be able to find an n0 that makes
f(n) < c * g(n) asymptotically true.
 Let’s took some example,
If c = 100, we check the inequality is clearly true. If c = 1/100, we’ll have to use a
little more imagination, but we’ll be able to find an n0.
From these examples, the conjecture appears to be correct. Then check limits

=0

The result is 0, and it satisfies the equation mentioned above. So we can say that
f(n) = o(g(n)).

7n+8 ∈o(n2)

3, Is f(n)= 9n little oh of g(n)=n^3?

 f (n)=o(g(n))
f(n)<c.g(n) for all n>=k
9n<c.n^3 for all n>=k
9<c.n^2 for all n>=k
9/c<n^2 for all n>=k
Sqrt(9/c)<n for all n>=k
Choose k>sqrt(9/c) like k=sqrt(9/c)+1
Therefore
f(n)E o(g(n)) 9n E o(n^3)
f(n) <c.g(n) for all n>=k
9n <c.n^3 for all n≥sqrt(9/c)+1
Choose c=9
2|Page
9n<9.n^3 for all n≥sqrt(9/9)+1
9n<9.n^3 for all n≥1+1
1<n^2 for all n≥ 2

4, check 3n +2=o(n^2)

F(n)=3n+2
G(n)=n^2

3/n+2/n^2
=0

3|Page

You might also like