# Average value of the Fractional Part of a $C^{k}$-function

The mean value of the fractional part $\{ x \}$ on $\mathbb{R}_+$ is clearly $\tfrac{1}{2}$. I'd like to know if a similar statement holds for $\{ f(x) \}$ where $f \colon X \to \mathbb{R}_{+}$ is a non-negative $C^{k}(X)$ function for some $k \geq 0$ and assumes all values of an infinite continuum subset of $\mathbb{R}$ at least once. For example, if $f(x) = x + 1$, then the average value on $[-1,\infty)$ remains at $\frac{1}{2}$. Does the same value hold if $f(x) = \log_{b} x$ for some base $b > 0$ on $[b,\infty)$? Is the result always $\frac{1}{2}$?

This Mathematica code may be useful:

Plot[Mean[Table[FractionalPart[Log[2, x]], {x, 2, y, 0.01}]], {y, 2, 1000}]

Clarification (and edits), examples, counterexamples and references are welcome! Thanks.

Edit: The nice constructions and counter-examples given below imply that further conditions are needed to ensure the mean value is exactly $\frac{1}{2}$. What are they?

-
Can you clarify what conditions you require on the set $X$? You seem to use it both for your domain and as a subset of your codomain? – Willie Wong Jan 14 '11 at 21:53
How do you define average value on $[a,\infty)$? Is is $\lim_{b\to\infty}\frac{1}{b-a}\int_a^b\{f(x)\}dx$? – Jonas Meyer Jan 14 '11 at 21:53
When it is defined, yes. – user02138 Jan 14 '11 at 21:56

Consider the standard construction of the bump function: let $\phi$ be a $C^\infty$ function with the property that $0 \leq \phi \leq 1$, $\phi = 0$ on the negative real axis, and $\phi(x) = 1$ on $[1,\infty)$.

Let $\phi_\epsilon(x) = \phi(x/\epsilon)$ the scaling of $\phi$. For each $\epsilon < 1$, define the smoothed step-function

$$\Psi(x;\epsilon) = \lfloor x\rfloor + \phi_\epsilon(\{x\})$$

It is pretty clear that the average of fractional part of $\Psi$ can be made, by construction, as close to 0 as you want. Indeed, the average of $\{\Psi\}$ over $[N,M]$ where $N,M\in\mathbb{Z}$ is the same as its average over $[0,1]$ by periodicity, and by construction $\{\Psi(x,\epsilon)\}$ vanishes for $x\in(\epsilon,1]$ and is bounded by 1 for $x\in[0,\epsilon]$, so we have that the average of the fractional part of $\Psi(x;\epsilon)$ must be bounded above by $\epsilon$.

(In fact, using this construction you can, for any $y \in (0,1)$, make a function $F$ such that $F$ is monotonically increasing, smooth, defined on $\mathbb{R}$, such that the "mean" of the fractional part of $F$ over $\mathbb{R}$ converges to the desired $y$.)

-

Another counterexample is in fact $\log_b x$. Because $\log_b bx = 1 + \log_b x$, the mean of $\{\log_b x\}$ over $\mathbb R_+$ is the same as the mean of $\log_b x$ over $[1,b]$. If you look at the shape of the log function, it's pretty clear that the mean is larger than 1/2.

When $b = 10$, a related phenomenon gives rise to Benford's law.

-

Look up Weyl's equidistribution theorem. Weyl's general method is to compute the Fourier transform to get the distribution of the fractional part, using the fact that $\exp(2\pi i t) = \exp(2\pi i \{t\})$.

-