Sierpinski Right Triangle Calculators
Rather than starting with an equilateral triangle, we start with a right triangle with two sides of length 1. The rest of the construction proceeds as before. Remove the triangle formed by the midpoints of the three sides. In each of the remaining three right triangles, remove the triangle formed by the midpoints of the three sides. Continue indefinitely. The resulting limit is sometimes referred to as the Sierpinski right triangle.
We position the initial triangle in the first quadrant so that two sides of unit length lie along the x-axis and y-axis. This means the Sierpinski right triangle lives in the unit square \(0 \le x \le 1\), \(0 \le y \le 1\) with \(x+y \le 1\).
Each point in the unit square can be represented by a pair of binary numbers of the form
\[\begin{array}{l} x =(0.{x_1}{x_2}{x_3}{x_4}\text{...}){}_{\small 2} = \displaystyle \sum_{k=1}^\infty\frac{x_k}{2^k} \\ y = (0.{y_1}{y_2}{y_3}{y_4}\text{...}){}_{\small 2} =\displaystyle \sum_{k=1}^\infty\frac{y_k}{2^k} \\ \end{array}\]
where each digit is either 0 or 1. Dyadic rational numbers of the form \(k/2^n\) actually have two binary expansions, one that terminates in repeated 0's, and one that terminates in repeated 1's [ Dyadic Details]. For example, 3/4 is represented in binary either as \(0.110000\ldots{}_{\small 2}\) or as \(0.101111\ldots{}_{\small 2}\).
The Sierpinski right triangle is the set of all pairs \((x,y)\) such that for each position in the binary expansion, at least one of the corresponding binary digits of \(x\) and \(y\) in that position is 0, that is,
$$S = \left\{ {(x,y) {\text{ in }} [0,1] \times [0,1]:({x_k},{y_k}) \ne (1,1) {\text{ for all }} k} \right\}$$
If either \(x\) or \(y\) is a dyadic rational, then the point will be in \(S\) if either of the binary expansions satisfies the condition in the definition of the set. [Binary Details]
Calculator:
Rational → Binary
The rational to binary calculator will take two rational numbers in the interval \([0,1]\) and compute their binary expansion. It will show the expansion of each component in terms of the repeating cycle as shown inside square brackets [...]. For example, the binary expansion \(0.11\overline{101}_{\small 2}\) for 13/14 would be shown as \(0.11[101]\). When a dyadic rational number has two binary extensions, the calculator will use both to check for Sierpinski triangle membership. It will also write out the beginning sequence of each expansion to compare the corresponding binary digits of \(x\) and \(y\) in each position.
Enter the coordinates of the point \((x,y)\) as rational numbers, then click the Convert button.
Output
Calculator:
Binary → Rational
The binary to rational calculator will convert a pair of binary expressions that either terminate or have a repeating cycle to the point with the corresponding rational numbers. For dyadic rationals that have two binary expansions, the calculator will use the alternative expansions if necessary to check for Sierpinski right triangle membership.
Enter binary expansions for \(x\) and \(y\) in the form 0.<prefix>[<cycle>] or 0.<prefix>. For example, the binary expansion \(0.110\overline{101}_{\small 2}\) would be entered as \(0.110[101]\).
Output
Plotter
The figure below shows the 5th iteration in the construction of the Sierpinski right triangle with vertices (0,0), (1,0), and (0,1). Enter the coordinates of a point in the boxes below, either in rational or decimal form, then click on the button to plot the point. If the red dot is in one of the white triangles removed during the first 5 iterations, then the point is not in the Sierpinski right triangle. A red dot in a gray area is in $S_5$, but may possibly be removed at a later iteration. You can you can use the calculators above to check membership status.
