# Message Boards

Answer
(Unmark)

GROUPS:

2

# Using entropy to estimate the dimension of the Sierpinski triangle

Posted 9 months ago

Using entropy to estimate the dimension of the Sierpinski triangle It turns out to be about 1.62
Introduction To estimate the dimension of self-similar structures like fractals, we usually use Hausdorff dimension, which basically tells us how quickly the volume of the object increases with size. But what if we use information theory to estimate the dimensions of things? To specify the position of a point in d d d d 1/n H=∑ p i p i p i i d a 3 a 3 n H=3Log[n]+3Log[a] d H=dLog[n]+ d d H=dLog[n]+ d H Log[n] H Log[d] H n H=dLog[n]+ d n In[]:= ClearAll[geomEntropy];geomEntropy[points_, n_] := Block[ npoints, counts, probs, entropy , counts = countPoints[points, n]; npoints = Length[points]; probs = Flatten[counts / npoints]; Total[If[# 0, 0, N[-# Log[#]]]& /@ probs]]; For practical reasons, 2D space was chosen instead of 3D, which is not a big problem because the Sierpinski triangle lives in 2D space. Also, the region is taken to always be 0≤x≤1 0≤y≤1 2 n In[]:= ClearAll[countPoints];countPoints[points_, n_] := Block[ customRound, incr, counts , customRound[x_] := Min[1 + IntegerPart[n x], n]; incr[a_, b_] := counts[[customRound[a], customRound[b]]]++; counts = ConstantArray[0, {n, n}]; Apply[incr, #]& /@ points; counts]; Let us try to determine the dimension of a circle. For that, let us take 2000 equidistant points in that circle: In[]:= circlepoints=N 1 2 1 2 # 2 In[]:= Graphics[Point/@circlepoints,ImageSizeSmall] Out[]= Here, the constant vector {1/2,1/2} 1/2 0≤x≤1 0≤y≤1 2 8 In[]:= {drawGrid[circlepoints,8],ArrayPlot[countPoints[circlepoints,8],ImageSizeSmall]} Out[]= , Here, darker squares have more points in them. Here is the value of “geometrical entropy” that we get: In[]:= geomEntropy[circlepoints,8] Out[]= 3.30534 To estimate the dimension, we would want to plot this. Here is a special function for that: In[]:= plotGeomEntropy[circlepoints, # 2 Out[]= We have just used entropy to estimate the dimension of a circle, and the result came out right! Isn’t that awesome? plotGeomEntropy computes the value of the “geometrical entropy” for various values of n H Log[n] |