Notacja asymptotyczna

by Jerry Sky

2020-03-02



Duże OO

f,g:NRf,g: \natnums \to \reals

f(n)=O(g(n))( c n0 n>n0:f(n)cg(n) ) f(n) = O\big( g(n) \big) \equiv \big(~ \exists{c}~\exists{n_0}~\forall{n>n_0}: \big|f(n)\big| \le c \big|g(n)\big| ~\big)

Example OO #1

Dla f(n)=n3+O(n2)h(n)=O(n2) f(n) = n^3 + O(n^2) \equiv \exists{h(n)} = O(n^2) takie że f(n)=n3+h(n) f(n) = n^3 + h(n)

Example OO #2

f(n)=1010n+O(ln(n))=O(n) f(n) = 10^{10}n + O\big(ln(n)\big) = O(n)

## Duże Ω\Omega
f(n)=Ω(g(n))( c n0 nn0:cg(n)f(n) ) f(n) = \Omega\big(g(n)\big) \equiv \big(~ \exists{c}~\exists{n_0}~\forall{n\ge{n_0}}: c|g(n)| \le |f(n)| ~\big)
### Example Ω\Omega
n=Ω(log2(n)) \sqrt{n} = \Omega\big(\log_2(n)\big) nO(ln(n)) \sqrt{n} \neq O\big(\ln(n)\big)

Duże Θ\Theta

f(n)=Θ(g(n))f(n)=O(g(n))f(n)=Ω(g(n)) f(n) = \Theta\big(g(n)\big) \equiv f(n) = O\big(g(n)\big) \land f(n) = \Omega\big(g(n)\big) c1,c2nn0:c1g(n)f(n)c2g(n) \equiv \exists{c_1, c_2} \forall{n\ge{n_0}}: c_1\big|g(n)\big| \le f(n) \le c_2 \big|g(n)\big|

## Małe oo
f(n)=o(g(n))( c n0 nn0:f(n)cg(n) ) f(n) = o\big(g(n)\big) \equiv \big(~ \forall{c}~\exists{n_0}~\forall{n\ge{n_0}}: \big|f(n)\big| \le c\big|g(n)\big| ~\big)
### Example oo
13n2=O(n2) 13n^2 = O(n^2) 13n2=o(n3) 13n^2 = o(n^3) ale 13n2o(n2) 13n^2 \not ={o(n^2)}

Mała ω\omega

f(n)=ω(g(n))( c n0 nn0:cg(n)f(n) ) f(n) = \omega\big(g(n)\big) \equiv \big(~ \forall{c}~\exists{n_0}~\forall{n\ge{n_0}}: c\big|g(n)\big| \le \big|f(n)\big| ~\big)