I could not understand the complexity of this series. N/1+N/2+N/3+N/4+.....+N/N.
cAN ANYONE EXPLAIN ME? tHANKS.
| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | Kevin114514 | 3659 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3312 |
| 10 | idontwannadothis…e | 3191 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 154 |
| 2 | nik_exists | 151 |
| 3 | maspy | 149 |
| 4 | AmShZ | 146 |
| 5 | Um_nik | 143 |
| 6 | Errichto | 139 |
| 7 | BledDest | 136 |
| 8 | adamant | 135 |
| 9 | maroonrk | 133 |
| 10 | cry | 130 |
I could not understand the complexity of this series. N/1+N/2+N/3+N/4+.....+N/N.
cAN ANYONE EXPLAIN ME? tHANKS.
| Название |
|---|



given series : N(1 + 1/2 + 1/3 + ... + 1/N) converges to N(log(N)). https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)
There is no such notion as "Sequence A converges to sequence B", especially if they both diverge. What converges is their ratio and it converges to 1.
Take n common, expression becomes : n * (1 + 1 / 2 + ... + 1/ n)
The expression (1 + 1 / 2 + 1 / 3 + ... 1 / n) is harmonic sum and it's bounded by ln(n). Hence overall complexity is O(n * logn).
Proof: Let us integrate 1 / x from 1 to n. (Note that we are doing integration, which means sum of area under the curve 1/x, which is greater than (1 + 1 / 2 + ... + 1 / n). Integration of 1/x dx is ln(x).