Big Ω and Θ Notations

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 6

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

7 Terms

1

Big-O Notation

  • The formal definition of Big O: 

    • T(n) O(f(n)) if there are positive constants M and n₀ such that 

      • T(n) ≤ M×f(n) for all n ≥ n₀

<ul><li><p><span>The formal definition of Big O:&nbsp;</span></p><ul><li><p><span>T(n) </span><span style="font-family: &quot;Cambria Math&quot;">∊</span><span> O(f(n)) if there are positive constants M and n₀ such that&nbsp;</span></p><ul><li><p><span>T(n) ≤ M×f(n) for all n ≥ n₀</span></p></li></ul></li></ul></li></ul><p></p>
New cards
2

Big Ω Notation

  • The formal definition of Big Ω: 

 

  • Let T(n) and f(n) be two positive functions from the integers or the real numbers to the real numbers 

  • T(n) is Ω(f(n)) if even as n becomes arbitrarily large, T(n)'s growth is bounded rom below by f(n), meaning it grows no slower than f(n) 

  • T(n) Ω(f(n)) if there are positive constants M and n₀ such that 

    • T(n) ≥ M×f(n) for all n ≥ n₀

<ul><li><p><span>The formal definition of Big Ω:&nbsp;</span></p></li></ul><p>&nbsp;</p><ul><li><p><span>Let T(n) and f(n) be two positive functions from the integers or the real numbers to the real numbers&nbsp;</span></p></li><li><p><span>T(n) is Ω(f(n)) if even as n becomes arbitrarily large, T(n)'s growth is bounded rom below by f(n), meaning it grows no slower than f(n)&nbsp;</span></p></li><li><p><span>T(n) </span><span style="font-family: &quot;Cambria Math&quot;">∊</span><span> Ω(f(n)) if there are positive constants M and n₀ such that&nbsp;</span></p><ul><li><p><span>T(n) ≥ M×f(n) for all n ≥ n₀</span></p></li></ul></li></ul><p></p>
New cards
3

Big Θ Notation

  • The formal definition of Big Θ: 

    • Let T(n) and f(n) be two positive functions from the integers or the real numbers to the real numbers 

    • T(n) is Θ(f(n)) if even as n becomes arbitrarily large, T(n)'s growth is bounded from above and below by f(n), meaning it grows no faster and no slower than f(n) 

    • T(n) Θ(f(n)) if there are positive constants M1, M2 and n₀ such that 

      • M1×f(n) ≤ T(n) ≤ M2 ×f(n) for all n ≥ n₀

    • It means T(n) Θ(f(n)) if T(n) O(f(n)) AND T(n) Ω(f(n))

<ul><li><p><span>The formal definition of Big Θ:&nbsp;</span></p><ul><li><p><span>Let T(n) and f(n) be two positive functions from the integers or the real numbers to the real numbers&nbsp;</span></p></li><li><p><span>T(n) is Θ(f(n)) if even as n becomes arbitrarily large, T(n)'s growth is bounded from above and below by f(n), meaning it grows no faster and no slower than f(n)&nbsp;</span></p></li><li><p><span>T(n) </span><span style="font-family: &quot;Cambria Math&quot;">∊</span><span> Θ(f(n)) if there are positive constants M1, M2 and n₀ such that&nbsp;</span></p><ul><li><p><span>M1×f(n) ≤ T(n) ≤ M2 ×f(n) for all n ≥ n₀</span></p></li></ul></li><li><p><span>It means T(n) </span><span style="font-family: &quot;Cambria Math&quot;">∊</span><span> Θ(f(n)) if T(n) </span><span style="font-family: &quot;Open Sans&quot;">∊</span><span> O(f(n)) AND T(n) </span><span style="font-family: &quot;Open Sans&quot;">∊</span><span> Ω(f(n))</span></p></li></ul></li></ul><p></p>
New cards
4

Big O, Big Ω, Big Θ Graphs

knowt flashcard image
New cards
5

In General

knowt flashcard image
New cards
6

Linear Search

When No Case is Mentioned:

Which are TRUE? 

  • Linear search is O(n) 

    • TRUE: There is no input of size n for which the runtime is not bounded from above by n 

    • Best case O(1), O(log n), O(n), …. 

    • Average case O(n), O(nlog n), O(n^2), ….. 

    • Worst case O(n), O(nlog n), O(n^2), …..

  • Linear search is Ω(1) 

    • TRUE: There is no input of size n that takes less than a constant amount of time 

    • True for every algorithm 

    • Best case Ω(1) 

    • Average case Ω(n), Ω(log n), Ω(1) 

    • Worst case Ω(n), Ω(log n), Ω(1)

  • Linear search is Θ(n)

    • FALSE: There is an input of size n, the best case, specifically, for which the runtime is Θ(1) 

    • Best case Θ(1) 

    • Average case Θ(n) 

    • Worst case Θ(n)

<p>When No Case is Mentioned:</p><p>Which are TRUE?&nbsp;</p><ul><li><p><span>Linear search is O(n)&nbsp;</span></p><ul><li><p><span>TRUE: There is no input of size n for which the runtime is not bounded from above by n&nbsp;</span></p></li><li><p><span>Best case O(1), O(log n), O(n), ….&nbsp;</span></p></li><li><p><span>Average case O(n), O(nlog n), O(n^2), …..&nbsp;</span></p></li><li><p><span>Worst case O(n), O(nlog n), O(n^2), …..</span></p></li></ul></li><li><p><span>Linear search is Ω(1)&nbsp;</span></p><ul><li><p><span>TRUE: There is no input of size n that takes less than a constant amount of time&nbsp;</span></p></li><li><p><span>True for every algorithm&nbsp;</span></p></li><li><p><span>Best case Ω(1)&nbsp;</span></p></li><li><p><span>Average case Ω(n), Ω(log n), Ω(1)&nbsp;</span></p></li><li><p><span>Worst case Ω(n), Ω(log n), Ω(1)</span></p></li></ul></li><li><p><span>Linear search is Θ(n)</span></p><ul><li><p><span>FALSE: There is an input of size n, the best case, specifically, for which the runtime is Θ(1)&nbsp;</span></p></li><li><p><span>Best case Θ(1)&nbsp;</span></p></li><li><p><span>Average case Θ(n)&nbsp;</span></p></li><li><p><span>Worst case Θ(n)</span></p></li></ul></li></ul><p></p>
New cards
7

Summary

knowt flashcard image
New cards
robot