All systems around us change with time. This evolution is described mathematically by specific rules. For instance, a mechanical system obeys Newton's laws of motion, or some laws derived from these basic laws; the current in an electrical circuit obeys a specific differential equation derived from Kirchhoff's laws; and so on.
The simplest form of time evolution is periodic motion. Here the system returns to its initial state after a certain time period, and this cyclic behaviour goes on. Next in complexity comes "quasi-periodic" behaviour, which means the motion is made up of two or more independent periodic motions whose frequencies are not rational multiples of a common frequency. Beyond this there is a succession of more and more complicated kinds of dynamical behaviour, till we reach the level of so-called "chaotic" behaviour. Chaos resembles randomness in several respects. However, there are certain underlying regularities, and these can be specified in quantitative terms.
An important point to remember is that most dynamical systems are in fact chaotic. It might seem that this makes the quantitative description of such systems a hopelessly impossible task. Fortunately, this is not so. Among the regularities buried in the complicated behaviour of chaotic systems, there is an important one called recurrence. Roughly, this means the following: although a chaotic system is not periodic or even quasi-periodic, it turns out that it typically returns to a close neighbourhood of its initial state, if a sufficient amount of time elapses. Such returns do not occur at regular intervals of time, of course. There is in general a statistical distribution of such recurrence times.
The statistics of these recurrence times can provide valuable information on the underlying dynamics. A crucial result of rather general applicability is as follows. Suppose we specify the size of the neighbourhood, a return to which we agree to accept as a recurrence. Then the mean or average time of recurrence to that neighbourhood is simply proportional to the reciprocal of that size. More technically, neighbourhoods are specified by breaking up the entire space in which the dynamics occurs into cells (this is called "coarse graining"); and the "size" a cell is specified mathematically as a certain "measure". The mean time of recurrence to a given cell is then essentially the reciprocal of its measure - a statement that can be established as a rigorous theorem.
This theorem helps us understand in intuitive terms several commonly observed features of dynamical systems. First of all, if the system is not periodic it can never return precisely to its original state, by definition. In other words, the time period cannot be finite. And since the measure of a single point is zero, the mean time of recurrence to that exact initial state (which we can regard as a cell made up of a single point) must be the reciprocal of zero, i.e., it must be infinite. Again, if the cells are made sufficiently large (the coarse graining is really coarse!), the mean time of recurrence will of course become smaller, as one would expect.
A much more profound consequence of the theorem concerns the problem of irreversibility that is an evident property of all the systems we see around us, as long as they are sufficiently large (i.e., they do not consist of just a small number of atoms or molecules). It turns out that we can also quantify the mean recurrence time in terms of the number of degrees of freedom of the system concerned: it is proportional to the exponential of the number of degrees of freedom. Therefore it increases very rapidly as the number of degrees of freedom increases. For the large ("macroscopic") systems we have around us, the number of degrees of freedom is indeed astronomical - typically, of the order of, or larger than, Avogadro's number. The exponential of this is unimaginably large. That is why such systems effectively appear to be irreversible - because the mean times of recurrence in such situations exceed even the age of the universe itself by incredibly large factors!
Ihe example of recurrence chosen for illustration is a "toy" model. The dynamical system here is simply a pair of variables x and y that are restricted to take values between 0 and 1. Any value each variable may take during the course of its evolution is taken "modulo 1", that is, only its fractional part is retained. Thus a value x = 0.025 and a value x = 2.025 are regarded as identical, and so on. Time is measured in discrete steps, n = 0,1,2,.... The rules of evolution are specified as follows. If x(n) and y(n) denote the values of x and y at time n, the values of these variables at time n + 1 are specified recursively in terms of x(n) and y(n) by
x(n+1) = y(n) mod 1
y(n+1) = x(n) + y(n) + 0.5 mod 1
The "mod 1" means just what has already been stated - namely, throw away the integer parts of x and y and retain just the fractional part that lies between 0 and 1. This is equivalent to "folding back" the variables so as to fit them into the interval between 0 and 1; it is a crucial step in obtaining chaotic behaviour in what would otherwise be a relatively simple "linear" system with simple dynamical behaviour.
The coarse graining of this dynamical system consists in breaking up the unit square in the xy plane into finite-sized cells (we could regard them as crude approximations to pixels!) Below, we implement this map starting from the original picture broken up into say, 10x10 pixels, we retain each pixel as it is, and simply evolve the centre of each pixel according to the rules given above, without rotating or otherwise altering any of the contents of each pixel. A recurrence would then correspond to recovering the original picture. When the picture consists of 10x10 pixels(blocks) it returns to its original state after 60 iterations. As we increase the number of pixels, that is, we make the coarse graining finer, the increase in recurrence time will show up in the original picture returning after more than 60 iterations. You will be able to choose block sizes of 5x5, 10x10, 20x20, 30x30 and 40x40. The recurrences occur at 20,60, ,120, >400 respectively. The 30x30 and 40x40 cases are not recommended since they take a while to initialize.