Do-it-yourself construction and repairs

The Sierpinski triangle is given by explicit formulas. In the world of fractals: Fractals in mathematics. So what

This fractal was described in 1915 by the Polish mathematician Waclaw Sierpinski. To get it, you need to take an (equilateral) triangle with an interior, draw middle lines in it and throw out the central one of the four small triangles formed. Then you need to repeat the same steps with each of the remaining three triangles, etc. The picture shows the first three steps, and in the flash demonstration you can practice and get steps up to the tenth.


Construction of the Sierpinski triangle

Throwing out the central triangles is not the only way to end up with a Sierpinski triangle. You can move “in the opposite direction”: take an initially “empty” triangle, then complete the triangle formed by the middle lines in it, then do the same in each of the three corner triangles, etc. At first, the figures will be very different, but with As the iteration number increases, they will become more and more similar to each other, and in the limit they will coincide.


Construction of the Sierpinski triangle “in the opposite direction”

The next way to obtain a Sierpinski triangle is even more similar to the usual scheme for constructing geometric fractals by replacing parts of the next iteration with a scaled fragment. Here, at each step, the segments that make up the broken line are replaced with a broken line of three links (it itself is obtained in the first iteration). You need to lay this broken line alternately to the right and then to the left. It can be seen that already the eighth iteration is very close to the fractal, and the further it goes, the closer the line will get to it.


Another way to get the Sierpinski triangle Game Chaos

But that’s not all. It turns out that the Sierpinski triangle is obtained as a result of one of the varieties of random walk of a point on a plane. This method is called the "Chaos game". With its help you can build some other fractals.

The essence of the “game” is this. A regular triangle A 1 A 2 A 3 is fixed on the plane. Mark any starting point B 0 . Then, one of the three vertices of the triangle is randomly selected and point B 1 is marked - the middle of the segment with ends at this vertex and at B 0 (in the figure on the right, vertex A 1 was randomly selected). The same is repeated with point B 1 to get B 2. Then they get points B 3, B 4, etc. It is important that the point “jump” randomly, that is, that each time the vertex of the triangle is chosen randomly, regardless of what was chosen in the previous steps. It is surprising that if you mark points from the sequence B i , the Sierpinski triangle will soon begin to appear. Below is what happens when 100, 500 and 2500 points are marked.


Game Chaos: 100, 500 and 2500 points

Some properties

Fractal dimension log 2 3 ≈ 1.584962... . The Sierpinski triangle consists of three copies of itself, each half its size. Their relative arrangement is such that if you reduce the grid cells by half, then the number of squares intersecting with the fractal will triple. That is, N(δ/2) = 3N(δ). If at first the size of the cells was 1, and N 0 of them intersected with the fractal (N(1) = N 0), then N(1/2) = 3N 0, N(1/4) = 3 2 N 0, .. ., N(1/2 k) = 3 k N 0 . It turns out that N(δ) is proportional to , and by the definition of fractal dimension it is equal to just log 2 3.

  • The Sierpinski triangle has zero area. This means that not a single circle, even a very small one, will fit into the fractal. That is, if we start from the construction using the first method, the entire interior has been “removed” from the triangle: after each iteration, the area of ​​what remains is multiplied by 3/4, that is, it becomes smaller and tends to 0. This is not a strict proof, but others construction methods can only increase confidence that this property is still true.
  • An unexpected connection with combinatorics. If in Pascal's triangle with 2 n rows we paint all the even numbers white and the odd numbers black, then the visible numbers form a Sierpinski triangle (to some approximation).


Options

Carpet (square, napkin) by Sierpinski. The square version was described by Wacław Sierpinski in 1916. He managed to prove that any curve that can be drawn on a plane without self-intersections is homeomorphic to some subset of this holey square. Like a triangle, a square can be made from different designs. On the right is the classic method: dividing the square into 9 parts and throwing away the central part. Then the same is repeated for the remaining 8 squares, etc.


Sierpinski carpet, first 5 iterations

Like a triangle, a square has zero area. The fractal dimension of a Sierpinski carpet is equal to log 3 8, calculated similarly to the dimension of a triangle.

Sierpinski Pyramid. One of the three-dimensional analogues of the Sierpinski triangle. It is constructed in a similar way, taking into account the three-dimensionality of what is happening: 5 copies of the initial pyramid, compressed twice, make up the first iteration, its 5 copies will make up the second iteration, etc. The fractal dimension is equal to log 2 5. The figure has zero volume (at each step half the volume is thrown out), but at the same time the surface area is preserved from iteration to iteration, and for the fractal it is the same as for the initial pyramid.

Menger sponge. Generalization of the Sierpinski carpet into three-dimensional space. To build a sponge, you need an endless repetition of the procedure: each of the cubes that make up the iteration is divided into 27 three times smaller cubes, from which the central one and its 6 neighbors are thrown out. That is, each cube generates 20 new ones, three times smaller. Therefore, the fractal dimension is log 3 20. This fractal is a universal curve: any curve in three-dimensional space is homeomorphic to some subset of the sponge. The sponge has zero volume (since at each step it is multiplied by 20/27), but it has an infinitely large area.


Sierpinski triangle- a fractal, one of the two-dimensional analogues of the Cantor set, proposed by the Polish mathematician Waclaw Sierpinski in 1915. Also known as Sierpinski's "napkin".

Sierpinski triangle

Construction

Iterative method

Construction of the Sierpinski triangle

The midpoints of the sides of an equilateral triangle are connected by segments. You get 4 new triangles. The interior of the middle triangle is removed from the original triangle. It turns out a lot T 1 (\displaystyle T_(1)), consisting of the 3 remaining “first rank” triangles. Doing exactly the same with each of the triangles of the first rank, we obtain the set T 2 (\displaystyle T_(2)), consisting of 9 equilateral triangles of the second rank. Continuing this process indefinitely, we get an infinite sequence T 0 ⊃ T 1 ⊃ ⋯ ⊃ T n ⊃ … (\displaystyle T_(0)\supset T_(1)\supset \dots \supset T_(n)\supset \dots ), the intersection of whose members is a Sierpinski triangle.

Chaos method

1. The coordinates of the attractors are specified - the vertices of the original triangle T 0 (\displaystyle T_(0)). 2. Probability space (0 ; 1) (\displaystyle (0;1)) is divided into 3 equal parts, each of which corresponds to one attractor. 3. A certain starting point is specified P 0 (\displaystyle P_(0)), lying inside the triangle T 0 (\displaystyle T_(0)). 4. Beginning of the cycle of constructing points belonging to the set of the Sierpinski triangle. 1. A random number is generated n ∈ (0 ; 1) (\displaystyle n\in (0;1)). 2. The active attractor becomes the vertex in whose probabilistic subspace the generated number fell. 3. A point is being constructed P i (\displaystyle P_(i)) with new coordinates: x i = x i − 1 + x A 2 ; y i = y i − 1 + y A 2 (\displaystyle x_(i)=(\frac (x_(i-1)+x_(A))(2));y_(i)=(\frac (y_(i -1)+y_(A))(2))), Where: x i − 1 , y i − 1 (\displaystyle x_(i-1),y_(i-1))- coordinates of the previous point P i − 1 (\displaystyle P_(i-1)); x A , y A (\displaystyle x_(A),y_(A))- coordinates of the active attractor point. 5. Return to the beginning of the cycle.

Properties

Construction by iterative method

Construction using the chaos method

Notes

Links

L-system

The L-system or Lindenmayer system is a parallel rewriting system and a type of formal grammar. The L-system consists of an alphabet of symbols that can be used to create strings, a set of generating rules that specify the rules for substitution for each symbol, an initial string (“axiom”) from which construction begins, and a mechanism for translating the generated string into geometric structures. L-systems were proposed and developed in 1968 by Aristide Lindenmayer, a Hungarian biologist and botanist at Utrecht University. Lindenmayer used L-systems to describe the behavior of plant cells and model the process of plant development. L-systems have also been used to model the morphology of various organisms and can be used to generate self-similar fractals such as iterable function systems.

Racket (programming language)

Racket (formerly PLTScheme) is a multi-paradigm general-purpose programming language belonging to the Lisp/Scheme family. Provides an environment for language-oriented programming - one of the purposes of racket is the creation, development and implementation of programming languages. The language is used in various contexts: as a scripting language, as a general-purpose language, in computer science teaching, in scientific research.

The platform provides the user with an implementation of the Racket language, including a developed run time system, various libraries, a JIT compiler, etc., as well as the DrRacket development environment (formerly known as DrScheme) written in Racket. This software framework is used in MIT's ProgramByDesign course. The core Racket language features a powerful macro system that allows you to create embedded and domain-specific programming languages, language constructs (for example, classes and modules) and Racket dialects with different semantics.

The system is free and open source software distributed under LGPL terms. Extensions and packages written by the community are available on PLaneT, the system's web distribution.

Fractal compression algorithm

Fractal image compression is a lossy image compression algorithm based on the application of systems of iterated functions (usually affine transformations) to images. This algorithm is known for the fact that in some cases it allows one to obtain very high compression ratios with acceptable visual quality for real photographs of natural objects. Due to the difficult situation with patenting, the algorithm was not widely used.

Dividing tile

Rep-tile is a mosaic geometry concept, a figure that can be cut into smaller copies of the figure itself. In 2012, a generalization of divisible tilings called self-tiling tile set was proposed by English mathematician Lee Salous in Mathematics Magazine.

Final subdivision rule

In mathematics, the ultimate rule of subdivision is a recursive way of dividing a polygon and other two-dimensional shapes into smaller and smaller pieces. Subdivision rules in this sense are a generalization of fractals. Instead of repeating the same pattern over and over again, there are subtle changes at each step, allowing for richer structures while still maintaining the elegant fractal style. Subdivision rules are used in architecture, biology and computer science, as well as in the study of hyperbolic manifolds. Tile substitutions are a well-studied type of subdivision rule.

Peano curve

Peano curve is a general name for parametric curves whose image contains a square (or, more generally, open regions of space). Another name is a space-filling curve.

Named after Giuseppe Peano (1858-1932), the discoverer of this kind of curve, the Peano curve is the name given to the specific curve that Peano found.

Sierpinski curve

Sierpinski curves is a recursively defined sequence of continuous closed planar fractal curves discovered by Waclaw Sierpinski. The curve in the limit at completely fills the unit square, so the limit curve, also called Sierpinski curve, is an example of space-filling curves.

Since the Sierpinski curve fills space, its Hausdorff dimension (in the limit at n → ∞ (\displaystyle n\rightarrow \infty )) is equal to 2 (\displaystyle 2).
Euclidean curve length

equal to l n = 2 3 (1 + 2) 2 n − 1 3 (2 − 2) 1 2 n (\displaystyle l_(n)=(2 \over 3)(1+(\sqrt (2)))2^( n)-(1 \over 3)(2-(\sqrt (2)))(1 \over 2^(n))),

i.e. it is growing exponentially By n (\displaystyle n), and the limit at n → ∞ (\displaystyle n\rightarrow \infty ) area of ​​the region enclosed by the curve S n (\displaystyle S_(n)), is 5 / 12 (\displaystyle 5/12) square (in the Euclidean metric).

Logarithm

Logarithm of a number b (\displaystyle b) based on a (\displaystyle a) (from ancient Greek. λόγος "word; attitude" + ἀριθμός "number") is defined as an indicator of the power to which the base must be raised a (\displaystyle a) to get the number b (\displaystyle b). Designation: log a ⁡ b (\displaystyle \log _(a)b), pronounced: " logarithm b (\displaystyle b) based on a (\displaystyle a) ».

From the definition it follows that finding x = log a ⁡ b (\displaystyle x=\log _(a)b) is equivalent to solving the equation a x = b (\displaystyle a^(x)=b). For example, log 2 ⁡ 8 = 3 (\displaystyle \log _(2)8=3), because 2 3 = 8 (\displaystyle 2^(3)=8).

Calculating the logarithm is called by logarithm. Numbers a , b (\displaystyle a,b) most often real, but there is also a theory of complex logarithms.

Logarithms have unique properties that have determined their widespread use to significantly simplify labor-intensive calculations. When moving “into the world of logarithms,” multiplication is replaced by a much simpler addition, division is replaced by subtraction, and exponentiation and root extraction are transformed, respectively, into multiplication and division by the exponent. Laplace said that the invention of logarithms, “by shortening the astronomer’s work, doubled his life.”

The definition of logarithms and a table of their values ​​(for trigonometric functions) was first published in 1614 by the Scottish mathematician John Napier. Logarithmic tables, expanded and refined by other mathematicians, were widely used for scientific and engineering calculations for more than three centuries, until the advent of electronic calculators and computers.

Over time, it became clear that the logarithmic function y = log a ⁡ x (\displaystyle y=\log _(a)x) is irreplaceable in many other areas of human activity: solving differential equations, classifying the values ​​of quantities (for example, frequency and intensity of sound), approximation of various dependencies, information theory, probability theory, etc. This function is one of the elementary ones, it is the inverse of to the exponential function. The most commonly used are real logarithms with bases 2 (\displaystyle 2)(binary), e (\displaystyle e) (natural logarithm) and 10 (\displaystyle 10)(decimal).

DNA-based nanotechnology

DNA nanotechnology is the development and production of artificial structures from nucleic acids for technological use. In this scientific field, nucleic acids are used not as carriers of genetic information in living cells, but as a material for the needs of non-biological engineering of nanomaterials.

The technology uses strict rules for base pairing of nucleic acids, which only allow parts of the strands with complementary base sequences to be linked together to form a strong, rigid double helix structure. From these rules, it becomes possible to engineer sequences of bases that will be selectively assembled to form complex target structures with precisely tuned nanoscale shapes and properties. Most materials are made using DNA, but structures incorporating other nucleic acids such as RNA and peptide nucleic acids (PNA) have also been built, allowing the technology field to be called "nucleotide base nanotechnology".

The basic concept of DNA-based nanotechnology was first proposed in the early 1980s by Nadrian Seaman, and this research field began to attract widespread interest in the mid-2000s. Researchers working in this emerging field of technology have created static structures such as two- and three-dimensional crystal lattices, nanotubes, polyhedra and other freeform shapes, as well as functional structures such as molecular machines and DNA computers.

A variety of techniques are used to assemble these structures, including tile structuring, where tiles are assembled from smaller structures, folding structures created using the DNA origami technique, and dynamically rearranged structures created using strand displacement techniques. The research field is beginning to be used as a tool for solving basic science problems in the fields of structural biology and biophysics, including applied problems of crystallography and spectroscopy for protein structure determination. Research is also underway for potential applications in scalable molecular electronics and nanomedicine.

Natural logarithm

Natural logarithm is the logarithm to the base e, Where e (\displaystyle e)- an irrational constant equal to approximately 2.72. It is denoted as ln ⁡ x (\displaystyle \ln x), log e ⁡ x (\displaystyle \log _(e)x) or sometimes just log ⁡ x (\displaystyle \log x), if the base e (\displaystyle e) implied. Usually the number x (\displaystyle x) under the sign of the logarithm is real, but this concept can be extended to complex numbers.

From the definition it follows that the logarithmic dependence is the inverse function for the exponential y = e x (\displaystyle y=e^(x)), therefore their graphs are symmetrical with respect to the bisector of the first and third quadrants (see the figure on the right). Like the exponential function, the logarithmic function belongs to the category of transcendental functions.

Natural logarithms are useful for solving algebraic equations in which the unknown is present as an exponent, and they are indispensable in mathematical analysis. For example, logarithms are used to find the decay constant for a known half-life or to find the decay time in solving radioactivity problems. They play an important role in many areas of mathematics and applied sciences, and are used in finance to solve many problems, including finding compound interest.

Lebesgue dimension

Lebesgue dimension or topological dimension- dimension defined by coverings, the most important invariant of topological space. Lebesgue dimension of space X (\displaystyle X) usually denoted dim ⁡ X (\displaystyle \dim X).

Recursion

Recursion is a definition, description, image of an object or process within this object or process itself, that is, a situation when an object is part of itself. The term “recursion” is used in various specialized fields of knowledge - from linguistics to logic, but is most widely used in mathematics and computer science.

Sierpinski, Waclaw

Wacław Franciszek Sierpiński, in another transcription - Sierpiński (Polish: Wacław Franciszek Sierpiński; March 14, 1882, Warsaw - October 21, 1969, ibid.) - Polish mathematician and teacher, known for his works on set theory, the axiom of choice, the continuum hypothesis, number theory , function theory, and topology. Author of 724 articles and 50 books.

Tetrahedron (Bottrop)

Tetrahedron (German: Tetraeder) is a steel structure in the form of a tetrahedron with an edge length of 60 m, supported by four 9-meter concrete supports, used as an observation deck, in the city of Bottrop (North Rhine-Westphalia). The tetrahedron is located on top of the Beckstraße waste heap (German: Beckstraße) of the Prosper-Haniel mine (de: Bergwerk Prosper-Haniel) at an altitude of 105 m above sea level. From the top observation deck you can see views of the cities of Bottrop, Essen, Oberhausen, Gladbeck. With good visibility, the viewing range reaches 40 km and even allows you to distinguish the Rheinturm television tower in Düsseldorf.

The Bottrop Tetrahedron is the thematic point of the regional project "Path of Industrial Culture" of the Ruhr region.

Pascal's triangle

Pascal's triangle is an infinite table of binomial coefficients having a triangular shape. In this triangle, there are ones at the top and on the sides. Each number is equal to the sum of the two numbers above it. The lines of the triangle are symmetrical about the vertical axis. Named after Blaise Pascal. The numbers that make up Pascal's triangle arise naturally in algebra, combinatorics, probability theory, mathematical analysis, and number theory.

Fractal

Fractal (lat. fractus - crushed, broken, broken) is a set that has the property of self-similarity (an object that exactly or approximately coincides with a part of itself, that is, the whole has the same shape as one or more parts). In mathematics, fractals are understood as sets of points in Euclidean space that have a fractional metric dimension (in the sense of Minkowski or Hausdorff), or a metric dimension different from the topological one, so they should be distinguished from other geometric figures limited by a finite number of links. Self-similar figures that repeat themselves a finite number of times are called prefractals.

The first examples of self-similar sets with unusual properties appeared in the 19th century as a result of the study of continuous non-differentiable functions (for example, the Bolzano function, the Weierstrass function, the Cantor set). The term “fractal” was introduced by Benoit Mandelbrot in 1975 and became widely known with the publication of his book “Fractal Geometry of Nature” in 1977. Fractals gained particular popularity with the development of computer technologies, which made it possible to effectively visualize these structures.

The word "fractal" is used not only as a mathematical term. A fractal can be called an object that has at least one of the following properties:

It has a non-trivial structure at all scales. This is in contrast to regular figures (such as a circle, ellipse, graph of a smooth function): if you consider a small fragment of a regular figure on a very large scale, it will look like a fragment of a straight line. For a fractal, increasing the scale does not lead to a simplification of the structure, that is, on all scales you can see an equally complex picture.

Is self-similar or approximately self-similar.

It has a fractional metric dimension or a metric dimension that exceeds the topological one. Many objects in nature have fractal properties, for example: coasts, clouds, tree crowns, snowflakes, the circulatory system, alveoli.

Fractal dimension

Fractal dimension(English fractal dimension) - one of the ways to determine the dimension of a set in metric space. Fractal dimension n-dimensional set can be defined using the formula:

D = − lim ε → 0 ln ⁡ (N ε) ln ⁡ (ε) (\displaystyle D=-\lim \limits _(\varepsilon \to 0)(\frac (\ln(N_(\varepsilon ))) (\ln(\varepsilon)))), Where N ε (\displaystyle N_(\varepsilon ))- minimum number n-dimensional “balls” of radius ε (\displaystyle \varepsilon), necessary to cover the set.

The fractal dimension can take a non-integer numeric value.

The basic idea of ​​fractured dimension has a long history in the field of mathematics, but it was the term itself that was coined by Benoit Mandelbrot in 1967 in his article on self-similarity, in which he described fractional dimension. In this article, Mandelbrot referred to previous work by Lewis Fry Richardson describing the counterintuitive idea that the measured length of a shoreline depends on the length of a measuring stick (see Figure 1). Following this idea, the fractal dimension of a coastline corresponds to the ratio of the number of poles (at a certain scale) needed to measure the length of the coastline to the chosen scale of the pole. There are several formal mathematical definitions [⇨] of fractal dimension that build on this basic concept of a change in an element with a change in scale.

One elementary example is the fractal dimension of the Koch snowflake. Its topological dimension is 1, but it is by no means a rectifiable curve, since the length of the curve between any two points of a Koch snowflake is infinity. No part of a curve, however small, is a straight line segment. Rather, Koch's snowflake consists of an infinite number of segments connected at different angles. The fractal dimension of a curve can be explained intuitively by suggesting that a fractal line is an object too detailed (detailed) to be one-dimensional, but not complex enough to be two-dimensional. Therefore, its dimension is better described not by the usual topological dimension 1, but by its fractal dimension, equal in this case to a number lying in the interval between 1 and 2.

Fractal art

Fractal art is a form of algorithmic art created by computing fractal objects and presenting the results of the calculations as still images, animations, and automatically generated media files. Fractal art began in the mid-1980s. It is a genre of computer art and digital art that is part of new media art. At the same time, fractal art is one of the areas of the so-called “scientific art”.

Fractal art is rarely created by hand. It is usually created indirectly by software that generates fractals through three steps: setting the parameters of the corresponding fractal software; performing possibly lengthy calculations; and product evaluations. In some cases, other graphics programs are used to further process the generated images. Non-fractal images can also be included in a work of art. The Julia Set and the Mandelbrot Set are considered icons of fractal art.

Characteristics
The simplest fractals
  1. Let's take a regular triangle.
  2. We cut out a triangle from it, the vertices of which lie at the midpoints of the sides of the original one. As a result, we get three triangles on the plane, the area of ​​each of which is four times less than the area of ​​the original one.
  3. We perform the previous manipulations with the resulting triangles.

The process looks like this:

  1. Interestingly, if in Pascal’s triangle all odd numbers are colored one color and even numbers another, then a Sierpinski triangle is formed.
Let's take advantage of this fact. Only in Excel it is more convenient to use not the classic (line-by-row) form of Pascal’s triangle, but this:

Here the binomial coefficients are written diagonally, in the first filled row and the first filled column of unity, and in the rest the sum of the top and left elements.

Let's move on to construction. For us it is enough to write down not the coefficients, but only their parity.

First, let's make the cells size in Excel, for example 7 by 7 pixels.

Let's stand in cell B2, then select the area B2:DY129 - to do this, press Ctrl + G and write B2:DY129 in the link field.

Now in the formula bar we write =IF(OR(ROW()=2,COLUMN()=2),1,REM(A2+B1,2))
and press Ctrl + Enter to fill the entire selected area with a similar formula.

Let's go Menu - Conditional Formatting and for value 1 we indicate the color of the cell.

As a result we get:


It should be noted that the Sierpinski triangle is obtained by some kind of random walk on the plane. Namely:
  1. Let's fix 3 vertices of the triangle on the plane and take another point.
  2. We obtain the first point as the midpoint of the segment between accidentally the selected vertex and point from step 1.
  3. We obtain the second point as the midpoint of the segment between accidentally the selected vertex and the first point.
  4. We repeat the process many times.

You can use this macro:

Public Sub Macro()

Dim arRange(1 To 3) As Range
Dim tekRow As Integer
Dim tekColumn As Integer
Dim i As Integer
Dim iT As Integer

tekRow = Int(1000 * Rnd) + 1
tekColumn = Int(200 * Rnd) + 1

Set arRange(1) = Cells(1, 1)
Set arRange(2) = Cells(50, 250)
Set arRange(3) = Cells(200, 20)

Cells.Clear

For i = 1 To 20000
iT = (Int(1000 * Rnd) Mod 3) + 1
tekRow = Int((tekRow + arRange(iT).Row) / 2)
tekColumn = Int((tekColumn + arRange(iT).Column) / 2)
Cells(tekRow, tekColumn).Interior.ColorIndex = 5
Next

End Sub

Sierpinski triangle
The Sierpinski triangle is one of the most famous fractals; its construction is one of the first laboratory works on recursion in relevant disciplines in many universities. The fractal looks like this:
Pascal's triangle
Pascal's triangle is an infinite table of binomial coefficients having a triangular shape. In this triangle, there are ones at the top and on the sides. Each number is equal to the sum of the two numbers above it. The lines of the triangle are symmetrical about the vertical axis.

So what?

There is an interesting feature in Pascal's triangle. It displays the above fractal with its numbers. If you peer into the abyss for a long time, the abyss begins to peer into you meanings, then you can see that even and odd numbers are arranged in groups, because there is one unspoken rule known to everyone: even + odd = odd, even + even = even, odd + odd = even .

Well, less words, more action. Let's make the conclusion a little clearer. People who are not interested in software implementation will not be interested in the next paragraph.

I took the old algorithm for calculating and deducing Pascal's triangle and transformed it in such a way that instead of the value of the numbers, the remainder of its division by 2 is displayed. Therefore, the even numbers have now become zeros, and the odd ones - ones. I attach the code below
#include using namespace std; double Cnk(int N,int K) ( return ((N (Cnk(j,i)))%2<<" "; cout<<"\n"; } return 0; }
For greater clarity, I decorated the output in the following way: the program output is redirected to a file, from where, upon completion of the first execution, the pearl, with its regexps, replaces the ones with red letters O, and the zeros with blue ones. The script code is below:
#! perl -w open (STREAM_IN, "1.txt");# || die "Can"t open STREAM_IN\n"; open (STREAM_OUT, ">> 1.html");# || die "Can"t open STREAM_OUT\n"; $ss="
"; while ($curr = ) ( chomp($curr); $curr=~s/1/ O<\/font>/g; $curr=~s/0/ O<\/font>/g; $curr=~s/-//g; $out = $curr.$ss; print(STREAM_OUT $out); ); close STREAM_IN; close STREAM_OUT;
From the source it is clear that we will look at html. Why? For reasons of simplicity. Only the DOM tree turns out to be incorrect. Let's fix this with a BASH script and automate everything described above:
#!/bin/bash g++ ~/serp.cpp; ~/a.out > ~/1.txt; echo " TRIANGLE

" > ~/1.html; perl ~/s.pl; echo "
" >> ~/1.html
So, we compile the source code on the pluses, its output goes to the textbox, bash “echoes” in the html to be overwritten by the beginning of the DOM tree, after which the textbox takes the pearl script, remakes it into a multi-colored html version, supplements the html, after which the kind BASCH again completes the formation of the tree. Let's launch and look:


Let's highlight and compare with the original


PROFIT

FACULTY OF CYBERNETICS

Coursework in materials science

"Fractals"

Completed:

students gr. KS-71-10

Saltykov Egor

Lytenkova Daria

Checked:

Smirnov Alexander Nikolaevich


1. Introduction.

2. Definition of fractals.

3. From the history of the study of fractals.

4. Classification of fractals.

5. Geometric fractals.

6. Algebraic fractals.

7. Stochastic fractals.

8. Fractal trees.

9. Measuring bodies.

10. Fractional dimension.

11. Practical calculation of dimensions.

12. Why fractals are relevant.


Introduction

This course work examines the main issues related to fractals, such as the definition of fractals, their dimension, applications, and the history of discovery.

As an example, the calculation of the dimension of the distilled water fractal is given. A dimension calculator was used in the calculation, and some general information about fractals is also provided.

Fractals are infinitely self-similar figures, each fragment of which is repeated as the scale decreases. The branches of tracheal tubes, neurons, the human vascular system, the convolutions of the shores of seas and lakes, the contours of trees - these are all fractals. Fractals are found in places as small as a cell membrane and as large as stellar galaxies. We can say that fractals are unique objects generated by the unpredictable movements of the chaotic world!


From the history of the study of fractals

The term "fractal" was introduced by B. Mandelbrot in 1975. According to Mandelbrot, fractal(from lat. " fractus" - fractional, broken, broken) is a structure consisting of parts similar to the whole. The property of self-similarity sharply distinguishes fractals from objects of classical geometry. The term self-similarity means the presence of a fine, repeating structure, both at the smallest scale of an object and at the macroscale.

The history of fractals began with geometric fractals, which were studied by mathematicians in the 19th century. Fractals of this class are the most visual, because self-similarity is immediately visible in them. Examples of such fractals are: Koch, Levy, Minkowski curves, the Sierpinski triangle, the Menger sponge, the Pythagorean tree (Fig. 1), etc. From a mathematical point of view, a fractal is, first of all, a set with a fractional (intermediate, “non-integer” ) dimension. While a smooth Euclidean line fills exactly one-dimensional space, a fractal curve goes beyond the boundaries of one-dimensional space, encroaching beyond the boundaries into two-dimensional space. Thus, the fractal dimension of the Koch curve will be between 1 and 2. This, first of all, means that for a fractal object it is impossible to accurately measure its length!



There are many classifications of fractals. It is customary to distinguish between regular and irregular fractals, of which the former are a figment of the imagination (mathematical abstraction), similar to the Koch snowflake or the Sierpinski triangle, and the latter are a product of nature or human activity. Irregular fractals (Fig. 2), unlike regular ones, retain the ability to be self-similar within limited limits determined by the actual dimensions of the system.

Fractals are finding more and more applications in science and technology. The main reason for this is that they describe the real world sometimes even better than traditional physics or mathematics. One can endlessly give examples of fractal objects in nature - these are clouds, and snow flakes, and mountains, and a flash of lightning, and finally, cauliflower. A fractal as a natural object is an eternal continuous movement, new formation and development.

In addition, fractals find application in decentralized computer networks and “fractal antennas.” The so-called “Brownian fractals” are very interesting and promising for modeling various stochastic (non-deterministic) “random” processes. In the case of nanotechnology, fractals also play an important role, since due to their hierarchical self-organization, many nanosystems have a non-integer dimension, that is, they are fractals by their geometric, physicochemical or functional nature. For example, a striking example of chemical fractal systems are molecules of “dendrimers” » . In addition, the principle of fractality (self-similar, scaling structure) is a reflection of the hierarchical structure of the system and is therefore more general and universal than standard approaches to describing the structure and properties of nanosystems.


Classification of fractals

Algebraic fractals

Mandelbrot set

Julia set

Newton's pools (fractals)

Biomorphs

Sierpinski triangles

Geometric fractals

Koch curve (Koch snowflake)

Levy curve

Hilbert curve

Dragon's broken line (Harter-Haithway fractal)

Cantor set

Sierpinski triangle

Sierpinski carpet

Tree of Pythagoras

Circular fractal

Stochastic fractals

Man-made fractals

Natural fractals

Deterministic Fractals

Non-deterministic fractals


Geometric fractals

This is where the history of fractals began. This type of fractal is obtained through simple geometric constructions. Usually, when constructing these fractals, they do this: they take a “seed” - an axiom - a set of segments on the basis of which the fractal will be built. Next, a set of rules is applied to this “seed”, which transforms it into some kind of geometric figure. Next, the same set of rules is applied again to each part of this figure. With each step, the figure will become more and more complex, and if we carry out (at least in our minds) an infinite number of transformations, we will get a geometric fractal.

The Peano curve discussed above is a geometric fractal.

Classic examples of geometric fractals are Koch's Snowflake, Liszt, Sierpinski Triangle).

Snowflake Koch

Of these geometric fractals, the first one, the Koch snowflake, is very interesting and quite famous. It is built on the basis of an equilateral triangle. Each line of which ___ is replaced by 4 lines each 1/3 the length of the original _/\_. Thus, with each iteration, the length of the curve increases by a third. And if we make an infinite number of iterations, we will get a fractal - a Koch snowflake of infinite length. It turns out that our infinite curve covers a limited area. Try to do the same using methods and figures from Euclidean geometry. The so-called L-Systems are well suited for constructing geometric fractals. The essence of these systems is that there is a certain set of system symbols, each of which denotes a specific action and a set of symbol conversion rules.

Sierpinski triangle

The second property of fractals is self-similarity. Take, for example, the Sierpinski triangle. To build it, from the center of the triangle, we mentally cut out a piece of a triangular shape, which with its vertices will rest against the middle of the sides of the original triangle. Let's repeat the same procedure for the three triangles formed (except for the central one) and so on ad infinitum. If we now take any of the resulting triangles and enlarge it, we will get an exact copy of the whole. In this case we are dealing with complete self-similarity.

Draco's broken line

The Draconian broken line belongs to the class of self-similar recursively generated geometric structures. A zero-order polyline is simply a right angle. The image of a figure of each next order is constructed by recursively replacing each of the segments of the figure of the lower order with two segments, also folded in the form of a right angle.

In this case, every first corner turns out to be “turned” outward, and every second corner turns inward. Despite its apparent simplicity, constructing a dragon polyline is a fascinating algorithmic problem, the solution of which may require some mental effort on your part. The figure illustrates the algorithm for constructing a dragon polyline and depicts a fully grown “dragon” of the tenth order.


Algebraic fractals

The second large group of fractals are algebraic. They got their name because they are built on the basis of algebraic formulas, sometimes very simple ones. There are several methods for obtaining algebraic fractals. One of the methods is a repeated (iterative) calculation of the function Zn+1=f(Zn), where Z is a complex number, and f is a certain function. The calculation of this function continues until a certain condition is met. And when this condition is met, a dot is displayed on the screen. In this case, the function values ​​for different points of the complex plane can have different behavior:

Over time it tends to infinity.

Tends to 0

Accepts several fixed values ​​and does not go beyond them.

Behavior is chaotic, without any trends.

To illustrate algebraic fractals, let's turn to the classics - the Mandelbrot set.

To construct it, we need complex numbers. A complex number is a number consisting of two parts - real and imaginary, and is denoted a+bi. The real part a is an ordinary number in our representation, but the imaginary part bi is more interesting. i is called the imaginary unit. Why imaginary? But because if we square i, we get -1.

Complex numbers can be added, subtracted, multiplied, divided, raised to a power and rooted, but they cannot be compared. A complex number can be depicted as a point on a plane whose coordinate X is the real part a, and Y is the coefficient of the imaginary part b.

In the picture depicting the Mandelbrot set, I took a small area and enlarged it to the size of the entire screen (like a microscope). What do we see? Manifestation of self-similarity. Not exact self-similarity, but close, and we will encounter it constantly, increasing parts of our fractal more and more. How long can we increase our multitude? So, if we increase it to the limit of the computing power of computers, we will cover an area equal to the area of ​​the solar system up to Saturn.


Stochastic fractals

A typical representative of this class of fractals is “Plasma”. To construct it, let’s take a rectangle and define a color for each of its corners. Next, we find the central point of the rectangle and paint it with a color equal to the arithmetic mean of the colors at the corners of the rectangle plus some random number. The larger the random number, the more “ragged” the drawing will be. If we now say that the color of the point is the height above sea level, we will get a mountain range instead of plasma. It is on this principle that mountains are modeled in most programs. Using an algorithm similar to plasma, a height map is built, various filters are applied to it, a texture is applied, and photorealistic mountains are ready.


Fractal trees

Many misconceptions are associated with the fractal nature of trees. Tree objects are a lot like fractals: they are built iteratively, they look fractal, and sometimes they are even fractals. However, in most cases, this similarity is only external.

Classic trees

Let's look at a typical tree.

Is it possible to find its similarity dimension, as we did in the note about fractional dimensions? It can be seen that the whole tree is similar to its parts.

However, not the entire tree can be made up of similar parts. Each branch is indeed like a tree (marked in red and green), but there are two more segments that do not fit into the overall diagram (black). Thus, the tree presented here is not a self-similar object and it is impossible to find its dimension using the previously obtained formula.

However, it is easy to create trees that are completely self-similar.

Self-similar trees

To make our tree self-similar, we simply need to replace the segments that violated self-similarity with trees. For example like this:

Here you can see that the large tree is completely composed of its small similarities. Two subtrees have a similarity coefficient of 0.55 (red and green), and the eight trees that make up the “branches” have a similarity coefficient of 0.08 (all eight are black).

The dimension of this tree is easy to calculate and is approximately 1.3788.

You can make the branches thinner. Let's double the number of sub-trees in the "branches" and halve their size:

The dimension of this fractal is 1.3455.

If we once again double the number of small copies of the tree in the “branches” and once again halve the size of these copies, we will get even thinner branches:

The dimension of such a fractal is already 1.3200.

Self-affine trees

Strictly speaking, a fractal does not have to be exactly self-similar. Its fragments can be obtained not only by similarity transformation, but also by any affine transformation.

Using affine transformations, you can make “branches” thinner by simply deforming their constituent parts of the tree.

I’ll write about how the dimensions of self-affine objects are calculated sometime in my spare time, but here I’ll just say that the dimension of this fractal is 1.7251.

What size are ordinary trees?

Calculating the size of a tree depends on how you build it.

For example, you can consider that this is a self-affine fractal, in which the branch fractals have degenerated into segments. Here you need to understand that the branch, in this case, is not just a segment. At each point there is an overlap of an infinite number of points belonging to different branches of the fractal flattened into a segment. That is, with this construction, the tree does not consist of segments, but is built from much “heavier” components. For a tree with the considered proportions, the dimension will be 1.1594.

But if you build a tree honestly - from segments, then its dimension will be simply 1. Moreover, if the sum of the similarity coefficients is less than one, then you can easily calculate the length of all branches (using the formula for the sum of a geometric progression). That is, the tree becomes not just a one-dimensional line, but also has a finite length.


Measuring bodies

First, a short introduction to bring our everyday ideas about the measurement of bodies into some order. Without striving for mathematical precision of formulations, let's figure out what size, measure and dimension are. The size of an object can be measured with a ruler. In most cases, the size turns out to be uninformative. Which pile of cereal is bigger?

If you compare heights, then red is larger, if widths are green.

Size comparisons can be informative if items are similar to each other:

Now, no matter what dimensions we compare: width, height, side, perimeter, radius of the inscribed circle or any others, it will always turn out that the green heap is larger.

Measure

The measure also serves to measure objects, but it is not measured with a ruler. We’ll talk about how exactly it is measured later, but for now let’s note its main property - the measure is additive.

Expressed in everyday language, when two objects merge, the measure of the sum of the objects is equal to the sum of the measures of the original objects.

For one-dimensional objects, the measure is proportional to the size. If you take segments 1cm and 3cm long and “add” them, then the “total” segment will have a length of 4cm (1+3).

For non-one-dimensional bodies, the measure is calculated according to certain rules, which are selected so that the measure retains additivity. For example, if you take squares with sides of 3 cm and 4 cm and “fold” them, then the areas will add up (9 + 16 = 25), that is, the side (size) of the result will be 5 cm.

Both the terms and the sum are squares, that is, they are similar to each other and we can compare sizes. It turns out that the size of the sum is not equal to the sum of the sizes.

How are measure and size related?

Dimension

It is precisely the dimension that allows us to connect measure and size.

Let's denote the dimension - D, measure - M, size - L. Then the formula connecting these three quantities will look like:

For habitual people, this formula takes on familiar guises. For two-dimensional bodies (D=2) the measure (M) is area (S), for three-dimensional bodies (D=3) - volume (V):

The attentive reader will ask, by what right did we write the equal sign? Well, okay, the area of ​​a square is equal to the square of its side, but what about the area of ​​a circle? Does this formula work for any objects?

Yes and no. You can replace equalities with proportionality and enter coefficients, or you can assume that we are entering the sizes of bodies exactly so that the formula works. For example, for a circle we will call the size of the arc length equal to the root of “pi” radians. Why not?

In any case, the presence or absence of coefficients will not change the essence of further reasoning. For simplicity, I will not introduce coefficients; if you want, you can add them yourself, repeat all the reasoning and make sure that they (the reasoning) have not lost their validity.

From all that has been said, we should draw one conclusion: if the figure is reduced by N times (scaled), then it will fit into the original ND times. Indeed, if you reduce the segment (D=1) by 5 times, then it will fit in the original exactly five times (51=5); If the triangle (D = 2) is reduced by 3 times, then it will fit into the original 9 times (3 2 = 9).

If the cube (D = 3) is reduced by 2 times, then it will fit into the original 8 times (2 3 = 8).

The opposite is also true: if, when reducing the size of a figure by N times, it turns out that it fits into the original n times (that is, its measure has decreased by n times), then the dimension can be calculated using the formula:

Not very strictly and omitting many important details, we still got a formula for the dimension.


Fractional dimension

The simplest example

Fractional dimensions are usually talked about using examples of various broken lines. Let's turn to Koch's star.

The procedure for its construction is shown in the figure (from bottom to top):

These constructions are repeated an infinite number of times and in the end we get a broken line consisting of an infinite number of segments. No matter how much we scale it, we will still get the same thing.

This is Koch's star.

Strictly speaking, the resulting set of points can no longer be called a broken line. By definition, a polyline must consist of a finite number of segments. But I will use the word “broken line” in a “non-strict” sense.

Let's now use our technique to determine its dimension.

From the construction and drawing it is clear that the star can be divided into four equal parts, and the size (say, the length of the original segment) of each part will be equal to a third of the size of the original figure. That is, being reduced three times, it will fit within itself four times:

By analogy with our previous reasoning, we find that the dimension is equal to

D = ln(4)/ln(3) ≈ 1.26185950714291487419

That is, it is no longer just a segment or a broken line (the length of the Koch star is infinite), but also not a flat figure that completely covers a certain area.

If we slightly modify the construction algorithm and extract not 1/3 of the segment, but 1/9, then the broken line will be denser:

What is its dimension? Now the figure will fit into itself four times after decreasing by 9/4 times, that is, the dimension can be calculated using the same formula:

D = ln(4)/ln(9/4) ≈ 1.70951129135145477696

As you can see, the “density” of the coating immediately affected the dimensions.

Let's now get a more general formula for calculating the dimension. To do this, let's look at an example again:

The iterations again start from one segment. At each iteration step, the number of segments doubles. Each one generates two new ones: one is 0.88 times smaller (or rather larger) than the parent, the second is 0.41 times smaller. In the limit, the following set is obtained:

Let's go back to the first iteration step, where we got two segments, and see what part of the fractal is formed from each of them.

If we assume that the size of the full fractal is 1, then the size of the green part (obtained from the larger segment) will be 0.88, and the size of the red part (obtained from the smaller) will be 0.41.

The formula we have is no longer suitable, since we have not one, but two scaling factors. But we can use our knowledge about the properties of measure, size and dimension. The measure, as we remember, is additive, that is, the measure of a complete fractal is equal to the sum of the measures of its parts:

Both the fractal itself and its parts have the same dimension (D) and we can express measures through dimensions:

And we know the sizes. That is, for the dimension of our fractal we can write the equation:

1D = 0.88D + 0.41D

or simply

1 = 0.88D + 0.41D

It is impossible to solve this equation analytically, but an “approximate” answer can be “fitted.” To do this, you can use my on-line dimension calculator. In our case

D ≈ 1.7835828288192

You can check.

Thus, if a fractal is formed from N similar elements, with similarity coefficients k1, k2 ... kN, then its dimension can be found from the equation:

1 = k1D + k2D + ... + kND

Please note that if all coefficients are equal, then our formula turns into the already known simple formula:

1 = kD + kD + ... + kD = N * kD

D = ln(1/N)/ln(k)

D = ln(N)/ln(1/k)

The last expression is our first simple formula for calculating the dimension.


Practical calculation of the dimension of a substance using the example of calculating the dimension of distilled water.

We have a graphic representation of the water surface:

We divide this image into similar parts. In this case, it is easier and more relevant to divide the image into squares:

And the last square, which is the original one, we have already given above.

Substitute the dimensions into the dimension calculator:

The dimension of water is D=1.643594371.


Why fractals are relevant

Most systems in nature combine two properties:

firstly, they are very large, often multifaceted, diverse and complex,

and secondly, they are formed under the influence of a very small number of simple patterns, and further develop, obeying these simple patterns.

These are a variety of systems, ranging from crystals and simple clusters (various types of clusters, such as clouds, rivers, mountains, continents, stars), ending with ecosystems and biological objects (from a fern leaf to the human brain).

Fractals are just such objects: on the one hand, complex (containing infinitely many elements), on the other hand, built according to very simple laws. Thanks to this property, fractals have much in common with many natural objects. But a fractal compares favorably with a natural object in that a fractal has a strict mathematical definition and is amenable to strict description and analysis.

Therefore, the theory of fractals makes it possible to predict the growth rate of plant root systems, labor costs for draining swamps, the dependence of straw mass on shoot height, and much more.

Example of using fractals

Two clouds are flying. The first casts a shadow of area A, the second - B. These clouds merge into one. What will be the area C of the shadow of this new cloud?

Having answered this question, we can already draw conclusions about what the total cloud cover will be.

Are the clouds two-dimensional?

If the clouds had dimension 2 (that is, they were flat), then they would simply unite and the answer would be simply the sum

That is, two clouds fold together like two pieces of wallpaper.

But this is not true. The total cloud will not only become wider and longer than the terms, it will also become higher. With the same mass, the area will be less than the total.

Are the clouds three-dimensional?

If the dimension of the clouds were 3 (that is, they would be monolithic and without voids), then the answer would be

C 3/2 = A 3/2 + B 3/2

C = (A 3/2 + B 3/2)2/3

If the validity of this expression causes you doubts, then I propose the following argumentation (I would not like to embark on an exact proof here). Let's assume that the clouds are shaped like cubes. (Cubes are monolithic and three-dimensional objects; with the same success one could take balls, pyramids or any other bodies.) Let the first cloud-cube have a side of meters, and the second - b meters. When the clouds add up, the total cube cloud will have a side of c meters and a volume equal to the sum of the volumes of the original clouds:

Let us assume that the areas of the shadows of the cubes are equal to the areas of their sides (this does not limit the generality of the reasoning). Then for the areas we have the following expressions:

As a result, we obtain the expression

C 3/2 = A 3/2 + B 3/2

But this answer is not correct either, because the clouds are not monolithic.

Cloud dimension

It turns out that the dimension of the clouds is not an integer - 2.3. The correct formula is:

C 2.3/2 = A 2.3/2 + B 2.3/2

As you can see, we have a theory that describes objects of non-integer dimension and there are objects themselves, and we have successfully applied the theory to these objects.

Of course, this formula alone is not enough to predict the weather. In reality, clouds not only merge and separate, they appear and disappear, grow and shrink, change their structure... Our formula describes only one of the components of all possible transformations. But she describes this component correctly.