Classic Iterated Function Systems

Larry Riddle, Agnes Scott College

Sierpinski Carpet Membership Calculator

We consider the initial square in the construction of the Sierpinski carpet to be \([0,1]\times[0,1]\) in the \(xy\)-plane. Each point in the unit square can be represented by a pair of base-3 (ternary) expansions of the form

$$\begin{array}{l} x = (0.{x_1}{x_2}{x_3}{x_4} \ldots)_{\small 3} = \displaystyle \sum_{k=1}^\infty\frac{x_k}{3^k} \\ y = (0.{y_1}{y_2}{y_3}{y_4} \ldots)_{\small 3} = \displaystyle \sum_{k=1}^\infty\frac{y_k}{3^k} \\ \end{array}$$

where each digit is either 0,1, or 2. Rational numbers of the form \(k/3^n\) actually have two ternary expansions, one that terminates in repeated 0's, and one that terminates in repeated 2's. For example, 4/9 is represented in ternary either as \(0.11\overline{0}_{\small 3}\) or as \(0.10\overline{2}_{\small 3}\). (All rational numbers between 0 and 1 have a ternary expansion that must eventually repeat. [Rational Details])

The Sierpinski carpet is the set of all pairs \((x,y)\) that have a ternary expansion in which at least one of the corresponding ternary digits of \(x\) and \(y\) in each position is not equal to 1 [Ternary Details], that is,

$$SC = \left\{ {(x,y) {\text{ in }} [0,1] \times [0,1]: ({x_k},{y_k}) \ne (1,1) {\text{ for all }} k} \right\}$$

A point \((x,y)\) will be removed at the \(k\)th iteration in the construction of the carpet if \(k\) is the smallest index for which the ternary digits in the expansion satisfy \(x_k=1\) and \(y_k=1\).

Calculator:
Rational → Ternary

The rational to ternary calculator will take two rational numbers in the interval \([0,1]\) and computer their ternary expansion. It will show the expansion of each component in terms of the repeating cycle as shown inside square brackets [...]. For example, the ternary expansion \(0.12\overline{201}_{\small 3}\) for 149/234 would be shown as \(0.12[201]\). When a rational number has two ternary extensions, the calculator will use the one that terminates in repeating 2's to check for Sierpinski carpet membership. It will also write out the beginning sequence of each expansion to compare the corresponding ternary digits of \(x\) and \(y\) in each position. If the point is not in the Sierpinski carpet, the numerical bounds of the removed subsquare containing the point will be given.

Enter the coordinates of the point \((x,y)\) as rational numbers, then click the Convert button.



Output

Calculator:
Ternary → Rational

The ternary to rational calculator will convert a pair of ternary expressions that either terminate or have a repeating cycle to the point with the corresponding rational numbers. If the point is not in the Sierpinski carpet, the numerical bounds of the removed subsquare containing the point will be given. For rational points that have two ternary expansions, the calculator may switch to the alternative expansion to check for Sierpinski carpet membership.

Enter ternary expansions for \(x\) and \(y\) in the form 0.<prefix>[<cycle>] or 0.<prefix>. For example, the ternary expansion \(0.220\overline{101}_{\small 3}\) would be entered as \(0.220[101]\).



Output