# A Uniformly Distributed Sequence

# A Uniformly Distributed Sequence

### The theorem is true for every increasing sequence of integers, but the exceptional set of xs may be different for each integer sequence.

Join the DZone community and get the full member experience.

Join For FreeThe open source HPCC Systems platform is a proven, easy to use solution for managing data at scale. Visit our Easy Guide to learn more about this completely free platform, test drive some code in the online Playground, and get started today.

If you take the fractional parts of a set of numbers **{ cos nx : integer n > 0}**, the result is uniformly distributed for almost all

**. That is, in the limit, the number of times the sequence visits a subinterval of**

*x***[0, 1]**is proportional to the length of the interval. (Clearly it's not true for all

**: take**

*x***, for instance. Or any rational number times**

*x*= 0**π**.)

The proof requires some delicate work with Fourier analysis that I'll not repeat here. If you're interested in the proof, see Theorem 4.4 of Uniform Distribution of Sequences.

This is a surprising result. Why should such a strange sequence be uniformly distributed? Let's look at a histogram to see whether the theorem is plausible.

OK. Looks plausible.

But there's a generalization that's even more surprising. Let ** a** be any increasing sequence of integers. Then the fractional parts of

*a***cos**

**are uniformly distributed for almost all**

*ax***.**

*x*Any increasing sequence of integers? Like the prime numbers, for example? Apparently so. The result produces a very similar histogram.

But this can't hold for just any sequence. Surely, you could pick an integer sequence to thwart the theorem. Pick an ** x**, then let

**be the subset of the integers for which**

*a***. Then**

*n*cos*nx*< 0.5**isn't uniformly distributed because it never visits the right half the unit interval!**

*a*cos*ax*Where's the contradiction? The theorem doesn't start by saying "For almost all ** x**..." It starts by saying "For any increasing sequence

**..." — that is, you don't get to pick**

*a***first. You pick the sequence first, then you get a statement that is true for almost all**

*x***. The theorem is true for every increasing sequence of integers, but the exceptional set of**

*x***s may be different for each integer sequence.**

*x*Managing data at scale doesn’t have to be hard. Find out how the completely free, open source HPCC Systems platform makes it easier to update, easier to program, easier to integrate data, and easier to manage clusters. Download and get started today.

Published at DZone with permission of John Cook , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

## {{ parent.title || parent.header.title}}

## {{ parent.tldr }}

## {{ parent.linkDescription }}

{{ parent.urlSource.name }}