I know that the derivative of the Cantor Staircase should be close to 0 since the Cantor Set has a measure of zero. I wanted to graph the derivative of Cantor's Staircase in Mathematica to see if it was closed to 0 from the interval [0,1]. Here is my input:

f[x_] := f[x] = CantorStaircase[x]; 

Plot[f'[x], {x, 0, 1}]

However, the plot of the derivative is not close to 0. I appreciate any suggestions of where I went wrong. Thanks!

  • $\begingroup$ N[CantorStaircase'[1/2]] returns -0.119127 when it should return something close to zero, so I suspect this is a bug of some sort. $\endgroup$ – Michael Seifert Apr 26 at 19:09
  • $\begingroup$ Also, N[CantorStaircase'[1/6]] = -0.837313, apparently. Not all rational values return a numerical answer, though; N[CantorStaircase'[1/4]] doesn't give any output in a reasonable time on my computer. $\endgroup$ – Michael Seifert Apr 26 at 19:18
  • $\begingroup$ Curiouser and curiouser: N[CantorStaircase'[1/6], n] for various values of n gives wildly fluctuating values as n increases — but only the first time you run the command in a fresh kernel. So running N[CantorStaircase'[1/6], 5] gives you one number, N[CantorStaircase'[1/6], 10] gives you a second, different number, and N[CantorStaircase'[1/6], 5] gives you the second result rounded off to five significant digits. $\endgroup$ – Michael Seifert Apr 26 at 23:12

It would appear that this simple staircase has "jaggies" where no slope can be defined. I think your function lacks defined slopes, too.

Plot[CantorStaircase[x], {x, 0, 1}]

  • $\begingroup$ And if you want to zoom in: Plot[CantorStaircase[x], {x, 0, 0.0000001}] $\endgroup$ – bill s Mar 27 at 18:05
  • $\begingroup$ @bill s you may zoom as much as you want, it always looks the same! $\endgroup$ – Daniel Huber Mar 27 at 18:10
  • 1
    $\begingroup$ @Youvan it only has "jaggies" on a set with measure zero. At almost all points it is constant. $\endgroup$ – Daniel Huber Mar 27 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.