MCS-208 · Unit 1

Analysis of Algorithms

Section 3 of 8

Block 1 · Unit 1Analysis of Algorithms15 min · Section 3 of 8

1.3Simplifying Growth Functions: Rules of Big-O

Covers IGNOU MCS-208 §1.2

Proving every bound from the definition would be slow. A few rules let you simplify any growth function in seconds. This page lists them, with the conditions under which they are true.

Dropping lower-order terms and constants

The rules

The order of common functions

Rules 3–6 give a ladder of growth rates. Each function below grows strictly faster than the one before it:

1constant
→
log nlogarithmic
→
nlinear
→
n log nlinearithmic
→
n²quadratic
→
n³cubic
→
2ⁿexponential
→
n!factorial
Common growth rates, slowest to fastest

To simplify a sum, keep the term that is furthest right on this ladder.

Check Your Progress 1, questions 1–4

  • Q1. 9n+129n + 12 and 1000n+4000001000n + 400000 are both O(n)O(n): True. Constants, however large, do not change the order.
  • Q2. If f=O(g)f = O(g) and h=O(g)h = O(g), then f+h=O(g)f + h = O(g): True. If f≤c1gf \le c_1 g and h≤c2gh \le c_2 g, then f+h≤(c1+c2)gf + h \le (c_1 + c_2) g.
  • Q3. For f(n)=n2+3nf(n) = n^2 + 3n and g(n)=6000n+34000g(n) = 6000n + 34000, "O(f(n))<O(g(n))O(f(n)) < O(g(n))": False. ff is quadratic and gg is linear, so gg grows slower, whatever its large constants.
  • Q4. Asymptotic complexity depends on hardware: False. Hardware changes only the constant factor, which the notation ignores.

Key takeaways

  • Drop lower-order terms and constant factors; keep the dominant term.
  • Log bases (>1> 1) do not matter; exponential bases do.
  • log n < n^c < bⁿ < n! for large n (with c > 0, b > 1).
  • Sum rule: O(f) + O(g) = O(max(f, g)); product rule: O(f) · O(g) = O(f · g).

Practice questions

Answer on paper first, then check. The explanation matters more than the letter you chose.

Question 1 · multiple choice

Is it true that 9n+129n + 12 and 1000n+4000001000n + 400000 are both O(n)O(n)?

Show answer

Answer: A. True, because constants do not change the order

1000n+400000≤1001n1000n + 400000 \le 1001n for n≥400000n \ge 400000, so a valid cc and n0n_0 exist. Needing a large n0n_0 is allowed; it does not make the claim false.

Question 2 · multiple choice

What is the simplest Big-O of 5nlog⁡n+30n5n\log n + 30n?

Show answer

Answer: C. O(nlog⁡n)O(n \log n)

nlog⁡nn \log n grows faster than nn because log⁡n\log n grows. O(n2)O(n^2) is a valid but not tight bound.

Question 3 · multiple choice

Which statement is false?

Show answer

Answer: D. 3n=O(2n)3^n = O(2^n)

3n/2n=1.5n→∞3^n / 2^n = 1.5^n \to \infty, so no constant cc works. The log statement is true because log bases differ only by a constant factor.

Question 4 · multiple choice

If f1(n)=O(n2)f_1(n) = O(n^2) and f2(n)=O(nlog⁡n)f_2(n) = O(n \log n), what is f1(n)+f2(n)f_1(n) + f_2(n)?

Show answer

Answer: B. O(n2)O(n^2)

Sum rule: take the larger of the two bounds, n2n^2. Multiplying the bounds is the product rule, which is for f1⋅f2f_1 \cdot f_2.

Question 5 · multiple choice

Which function grows fastest for large nn?

Show answer

Answer: D. 2n2^n

By rule 5, every power nkn^k is O(2n)O(2^n). Large powers like n10n^{10} are bigger for small nn, but 2n2^n overtakes them (here after about n=59n = 59).

Question 6 · short answer

Give the simplified Big-O of 30n230n^2, 10n3+6n210n^3 + 6n^2, 5nlog⁡n+30n5n\log n + 30n, log⁡n+3n\log n + 3n and log⁡n+32\log n + 32, with a reason for each.

Show worked answer

30n2=O(n2)30n^2 = O(n^2) (drop the constant); 10n3+6n2=O(n3)10n^3 + 6n^2 = O(n^3) (dominant term n3n^3); 5nlog⁡n+30n=O(nlog⁡n)5n\log n + 30n = O(n\log n) (nlog⁡nn\log n grows faster than nn); log⁡n+3n=O(n)\log n + 3n = O(n) (nn grows faster than log⁡n\log n); log⁡n+32=O(log⁡n)\log n + 32 = O(\log n) (32 is a constant).

↑ ↓ move↵ openTab switch type