CLRS Chapter 3
ビール飲んできた。うまかった。
Introduction to Algorithms / アルゴリズムイントロダクション
Theta,Big-O,Omega表記の定義、floor,ceiling,...などの表記の定義
Exercise 3.1-1
とすればよい
Exercise 3.1-2
とすればよい
Exercise 3.1-3
だから
Exercise 3.1-4
なので真
なので偽
Exercise 3.1-5
逆はそれぞれのn0のmaxを取ればよい。
Exercise 3.1-6
不等号の遷移律を使用するだけ
Exercise 3.1-7
f(n)/g(n)のlimの先が0とInfになることから矛盾を導く
Exercise 3.1-8
Omegaは、cg(n,m)とf(n,m)をひっくり返して定義
Thetaは、Omega かつ Big-Oで定義
Exercise 3.2-1
略
Exercise 3.2-2
Exercise 3.2-3
Stirlingの近似でちょめちょめ
Exercise 3.2-4
ceil(lg n)! : おさえられない。簡単のため、n = 2^mの時を考えると、ceil(lg n)!はStirlingの近似より(m/e)^(m/e)以上になる。これはC^mではおさえられない
ceil(lg lg n)! : おさえられる。簡単のため、n=2^2^mの時を考えると、ceil(lg lg n)!はStirlingの近似より、O(m^(m+1))。これはC^2^mでおさえられる。(なぜなら両辺のlogをとれば、左:mlog(m),右:2^mとなるので)
Exercise 3.2-5
なので、lg*(lg n)のほうが漸近的に大きい。
Exercise 3.2-6
計算するだけ
Exercise 3.2-7
するだけ
Exercise 3.2-8
定数倍を無視して十分大きいnについて
Problem 3-1
略
Problem 3-2
yes | yes | no | no | no | ||
yes | yes | no | no | no | ||
no | no | no | no | no | ||
no | no | yes | yes | no | ||
yes | no | yes | no | yes | ||
yes | no | yes | no | yes |
Problem 3-3
a
一時間くらいかかった
b
Problem 3-4
a
b
が反例
c
正しい
d
No
e
asymptotically positiveの定義による。f(n)にある部分列が存在してAn->inf かつ f(An) -> 0になってよいならば偽だと思う。そうでないならば真。
f
正しい
g
f = 2^x
h
正しい
Problem 3-5
a
f(n) != O(g(n))のとき、全てのc,n0について、あるnが存在してn>n0かつf(n) >= cg(n) >= 0となる。
c = 1, A0 = 1とする。An = 「c,An-1を上の命題に適用して得られたn」とおくことで、無限個のf(n) >= cg(n) >= 0を満たすnが{An}として得られる。
b
利点:OかOmegaInfかのどちらかは必ず成立する
欠点:対称的でない。比が収束しない。
c
if方向は、f(n)がasymptotically nonnegativeである条件を付け加える必要がうまれる
only if方向は、変わらない
d
SoftOmegaは
とする
SoftThetaは
とする。
Thm3.1の証明略
3-6
a | ceil(n) |
b | tightにしようとすると難しい |
c | |
e | |
f | |
h | tightにしようとすると難しい |