diff options
| author | mo khan <mo@mokhan.ca> | 2021-11-07 15:25:07 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2021-11-07 15:25:07 -0700 |
| commit | 1af2c5f253f426327f61c819ea576b6c70adc940 (patch) | |
| tree | 994968849a7f9d4fd409b513213627463c6a1dcb /0x01/README.md | |
| parent | 9c2288f84e1a0811e26ee6f954a4d16d8c03ba3c (diff) | |
Solve another one
Diffstat (limited to '0x01/README.md')
| -rw-r--r-- | 0x01/README.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/0x01/README.md b/0x01/README.md index c0daa8a..38bed54 100644 --- a/0x01/README.md +++ b/0x01/README.md @@ -295,6 +295,19 @@ properties. e. If `k < d`, then `p(n) = w(n^k)`. + To provie this we need the little-omega formula which says: + The function `f(n) = w(g(n))` for any positive constant `c > 0`, + if there exists a constant `n0 > 0` + such that `0 <= c * g(n) < f(n)` for all `n >= n0` + + We can try to fit the function into this formula. + `0 <= c * g(n) < f(n)` + `0 <= c * (ak * n^k) < f(n)`. + Since `k` is less than `d` we can also say + `0 <= c * (ak * n^k) < c * (ad * n^d) < f(n)`. + This is enough to satisfy the constraints of the formula so that we can + claim that `p(n) = w(n^k)` because any constant c greater than 0 will work. + 1. Exercise 4.1-2 from the textbook (10 marks) What does `FIND-MAXIMUM-SUBARRAY` return when all elements of `A` are negative? |
