Lista 2

by Jerry Sky



Zadanie 1

side-note: k=0nckk=0ck=11c\sum_{k=0}^{n}c^k \le \sum_{k=0}^{\infin}c^k = \frac{1}{1-c} dla c<1|c| < 1

g(n)=1+c+c2+...+cn, c>0g(n) = 1 + c + c^2 + ... + c^n, ~ c>0

  1. Θ(1)\Theta(1) jeśli c<1c<1
  2. Θ(n)\Theta(n) jeśli c=1c = 1
  3. Θ(cn)\Theta(c^n) jeśli c>1c > 1 3’. (końcówka)
    c>1c > 1
    g(n)=1cn11c=()=Θ(cn)g(n) = \frac{1 - c^{n-1}}{1- c} = (*) = \Theta(c^n)
    f(n)=Θ( h(n) )(d1,d2n0nn0d1h(n)f(n)d2h(n))f(n) = \Theta(~h(n)~) \equiv (\exists d_1, d_2 \exists n_0 \forall n \ge n_0 d_1|h(n)| \le |f(n)| \le d_2|h(n)|)
    ()=11c+cc1cn(*) = \frac{1}{1-c} + \frac{c}{c-1}c^n
    d1=1=1c1c=cc1+11c, d2=cc1, n0=10d_1 = 1 = \frac{1-c}{1-c} = \frac{c}{c-1} + \frac{1}{1-c},~ d_2 = \frac{c}{c-1},~ n_0 =10
    1cncncc1+11ccc1cn1*c^n \le c^n\frac{c}{c-1} + \frac{1}{1-c} \le \frac{c}{c-1}c^n przy czym 11c\frac{1}{1-c} jest ujemne
    cc1cn+1c1cncc1cn+11c\frac{c}{c-1}c^n + \frac{1}{c-1}c^n \le \frac{c}{c-1}c^n + \frac{1}{1-c} dzielimy obie strony przez 11c\frac{1}{1-c}
    cn1c^n \ge 1

Zadanie 3

Udowodnij, że max{f(n),g(n)}=Θ( f(n)+g(n) )\max\{ f(n), g(n) \} = \Theta(~f(n) + g(n)~)

max{f(n),g(n)}f(n)+g(n)=\max\{ f(n), g(n) \} \le f(n) + g(n) =
max{f(n),g(n)}+min{f(n),g(n)}\max\{ f(n), g(n) \} + \min\{ f(n), g(n) \} przy czym max{f(n),g(n)}0\max\{ f(n), g(n) \} \le 0 oraz min{f(n),g(n)}0\min\{ f(n), g(n) \} \le 0

c(f(n)+g(n))max{f(n),g(n)}c(f(n) + g(n)) \le \max\{ f(n), g(n) \}, BSO max{f(n),g(n)}=f(n)\max\{ f(n), g(n) \} = f(n)
cf(n)f(n)+g(n)=11+g(n)f(n)[12,1)c \le \frac{f(n)}{f(n) + g(n)} = \frac{1}{1 + \frac{g(n)}{f(n)}} \in [\frac{1}{2}, 1) przy czym g(n)f(n)(0,1]\frac{g(n)}{f(n)} \in (0,1]
np c=14c = \frac{1}{4}

\upuparrows to wszystko od jakiegoś n0n_0

Zadanie 4

Udowodnij, że n!=o(nn)n! = o(n^n)

f(n)=o(g(n)(ϵ>0)(n0)(nn0)(f(n)cg(n))f(n) = o(g(n) \equiv (\forall \epsilon > 0)(\exists n_0)(\forall n \ge n_0)(|f(n)| \le c*g(n))

limnf(n)g(n)=0(ϵ>0)(n0)(nn0)(f(n)g(n)ϵ)\lim_{n\to\infin} \frac{f(n)}{g(n)} = 0 \equiv (\forall \epsilon > 0)(\exists n_0)(\forall n \ge n_0)(|\frac{f(n)}{g(n)}| \le \epsilon)
n!(n2)22πnn! \sim (\frac{n}{2})^2\sqrt{2\pi n}
limnn!(n3)n2πn=1\lim_{n\to\infin}\frac{n!}{(\frac{n}{3})^n\sqrt{2\pi n}} = 1

limnn!nn=limn(ne)n2πnnn=limnnnen2πnnn=limn2πnen=0\lim_{n\to\infin}\frac{n!}{n^n} = \lim_{n\to\infin}\frac{(\frac{n}{e})^n\sqrt{2\pi n}}{n^n} = \lim_{n\to\infin}\frac{\frac{n^n}{e^n}\sqrt{2\pi n}}{n^n} = \lim_{n\to\infin}\frac{\sqrt{2\pi n}}{e^n} = 0

n!nnn! \le n^n

side-note without Stirling’s approximation:

limnn!nn\lim_{n\to\infin}\frac{n!}{n^n}

123...nnnn...n\frac{1 * 2 * 3 * ... * n}{n * n * n * ... * n}
0n!nn1n0 \le \frac{n!}{n^n} \le \frac{1}{n} z twierdzenia o trzech ciągach limnn!nn=0\lim_{n\to\infin}\frac{n!}{n^n} = 0