Re: Cantor set
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg995] Re: [mg891] Cantor set
- From: Richard Mercer <richard at seuss.math.wright.edu>
- Date: Mon, 8 May 1995 03:38:22 -0400
> The ternary Cantor set can be constructed iteratively
> from the interval [0,1] by removing at the n+1'th step
> the middle third of each interval obtained in the n'th
> step. Can anyone come up with a nice MMa formula for
> calculating the beginning and end points of the k'th
> interval (counted from left) in the n'th iteration?
>
> Thanks for any suggestions!
>
> -- Daniel
>
>
> Fritz Haber Center for Molecular Dynamics Hebrew
> University of Jerusalem E-mail: dani at batata.fh.huji.ac.il
> Fax: 972-2-513742
>
Daniel,
As such thing go, this is easy. Are you sure you were really tryin? :)
CantorEndPoints[0] = {{0,1}};
CantorEndPoints[n_]:=
Join[CantorEndPoints[n-1]/3, CantorEndPoints[n-1]/3 + 2/3];
CantorEndPoints[3]
1 2 1 2 7 8 1 2 19 20 7 8 25 26
{{0, --}, {--, -}, {-, --}, {--, -}, {-, --}, {--, -}, {-, --}, {--, 1}}
27 27 9 9 27 27 3 3 27 27 9 9 27 27
If you want the kth interval, just take
CantorEndPoints[n][[k]]
Richard Mercer