MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Cantor set


>  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


  • Prev by Date: Re: Operator Definition
  • Next by Date: DSolve solution checking
  • Previous by thread: Re: Cantor set
  • Next by thread: Re: Re: Cantor set