Algorithmic Analysis | Small o and small Omega symbols

Source: Internet
Author: User

Asymptotic Analysis the main idea is to measure the efficiency of an algorithm that does not depend on machine-specific constants, mainly because the analysis does not require algorithms to be implemented and to compare the time spent by the program. We have discussed three major asymptotic symbols . The time complexity of the algorithm is expressed using the following 2 asymptotic symbols.

Small ο Asymptotic symbol

large o is used as a tight upper limit of the growth of the algorithm effort (this effort is described by the function f (n)), although as mentioned above it can also be loosely capped. the "ο" (ο ()) notation is used to describe an upper limit that cannot be tightened.

definition: orders f (n) and g (n) are functions that map positive integers to positive real numbers. if for any real constant c> 0, the F (n) is ο (g (n)) (or f (n) ∈ (g (n)) , there is an integer constant n0≥1, which makes F (n) 0.  It means that small O () represents the f (n) loosely bound .   In mathematical relationships,  f (n) = O (g (n)) means  lim f (n)/g (n) = 0  n→∞







For example:

7n + 8∈o (n 2 )?
To do so, for any C, we must be able to find the
f (N) <c * g (n) asymptotically true N0 .
Let's give an example,
if C = 100, we check whether inequality is clear. If C = 1/100, we will have to use
more imagination, but we can find a n0. (Try n0 = 1000.) from
In these examples, the speculation seems to be correct.
Then check the limits,
Lim F (n)/g (n) = Lim (7n + 8)/(n 2 ) = Lim 7/2n = 0 (l ' Hospital)
n→∞ n→∞ n→∞

so 7n + 8∈o (n 2 )

Small Ω-Asymptotic symbol

Definition: so that f (n) and g (n) are functions that map positive integers to positive real numbers. we say f (n) is Ω (g (n)) (or f (n) ∈ω (g (n))) if for any real constant c> 0, there is an integer constant n0≥1, (n) > C * g (n) ≥0, for integer n≥n0.

F (n) has a higher growth rate than g (n), so the main difference between large omega (Ω) and small omega (ω) is their definition. In large Omega F (n) =ω (g (n)), and the boundary is 0 <= CG (n) 0, but in the case of small Ω, for all constants c> 0 is so.

We use the Ω notation to denote a lower bound that is not asymptotically tight.
F (N) ∈ω (g (n)) if and only if G (n) ∈ο ((f (n))),

In the mathematical relationship,
If f (n) ∈ω,

Lim f (N)/g (n) =∞

n→∞ Example:

Proof 4n + 6∈ο (1);
The Ω (ο) run time can be demonstrated by applying the restriction formula given below.
If Lim f (n)/g (n) =∞, then the function f (n) is ο (g (n))
n→∞
Here we have the function f (n) = 4n + 6 and g (n) = 1
Lim (4n + 6)/(1) =∞
n→∞ For any C, we can get n0 for this inequality 0 <= c * g (n) <f (n), 0 <= c * 4n + 6
So prove.

Algorithmic Analysis | Small o and small Omega symbols

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.