What is the Cantor Set? How do I write it mathematically? I would like some clarification about the Cantor Set:


*

*What are the elements in the Cantor Set?

*How do I write the Cantor Set in mathematical terms (i.e in a summation)? I have seen online a formula but I do not understand how they got it so would be grateful if you could explain why it is this formula too.


EDIT: The formula I have seen online is:
$$\sum_{i=0}^\infty (a(i)/3^i) $$ where a(i) is either 0 or 2.
 A: The Cantor Set $\mathcal C$ can be defined by the following recursive sequence of sets:
$$\mathcal C_0 = [0, 1]$$
$$\mathcal C_{n+1}= \frac{\mathcal C_n}3\cup\left(\frac23+\frac{C_n}3\right)$$
$$\mathcal C := \bigcap^\infty_{n=0}\mathcal C_n$$
This definition should reflect the intuitive notion of what the Cantor Set is and how it can be constructed.

To explain this further, I will explain the math in laymen's terms.
Start with the closed unit interval, $[0, 1]$.
The next iteration is the previous one divided by three and the previous one divided by three with its origin shifted to be at $\frac23$. This yields $[0, \frac13]\cup[\frac23, 1]$, then $[0, \frac19]\cup[\frac29, \frac13]\cup[\frac23, \frac79]\cup[\frac89, 1]$, etc.
The set itself is the set of points that are present in every iteration of this process.

In case you were wondering how the definition you gave ties into mine (which I find much more intuitive), Here is an explanation:
Observe that as $\mathcal C_n$ is iterated, the edges of each interval ($0, \frac13, \frac23, \frac19, $ etc) remain in the set.
All of these numbers can be expressed by the sum $$\sum^\infty_{n=1}\frac{a_n}{3^n}$$ where the sequence $a$ is all $0$s and $2$s.
For example, $\frac13$ is the sum when $a_n = \langle 0, 2, 2, 2, 2, \cdots\rangle$, or $\frac29+\frac2{27}+\frac2{81}+\cdots$
I'll leave it to you to find the reason for this connection, but a hint is that it has to do with the $\frac23$ being added.
A: The elements of the Cantor set are real numbers between $0,1$.  The set is formed by iteratively and infinitely cutting all intervals in thirds and removing the middle third.


*

*$E_0 = [0,1]$

*$E_1 = [0, \frac 13] \cup [\frac 23, 1]$

*$E_2 = [0, \frac 19]\cup [\frac 29, \frac 13]\cup[\frac 23,\frac 79]\cup [\frac 89, 1]$

*.....


The Cantor set is what remains when you do this an "infinite number of times".  If I can abuse notation $CantorSet = E_{\infty}$ or $\lim_{n\rightarrow \infty} E_n$ except... well, that's an abuse of notation.  The proper description would be $\cap_{i=0}^{\infty} E_i$ (but that can be intuitively confusing).
Thus all intervals of the form $(\frac {3k+1}{3^m}, \frac{3k+2}{3^m})$ are removed (and no intervals are left.)
S0 the set is $[0,1] \setminus \{(\frac {3k+1}{3^m}, \frac{3k+2}{3^m})|k,m\in \mathbb Z^+\}$
Or ... $\{\sum_{i=0}^\infty (a(i)/3^i)|\{a_i\} \in \{0,2\}^{\infty}\}$  (where $\{0,2\}^{\infty}$ is the set of all infinite sequences containing $0$ or $2$).
If we use decimal base three notation it would be all numbers between $0$ and $1$ that have only $0$ and $2$ in their base three decimal expansion.  (But as and infinite number of $2$ is the same as a terminating $1$ this can be restated as all real number between $0$ and $1$ who either have no decimal $1$ or only have a single occurrence of $1$ in its terminating position.) 
I think (someone will correct me if I am mistaken) the Cantor-ish set of all the real numbers with only $0$ and $5$ in their base $10$ decimal expansion is topologically equivalent to the Cantor set.  This is the set you get by 


*

*$G_1 = [0,1]$

*$G_2 = [0,.1]\cup [.5,1]$

*$G_3 = [0,0.01]\cup [.05,.1]\cup[.5,.51]\cup [.55, 1]$

*....


Is the same process, just with a nice base 10 result.
A: Let us define the Cantor representation of a real number to be the ternary expansion of that number where we don't allow a suffix of $1000\cdots$ or $12222\cdots$. So we wouldn't write $1$ as $1.0000\cdots$, we would write it as $0.2222\cdots$. Likewise, $2/3$ is $0.2000\cdots$ not $0.1222\cdots$.
The Cantor set consists of all real numbers in $[0,1]$ whose Cantor representation does not contain any $1$s. We can build the Cantor set by defining the sets $C_n$ of all real numbers in $[0,1]$ whose Cantor representation does not contain a $1$ in the first $n$ digits after the decimal point. The intersection $\bigcap C_n$ will be the Cantor set.
The set $C_0$ is the entire interval, $[0,1]$.
The set $C_1$ consists of all the numbers


*

*between $0 = 0.0000\cdots$ and $1/3 = 0.0222\cdots$ and

*between $2/3 = 0.2000\cdots$ and $1 = 0.2222\cdots$.


Thus $C_1 = [0,\frac13] \cup [\frac23, 1]$.
The set $C_2$ consists of the numbers


*

*between $0 = 0.0000\cdots$ and $1/9 = 0.00222\cdots$ and

*between $2/9 = 0.02000\cdots$ and $1/3 = 0.02222\cdots$ and

*between $2/3 = 0.20000\cdots$ and $7/9 = 0.20222\cdots$ and

*between $8/9 = 0.22000\cdots$ and $1 = 0.22222\cdots$.


So $C_2 = [0,\frac19] \cup [\frac29, \frac13] \cup [\frac23, \frac79] \cup [\frac89, 1]$.
In general, $C_n$ is obtained from $C_{n-1}$ by removing the middle third of each interval in $C_{n - 1}$.
A: That formula isn't all that helpful. The most useful property is $\mathcal C= \frac{\mathcal C}3\cup\left(\frac23+\frac{\mathcal C}3\right)$, i.e. the Cantor set is the union of two subsets obtained by shrinking/shifting of the Cantor set. That's called self-similarity.
