A stochastic method to generate the Sierpinski triangle
Here&#x27;s a quick proof as to how it works. Suppose the triangle has endpoints (0,0), (1,0), and (1&#x2F;2, sqrt(3)&#x2F;2). Given a point (x,y), the three transformations then become<p>f1(x,y) = (x&#x2F;2, y&#x2F;2)<p>f2(x,y) = (x&#x2F;2+1&#x2F;2, y&#x2F;2)<p>f3(x,y) = (x&#x2F;2 + 1&#x2F;4, y&#x2F;2 + sqrt(3)&#x2F;4)<p>which are precisely the maps in the Iterated Function System [1] which generate the Sierpinsky triangle!<p>It&#x27;s a very nice observation that the three maps have a concise representation in terms of taking the midpoint with the given point and the vertices of the triangle.<p>[1] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iterated_function_system" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iterated_function_system</a>