3

I wish to verify that Harmonic numbers $H_n = \sum_{k=1}^{n} \frac{1}{k}$ are $\Theta(\log n)$.

One idea I have is to approximate the sum with an integral:

$$\int_{1}^{n} \frac{1}{k} ~dk = \log(n) - \log(1) = \log(n)$$

But I don't know if this is valid and I want a more direct proof.

In other words I want to show that:

$$\sum_{k=1}^{n} \frac{1}{k} \leq c \log n$$

and

$$\sum_{k=1}^{n} \frac{1}{k} \geq d \log n$$

For some $n \geq n_0$ and positive reals $c,d$. Is there an intuitive way to do this that doesn't rely on weird calculus tricks? I see derivations in the post here:

Simple proof of showing the Harmonic number $H_n = \Theta (\log n)$

but none of these seem intuitive to me (they rely on higher calculus and series tests and Riemann sums).

Nakano
  • 655
  • 2
    Of course the integral comparison is valid, once you fill in the details. Did you have a look at vonbrand's answer in the post you linked to? http://math.stackexchange.com/a/306674/30402 – Erick Wong Feb 11 '16 at 20:11
  • @ErickWong Yes, but I don't understand how it's a proof – Nakano Feb 11 '16 at 20:16
  • I don't understand how it's not a proof. It's a straightforward application of the fact that if $f(x) \ge g(x)$ on some interval $[a,b]$ then $\int_a^b f(x) dx \ge \int_a^b g(x) dx$. There are details that need to be filled in but you asked whether it was valid, not whether it was fully worked out in detail. – Erick Wong Feb 11 '16 at 20:25
  • @ErickWong I'll phrase another way: Given that $\int_a^b f(x) dx \ge \int_a^b g(x) dx$, so what? How does this show that $H_n$ is $\log n$? – Nakano Feb 11 '16 at 20:29
  • @Nakano This is the first property used in the answer I gave. $f(n) \geq f(x) \geq f(n+1)$ for any $x\in[n,n+1]$ implies $1\cdot f(n) = \int_n^{n+1} f(n)dx\geq \int_n^{n+1} f(x) dx \geq \int_n^{n+1} f(n+1)dx = 1\cdot f(n+1)$.) – Clement C. Feb 11 '16 at 20:33
  • @Nakano $H_n$ is precisely the integral of the stepwise-constant function depicted in vonbrand's answer. Call this function $f(x)$. Now note that $f(x) \ge 1/x$ and integrate. To get an upper bound use a similar idea but you might need to pull off the first term to avoid the singularity at $0$. – Erick Wong Feb 11 '16 at 20:33

4 Answers4

5

You can show that as $n \to \infty$ we have the asymptotic behavior

$$H_n \sim \log n,$$

directly as a limit of a sequence.

By the Stolz-Cesaro theorem (L'Hospital's rule for sequences)

$$\lim_{n \to \infty} \frac{H_n}{\log n} = \lim_{n \to \infty} \frac{H_{n+1}- H_n}{\log (n+1) - \log n} \\ = \lim_{n \to \infty}\frac{1/(n+1)}{\log(1 + 1/n)} \\ = \lim_{n \to \infty}\frac{1}{\log(1 + 1/n)^{n+1}} \\ = \frac{1}{\log e} \\ = 1.$$

RRL
  • 90,707
  • 2
    I like this answer, but not sure why Stolz–Cesàro would not fall under "higher calculus" (or fancy theorems). The proof is simple and short, but the tool (theorem) it uses is not. +1 anyway. – Clement C. Feb 11 '16 at 20:43
4

\begin{align} & \frac 1 2 \le \int_1^2 \frac{dx} x \le 1 \\[8pt] & \frac 1 3 \le \int_2^3 \frac{dx} x \le \frac 1 2 \\[8pt] & \frac 1 4 \le \int_3^4 \frac{dx} x \le \frac 1 3 \\[8pt] & \qquad \qquad \vdots \\[10pt] \text{Hence } & \frac 1 2 + \frac 1 3 + \frac 1 4 + \cdots + \frac 1 {n+1} \le \int_1^{n+1} \frac{dx} x \le 1 + \frac 1 2 + \frac 1 3 + \cdots + \frac 1 n. \end{align} And finally, $$ 1 + \int_1^n \frac{dx} x \ge 1+ \frac 1 2 + \frac 1 3 + \cdots + \frac 1 n \ge \int_1^{n+1} \frac {dx} x, $$ i.e. $$ 1 + \log n \ge H_n \ge \log(n+1). $$

3

Here's a direct approach that avoids calculus to obtain just the weak result of $\Theta(\log n)$ rather than the more precise asymptotic $(1+o(1)) \log n$.

First consider the special case that $n$ is of the form $2^k - 1$, and divide $H_n$ into dyadic blocks:

$$H_n = \big(1\big) + \big(\frac12 + \frac13\big) + \big(\frac14 + \cdots + \frac17\big) + \cdots + \big(\frac{1}{2^{k-1}} + \cdots + \frac1{2^k-1}\big),$$ where there are $k$ blocks and each block has twice the number of terms as the previous one. Now the following two inequalities are obvious by term-by-term comparison:

$$H_n \le \big(1\big) + \big(\frac12 + \frac12\big) + \big(\frac14 + \cdots + \frac14\big) + \cdots + \big(\frac{1}{2^{k-1}} + \cdots + \frac1{2^{k-1}}\big) = 1 + 1 + \cdots + 1 = k,$$

$$H_n \ge \big(\frac12\big) + \big(\frac14 + \frac14\big) + \big(\frac18 + \cdots + \frac18\big) + \cdots + \big(\frac{1}{2^k} + \cdots + \frac1{2^k}\big) = \frac12 + \frac12 + \cdots + \frac12 = \frac k2.$$

Therefore, for these special values of $n$, $\frac k2 \le H_n \le k$. Since $k = \log(n+1)/\log 2$, this is clearly $\Theta(\log n)$. This gives the intuition (which your question explicitly asks for), now to fill in the details for arbitrary $n$ you just need to use the fact that $H_n$ is monotonically increasing and that you can always find consecutive powers of $2$ that bracket $n$.

Erick Wong
  • 25,198
  • 3
  • 37
  • 91
1

Your idea of approximation with an integral works. This is a classical exercise: let $f\colon x > 0\mapsto \frac{1}{x}$ (works with any monotone function $f$ such that $\lim_{x\to \infty}f(x) = 0$):

Fix any $n \geq 1$. For all $n \leq x \leq n+1$, $$ f(n+1) \leq f(x) \leq f(n) $$ so that, integrating, $$ f(n+1) = \int_n^{n+1} f(n+1) dx \leq\int_n^{n+1} f(x) dx \leq \int_n^{n+1} f(n) dx = f(n) $$ which holds for any integer $n\geq 1$. Now, sum this inequality for $n$ ranging from $1$ to $N-1$: $$ \sum_{n=1}^{N-1} f(n+1) \leq \sum_{n=1}^{N-1} \int_n^{n+1} f(x) dx \leq \sum_{n=1}^{N-1} f(n) $$ that is exactly (using for the middle term that $\int_a^b f + \int_b^c f = \int_a^c f$): $$ \sum_{n=2}^{N} f(n) \leq \int_1^{N} f(x) dx \leq \sum_{n=1}^{N-1} f(n). $$ Rearranging, $$ \int_1^{N} f(x) dx + f(N) \leq \sum_{n=1}^{N} f(n) \leq f(2) + \int_1^{N} f(x) dx $$ which gives, in our case, $$ \ln N + \frac{1}{N} \leq \sum_{n=1}^{N} f(n) \leq \frac{1}{2} + \ln N $$

Clement C.
  • 67,323
  • What is "$f\colon x > 0\mapsto \frac{1}{x}$"? – Nakano Feb 11 '16 at 20:16
  • 1
    OP asked for "intutive proof", "not relying on higher calculus and series tests and Riemann sums". –  Feb 11 '16 at 20:16
  • @Nakano Just notation for "a function $f$ defined on $(0,\infty)$, by $f(x) = \frac{1}{x}$." – Clement C. Feb 11 '16 at 20:19
  • Also I'm sure this approach is valid but I find all the chained inequalities hard to follow -- I'm not sure what you're doing or why you're doing it, and then I get totally lost when you're summing integrals. To me that is not intuitive. I don't know why you choose bound $n+1$ or where $N-1$ comes from, either. – Nakano Feb 11 '16 at 20:19
  • @vrugtehagel There is no Riemann sum there, no series test... only the fact that $\int_a^b f + \int_b^c f= \int a^c f$, and that if $f\leq g$ then $\int_a^b f \leq \int_a^b g$. – Clement C. Feb 11 '16 at 20:19
  • @ClementC., there's calculus though. I think, but the OP may not agree, that this is not what the OP wanted –  Feb 11 '16 at 20:20
  • Yes. No "higher calculus" -- some (elementary) calculus. See above. – Clement C. Feb 11 '16 at 20:20
  • @Nakano I detailed a bit more one of the chained inequalities. Summing integrals in the middle is relying on the fact that $$ \int_1^2 f + \int_2^3 f = \int_1^3 f $$ and $$ \int_1^3 f + \int_3^4 f = \int_1^4 f $$ and so on. (is that OK with you?) – Clement C. Feb 11 '16 at 20:25
  • 1
    @vrugtehagel If that is the case, then I would find the question quite... puzzling. The OP did state "One idea I have is to approximate the sum with an integral"... which presupposes that integration (and basic properties of integrals, such as the two used here) are not out of the picture. – Clement C. Feb 11 '16 at 20:29
  • Again I still have no idea what you're doing or why you're doing it. You arbitrarily choose lower bound $n$, upper bound $n+1$, then move onto summing this integral without explanation, and then invoke $N-1$ without explaining what this is. – Nakano Feb 11 '16 at 20:34
  • OK,let's break it down. I want to compare $\sum_{n=1}^N f(n)$ to $\ln N = \int_1^N f(x)dx$ (as you said, we want to "approximate the sum with an integral"). To do so, we compare, for any $n$, the quantity $f(n)$ to something: this something is $\int_n^{n+1} f(x)dx$. If we show some nice relation between the two quantities for all $1\leq n \leq N-1$, then we can sum these inequalities to get something nice between $\sum_1^N f(n)$ and $\int_1^N f(x)dx$. – Clement C. Feb 11 '16 at 20:36
  • To compare $f(n)$ to $\int_n^{n+1} f(x) dx$, we use the monotonicity of $f$ as above, and integrate $f(n) \leq f(x) \leq f(n+1)$ for $x \in [n,n+1]$. Now, why did we choose to compare $f(n)$ to $\int_n^{n+1} f(x) dx$ in the first place? Because if we sum $f(n)$ for $n=1..N-1$, we get (almost) our sum, $\sum_{n=1}^N f(n)$; and if we sum $\int_n^{n+1} f(x) dx$ for $n=1..N-1$, we get our integral, $\int_1^N f(x)dx$. – Clement C. Feb 11 '16 at 20:39
  • @Nakano Is that clearer now? (at least, "why do we choose $n$ and $n+1$"?) – Clement C. Feb 11 '16 at 20:53