Tutorials › Statistical Theory I - Probability and Distribution Theory › A Typewriter Sequence: Probability Without Almost-Sure Convergence

Modes of Convergence · Tutorial 808 of 994

A Typewriter Sequence: Probability Without Almost-Sure Convergence

Construct and analyze a sequence of shrinking-interval indicators that converges in probability but fails to converge almost surely.

Advanced 9 min read

What You'll Learn

  • Define the dyadic interval indicators and their sequence indexing on the unit interval.
  • Calculate the distribution and probability of each indicator.
  • Prove convergence in probability to zero using the epsilon-event definition.
  • Show that every sample path contains infinitely many zeros and ones.
  • Explain why the construction does not contradict the implication from almost-sure convergence to convergence in probability.
  • Extend the construction to partitions with an increasing number of equal cells.

A Sequence That Sweeps Across the Unit Interval

Convergence in probability describes how often a random variable differs from its target, while almost-sure convergence asks what happens along individual sample paths. These notions need not agree in the reverse direction: convergence in probability does not, in general, force almost-sure convergence. A vivid example is the typewriter sequence, whose indicator functions sweep across the unit interval in progressively smaller pieces.

At each stage, exactly one small interval is active at any given point. The intervals shrink, so the probability of an active value tends to zero. But as the sequence continues, the sweep revisits every point infinitely many times. Thus, on each sample path, the values keep switching between zero and one.

Definition of the Typewriter Sequence

Use the probability space \(([0,1],\mathcal{B},\lambda)\), where \(\mathcal{B}\) is the Borel sigma-algebra and \(\lambda\) is Lebesgue measure on \([0,1]\). At level \(m=0,1,2,\ldots\), partition the unit interval into \(2^m\) dyadic cells. For \(k=0,\ldots,2^m-1\), define

$$ I_{m,k} = \begin{cases} [k2^{-m},(k+1)2^{-m}), & 0 \leq k < 2^m-1,\\ [(2^m-1)2^{-m},1], & k=2^m-1. \end{cases} $$

The last cell includes the endpoint \(1\); this convention makes the cells a partition of all of \([0,1]\), including the endpoints. The cells are disjoint and each has length \(2^{-m}\). Define \(X_n\) by listing all cell indicators at level zero, then all indicators at level one, then all indicators at level two, and so on. Explicitly, the index corresponding to \((m,k)\) is \(n=2^m+k\).

Definition: The typewriter sequence is the sequence of random variables \(X_n=\mathbf{1}_{I_{m,k}}\) when \(n=2^m+k\), for \(m=0,1,2,\ldots\) and \(k=0,\ldots,2^m-1\). Here \(\mathbf{1}_{I_{m,k}}(x)=1\) if \(x\in I_{m,k}\), and \(0\) otherwise. Level \(m\) occupies indices \(2^m,\ldots,2^{m+1}-1\).

Each \(X_n\) is measurable because its set of points with value one is a Borel interval. At level \(m\), the sequence consists of the indicators of every cell in that level's partition. The indexing matters: the number of indicators per level doubles, so later levels occur at later sequence indices.

Worked Example: Writing the First Levels

At level \(m=0\), there is just \(I_{0,0}=[0,1]\), so \(X_1=\mathbf{1}_{[0,1]}\). At level \(m=1\), the cells are \([0,1/2)\) and \([1/2,1]\), so

$$ X_2=\mathbf{1}_{[0,1/2)}, \qquad X_3=\mathbf{1}_{[1/2,1]}. $$

At level \(m=2\), the four cells are \([0,1/4)\), \([1/4,1/2)\), \([1/2,3/4)\), and \([3/4,1]\). Their indices are \(4,5,6,7\), respectively. For example, \(X_6=\mathbf{1}_{[1/2,3/4)}\). The level occupies four consecutive indices, as predicted by \(2^m=4\) through \(2^{m+1}-1=7\).

Convergence in Probability

For each index \(n=2^m+k\), the random variable \(X_n\) is Bernoulli with success probability equal to the length of its cell. Consequently, its distribution and expectation are

$$ P(X_n=1)=2^{-m}, \qquad P(X_n=0)=1-2^{-m}, \qquad E[X_n]=2^{-m}. $$

As \(n\) increases, its level \(m\) increases without bound, and the probability of the value one therefore shrinks. To verify convergence in probability to zero, it is essential to check the probability of deviating from zero by any fixed positive tolerance, not merely to observe that the expectations decrease.

Theorem: For the typewriter sequence, \(X_n\xrightarrow{p}0\). That is, for every \(\varepsilon>0\), \(P(|X_n|>\varepsilon)\to 0\) as \(n\to\infty\).

Proof. Fix \(\varepsilon>0\). Since \(X_n\) takes only the values zero and one, if \(0<\varepsilon<1\), then \(\{|X_n|>\varepsilon\}=\{X_n=1\}=I_{m,k}\) whenever \(n=2^m+k\). Thus

$$ P(|X_n|>\varepsilon)=2^{-m}, \qquad 0<\varepsilon<1. $$

If \(\varepsilon\geq 1\), the event \(\{|X_n|>\varepsilon\}\) is empty, so its probability is zero. For any \(n\) in level \(m\), \(n\geq 2^m\). Hence \(n\to\infty\) forces \(m\to\infty\), and therefore \(2^{-m}\to0\). The deviation probability tends to zero for every fixed positive \(\varepsilon\), proving \(X_n\xrightarrow{p}0\). \(\square\)

Worked Example: Checking a Fixed Tolerance

Take \(\varepsilon=0.2\). Since \(X_n\) is either zero or one, \(|X_n|>0.2\) precisely when \(X_n=1\). At level \(m=3\), each of the eight cells has probability \(1/8=0.125\), so for every index \(n=8,\ldots,15\),

$$ P(|X_n|>0.2)=\frac18=0.125. $$

At level \(m=4\), each cell has probability \(1/16=0.0625\), so for \(n=16,\ldots,31\), the same deviation probability is \(0.0625\). At level \(m\), it is \(2^{-m}\). These values tend to zero, even though at every level some cell is active at every point of the sample space.

Every Sample Path Fails to Converge

To analyze almost-sure convergence, fix a point \(x\in[0,1]\) and inspect the numerical sequence \(X_1(x),X_2(x),\ldots\). At every level \(m\), the cells form a partition, so \(x\) belongs to exactly one of them. The indicator for that cell equals one at \(x\), while the indicators for all other cells at that level equal zero.

Theorem: For every \(x\in[0,1]\), the sample path \(X_1(x),X_2(x),\ldots\) does not converge. Consequently, \(X_n\) does not converge almost surely to zero.

Proof. At each level \(m\), let \(k_m(x)\) be the unique cell index such that \(x\in I_{m,k_m(x)}\). Then \(X_{2^m+k_m(x)}(x)=1\). These indices belong to distinct level blocks, so they form an unbounded sequence of indices. Thus the sample path equals one infinitely often.

For every \(m\geq1\), there are at least two cells at level \(m\). Choose a cell at that level different from the one containing \(x\); its indicator equals zero at \(x\). Choosing one such indicator at each level gives an unbounded sequence of indices along which the sample path equals zero. The path therefore has infinitely many zeros and infinitely many ones. A real sequence with these two properties cannot converge: if it had a limit, the subsequence of ones would force that limit to be one, while the subsequence of zeros would force it to be zero. This contradiction proves nonconvergence for every \(x\). The set of paths converging to zero is empty and has probability zero, so almost-sure convergence fails. \(\square\)

Worked Example: Following the Path at \(x=5/8\)

At level \(m=0\), the only cell contains \(5/8\), so \(X_1(5/8)=1\). At level \(m=1\), the point lies in \([1/2,1]\), which has index \(3\), so \(X_3(5/8)=1\). At level \(m=2\), it lies in \([1/2,3/4)\), giving \(X_6(5/8)=1\). At level \(m=3\), it lies in \([5/8,3/4)\), giving \(X_{13}(5/8)=1\). These are not isolated coincidences: the unique cell containing \(5/8\) at each successive level supplies another value of one.

There are zeros just as regularly. For every \(m\geq2\), the first cell is \([0,2^{-m})\), which does not contain \(5/8\). Its indicator, at index \(2^m\), is zero at this point. The path therefore has ones at indices \(1,3,6,13,\ldots\) and zeros at indices \(4,8,16,\ldots\), among infinitely many other zeros. It cannot converge.

A Related Partition Construction

The essential feature is not the use of powers of two. It is that each stage partitions the space into many small cells, and the sequence lists all cell indicators in a stage before moving to the next. The following variation illustrates this principle using a different number of cells per stage.

Worked Example: Stages With \(m+1\) Equal Cells

For \(m=1,2,\ldots\), partition \([0,1]\) into \(m+1\) equal cells, using half-open cells except for the last, which includes \(1\). List the indicators of all cells at stage \(m\), then continue to stage \(m+1\). The total number of indicators before stage \(m\) is

$$ s_m=\sum_{j=1}^{m-1}(j+1)=\frac{(m-1)(m+2)}{2}. $$

Thus the cell with position \(k\), where \(k=0,\ldots,m\), has sequence index \(s_m+k+1\) and probability \(1/(m+1)\). If \(0<\varepsilon<1\), its probability of exceeding \(\varepsilon\) in absolute value is also \(1/(m+1)\), which tends to zero as the stage number increases. Because every point lies in exactly one cell per stage, each sample path has a value of one at every stage. From stage \(m\geq1\) onward there are also other cells, whose indicators are zero at that point. So this variation also converges in probability to zero while failing to converge along every path.

Why the Example Matters

The typewriter sequence makes the difference between the two modes of convergence concrete. Convergence in probability controls the chance of a deviation at a given index: at a late index, the active cell has small measure. Almost-sure convergence instead asks whether, for almost every fixed \(x\), the numerical values eventually settle down. In this construction, each individual cell is small, but the sequence keeps sweeping over the whole interval, ensuring that each point is revisited.

There is no contradiction with the implication that almost-sure convergence implies convergence in probability. The example shows the reverse implication can fail; it does not challenge the forward one. In particular, knowing that \(P(X_n\neq0)\to0\) does not establish that, for almost every \(x\), only finitely many of the values \(X_n(x)\) are nonzero. The typewriter sequence has the first property and violates the second at every point.

  • Pitfall: “The active interval shrinks to length zero, so for almost every point the sequence must eventually be zero.” This reasoning considers the shrinking size of a single interval but ignores that the interval changes location repeatedly.
  • Correction: Check the full sequence of sets. At each level, the intervals cover all of \([0,1]\), so every point belongs to an active interval once per level. The probabilities shrink, but the values along each path do not settle.
Key takeaway: Small deviation probabilities at each index do not, by themselves, rule out infinitely many deviations along a sample path. In the typewriter construction, \(X_n\xrightarrow{p}0\), yet every sample path contains infinitely many zeros and ones.

Check Your Understanding

Try these questions using the construction and arguments above.

  1. Which indices belong to level \(m=4\), and what is \(P(X_n=1)\) for any index in that level?
  2. For a fixed \(\varepsilon\) with \(0<\varepsilon<1\), why does \(P(|X_n|>\varepsilon)\) tend to zero?
  3. Why does every point \(x\in[0,1]\) have \(X_n(x)=1\) at infinitely many indices?
  4. What feature of the level partitions guarantees infinitely many zeros along each path?
  5. Explain why the example does not contradict the result that almost-sure convergence implies convergence in probability.