Ordering: Difference between revisions

Line 29: Line 29:


We first derive the function from <math>(x,y) \in \mathbb{Z}^2</math> to <math>z \in \mathbb{Z}</math> as shown in Figure 2.
We first derive the function from <math>(x,y) \in \mathbb{Z}^2</math> to <math>z \in \mathbb{Z}</math> as shown in Figure 2.
Let <math>(x,y)</math> be the coordinates in <math>\{(0,0), (1, 0), (1,1), ...\}</math> which will map to <math>\({0, 1, 2, ...\}</math>.   
Let <math>(x,y)</math> be the coordinates in <math>\{(0,0), (1, 0), (1,1), ...\}</math> which will map to <math>\{0, 1, 2, ...\}</math>.   
First note that <math>\sum_{0}^{k}i = \frac{(k)(k+1)}{2}</math>.
First note that <math>\sum_{0}^{k}i = \frac{(k)(k+1)}{2}</math>.
Thus the number of elements in columns <math>0, ..., x-1</math> is <math>(x)(x+1)/2</math>.   
Thus the number of elements in columns <math>0, ..., x-1</math> is <math>(x)(x+1)/2</math>.