Asymptotic Notations: Θ , O, Ω , o,ω Notations and Their Properties

Asymptotic notations give the behaviour of a function when the input size is increased largely. Big- O notation gives the tight upper bound of the given function. Big - Ω Notation gives the tightter lower bound of the given function. Big – Θ Notation decides whether the upper and the lower bounds or a given function (algorithm) are same or not.

Summary

Asymptotic notations give the behaviour of a function when the input size is increased largely. Big- O notation gives the tight upper bound of the given function. Big - Ω Notation gives the tightter lower bound of the given function. Big – Θ Notation decides whether the upper and the lower bounds or a given function (algorithm) are same or not.

Things to Remember

  1. Asymptotic notations give the behaviour of a function when the input size is increased largely.
  2. Big- O notation gives the tight upper bound of the given function. 
  3. Big - Ω Notation gives the tightter lower bound of the given function.
  4. Big – Θ Notation decides whether the upper and the lower bounds or a given function (algorithm) are same or not.

MCQs

No MCQs found.

Subjective Questions

Q1:

Explain the different types of rhhinitis ?


Type: Long Difficulty: Easy

Show/Hide Answer
Answer: <ol>
<li><strong><em>Allergic rhinitis</em></strong><strong>:</strong></li>
</ol>
<p>It is an IgE-medicated immunologic response to nasal mucosa to airborne allergens. Two clinical types have been recognized:</p>
<ol>
<li>Seasonal</li>
<li>Perennial</li>
</ol>
<p><strong>Aetiology</strong>:</p>
<ol>
<li>Inhalant allergens</li>
<li>Pollens, dust, spores, debris</li>
<li>Rare: food allergy</li>
<li>Genetic predisposition: chances of children developing are 20% and 47%</li>
<li>Respectively,. If one or both parents suffer from allergic diathesis</li>
</ol>
<p><strong><em>Nonallergicrhinitis</em></strong><strong>:</strong></p>
<p><strong>Aetiology: </strong></p>
<ol>
<li><strong>Environmental or occupational irritants.</strong> Dust, smog, secondhand smoke or strong odors, such as perfumes, can trigger nonallergic rhinitis. Chemical fumes, such as those you might be exposed to in certain occupations, also may be to blame.</li>
<li><strong>Weather changes.</strong> Temperature or humidity changes can trigger the membranes inside your nose to swell and cause a runny or stuffy nose.</li>
<li>A common cause of nonallergic rhinitis is a viral infection &mdash; a cold or the flu, for example.</li>
<li><strong>Foods and beverages.</strong> Nonallergic rhinitis may occur when you eat, especially when eating hot or spicy foods. Drinking alcoholic beverages also may cause the membranes inside your nose to swell, leading to nasal congestion.</li>
<li><strong>Certain medications.</strong> Some medications can cause nonallergic rhinitis. These include aspirin, ibuprofen (Advil, Motrin IB, others), and high blood pressure (hypertension) medications, such as beta-blockers.</li>
</ol>
<p>Nonallergic rhinitis can also be triggered in some people by sedatives, antidepressants, oral contraceptives or drugs used to treat erectile dysfunction. Overuse of decongestant nasal sprays can cause a type of nonallergic rhinitis called rhinitis medicament ossa.</p>
<ol start="6">
<li><strong>Hormone changes.</strong> Hormonal changes due to pregnancy, menstruation, oral contraceptive use or other hormonal condition such as hypothyroidism may cause nonallergic rhinitis.</li>
</ol>
<p>&nbsp;</p>
<p>Viral Rhinitis</p>
<p>The common cold, also called viral rhinitis, is one of the most common infectious diseases in humans. The infection is usually mild and improves without treatment. Because of a large number of people who get the common cold, this illness results in nearly 26 million days of missed school and 23 million days of absence from work every year in the United States. The average American has 1 to 3 colds per year.</p>
<p>The common cold is an upper respiratory infection that is caused by several families of viruses. Within these virus families, more than 200 specific viruses that can cause the common cold have been identified. The virus family that causes the most colds is called rhinovirus.</p>

Q2:

What are the measures of treatment and drugs in treating rhinitis ?


Type: Short Difficulty: Easy

Show/Hide Answer
Answer: <p>Treatment with drugs</p>
<ol>
<li>Antihistamine and oral congestion</li>
<li>Sympathomimetic drugs</li>
<li>Corticosteroids</li>
<li>Sodium cromoglycate</li>
<li>Nursing management:</li>
<li>Instructing patient with allergic rhinitis to avoid or reduce exposure to allergens.</li>
<li>To read drug labels before taking any OTC medication to prevent possible drug interaction.</li>
<li>Instructing patient about importance of sanitation,</li>
<li>Teaching proper hand washing technique.</li>
<li>Instructing patient in proper technique for administering nasal medications.</li>
<li>Teaching methods to treat symptoms of common cold and preventive measures.</li>
</ol>

Videos

No videos found.

Asymptotic Notations: Θ , O, Ω , o,ω Notations and Their Properties

Asymptotic Notations: Θ , O, Ω , o,ω Notations and Their Properties

Asymptotic Notation

Having the expression for best, average case and worst cases, for all the three cases, we need to identify the upper and lower bounds. In order to represent these upper and lower bounds, we need some kind of syntax and that is the subject of following discussion. Let us assume that the given algorithm is represented in the form of the function f(n).

Big -O Notation

This notation gives the tight upper bound of the given function. Generally, it is represented as f(n) = O(g(n)). That means, at larger values of n, the upper bound of f(n) is g(n). For example: if f(n) = n4 + 100n2 + 10n + 50 is the given algorithm, then n4 is g(n). i.e. g(n) gives the maximum rate of growth for f(n) at larger values of n.

Let us see the O-notation with little more detail. O-notation defined as O(g(n)) = {f(n): there exist positive constants c and no such that 0 <= f(n) <= cg(n) for all n >= n0 }. g(n) is an asymptotic tight upper bound for f(n). Our objective is to give the smallest rate of growth g(n) which is greater than or equal to the given algorithm’s rate of growth f(n).

In general, we discard lower values of n. That means the rate of growth at lower values of n is not important. In the below figure, n0 is the point from which we need to consider the rate of growths for a given algorithm. Below n0, the rate of growths could be different.

Fig: Big - O Notation
Fig: Big - O Notation

Note: O(g(n)) is the set of functions with smaller or same order of growth as g(n). For example, O(n2) includes O(1), O(1), O(nlog n) etc.

Examples:

1. f(n) = 3n + 8

Solution: 3n +8 <= 4n for all n >= 1

So, 3n + 8 = O(n) with c = 4 and n0 = 8

2. f(n) = 2n3 – 2n2

Solution: 2n3 – 2n2 <= 2n3 for all n >= 1

So, 2n3 – 2n2 = O(n3) with c = 2 and n0 = 1

3. f(n) = n

Solution: n <= n2 for all n >= 1

So, n = O(n2) with c = 1 and n0 = 1

Big - Ω Notation

Similar to the O discussion, this notation gives the tighter lower bound of the given algorithm and we represent it as f(n) =Ω(g(n)). That means, at larger values of n, the tighter lower bound of f(n) is g(n). For example, if f(n) = 100n2 + 10n + 50, g(n) is omega(n2).

Fig: Big - Omega Notation

Fig: Big - Omega Notation

The Ω notation can be defined as Ω(g(n)) = { f(n): there exists positive constants c and n0 such that 0 <= cg(n) <= f(n) for all n >= n0 }. g(n) is an asypmtotic tight lower bound for f(n). Our objective is to give the largest rate of growth g(n) which is less or equal to given algorithm’s rate of growth f(n).

Examples:

1. f(n) = 5n2

Solution: There exists c, n0 such that: 0 <= cn <= 5n2 => cn <= 5n2 => c = 1 and n0 = 1

So, 5n2 = Ω(n) with c = 1 and n0 = 1.

Similarly, n3 = Ω(n2), n = Ω(logn)

Big – Θ Notation

This notation decides whether the upper and the lower bounds or a given function (algorithm) are same or not. The average running time of algorithm is always between lower bound and upper bound. If the upper bound (O) and the lower bound (Ω) gives the same result, then Θ notation will also give the same rate of growth.

As an example, lets take f(n) = 10n + n. Then, its tight upper bound g(n) is O(n). The rate of growth in the base case is g(n) = O(n). In this case, rate of growths in best case and the worst case are the same. As a result, the average case will also be same. For a given function (algorithm), if the rate of growths (bounds) for O and Ω are not same, then the rate of growth Θ also varies.

Fig: Big - Theta Notation
Fig: Big - Theta Notation

Now, lets consider the definition of Θ notation. It is defined as Θ(g(n)) = { f(n): there exist positive constants c1, c2 and n0 such that 0 <= c1g(n) <= f(n) <= c2g(n) for all n >= n0. g(n) is an asymptotic tight bound for f(n). Θ(g(n)) is the set of functions with the same order of growth as g(n).

Examples:

1. f(n) = n2/2 – n/2

Solution: n2/5 <= n2/2 – n/2 <= n2 for all n >= 1

So, n2/2 – n/2 = Θ(n2) with c1 = 1/5, c2 = 1 and n0 = 1

2. Prove that f(n) != Θ(logn)

Solution: c1logn <= n <= c2logn => c2 >= n/logn, for all n >= n0, which is impossible.

References:

1. L, Robert. "Data Structures and Algorithms in24Hours"

2. G. Brassard and P. Bratley, “Fundamentals of Algorithms”

3.Karumanchi, N. "Data Structures and Algorithms Made Easy"

Lesson

Growth Functions

Subject

Computer Engineering

Grade

Engineering

Recent Notes

No recent notes.

Related Notes

No related notes.