In this chapter we apply the scaling theories developed in the one-dimensional system and the infinite-dimensional system to systems of finite dimensions. The lowest dimension with an interesting behavior is two dimensions. Here, we introduce effective ways to measure the cluster number density \(n(s,p)\) in two dimension. We develop the scaling theory for \(n(s,p)\) and demonstrate how to use data-collapse plots as an efficient method to measure the critical exponents. We also demonstrate how we can use the scaling theory for \(n(s,p)\) to derive expressions for the density of the spanning cluster, P, and the average cluster size, S. Finally, we demonstrate how the scaling theory provides scaling relations, that is, relations between exponents, and bounds for the values of the critical exponents.

For the one-dimensional and the infinite-dimensional systems we have been able to find exact results for the percolation probability, \(\varPi (p)\), for \(P(p)\), the probability for a site to belong to an infinite cluster, and we have characterized the behavior using the distribution of cluster sizes, \(n(s,p)\) and its cut-off, \(s_{\xi }\). In both one and infinite dimensions we have been able to calculate these functions exactly. However, in two and three dimensions—which are the most relevant for our world—we are unfortunately not able to find exact solutions. We saw above that the number of configurations in a \(L^d\) system in d-dimensions increases very rapidly with L—so rapidly that a complete enumeration is impossible. But can we still use what we learned from the one and infinite-dimensional systems?

In the one-dimensional case it was simple to find \(\varPi (p,L)\) because there is only one possible path from one side to another. We cannot generalize this to two dimensions, since in two dimensions there are many paths from one side to another—and we need to include all to estimate the probability for percolation. Similarly, it was simple to find \(n(s,p)\) in one dimension, because all clusters only have two neighboring sites and the surface, t, is always of size 2. This is also not generalizable to higher dimensions.

In the infinite-dimensional system, that is in the Bethe lattice, we were able to find \(P(p)\) because we could separate the cluster into different paths that never could intersect except in a single point, because there are no loops in the Bethe lattice. This is not the case in two and three dimensions, where loops always will be possible. When there are loops present, we cannot use the arguments we used for the Bethe lattice, because a branch cut off at one point may be connected again further out. For the Bethe lattice, we could also estimate the multiplicity \(g(s,t)\) of the clusters, the number of possible clusters of size s and surface t, since t was a function of s. In a two- or three-dimensional system this is not similarly simple, because the multiplicity \(g(s,t)\), that is the number of different cluster configurations with size s and surface t, is not simple even in two dimensions, as illustrated in Fig. 4.1.

Fig. 4.1
28 grid structures of various configurations of two-dimensional clusters with sizes ranging from s = 1 to s = 4. These patterns illustrate percolation or clustering phenomena in physics and mathematics. Cells are shaded in different patterns.

Illustration of the possible configurations for two-dimensional clusters of size \(s=1,2,3,4\)

This means that the solution methods used for the one dimensional and the infinite dimensional systems cannot be extended to address two-dimensional or three-dimensional systems. However, several of the techniques and observations we have made for the one-dimensional and the Bethe lattice systems, can be used as the basis for a generalized theory that can be applied in any dimension. Here, we will therefore pursue the more general features of the percolation system, starting with the cluster number density, \(n(s,p)\).

4.1 Cluster Number Density

We have found that the cluster number density plays a fundamental role in our understanding of the percolation problem, and we will use it here as our basis for the scaling theory for percolation.

When we discussed the Bethe lattice, we found that we could write the cluster number density as a sum over all possible configurations of cluster size, s:

$$\displaystyle \begin{aligned} n(s,p) = \sum_{j} p^s (1-p)^{t_j} \; , \end{aligned} $$
(4.1)

where j runs over all different configurations, and \(t:j\) denotes the number of neighbors for this particular configuration. We can simplify this by rewriting the sum to be over all possible number of neighbors, t, and include the degeneracy \(g:{s,t}\), the number of configurations with t neighbors:

$$\displaystyle \begin{aligned} n(s,p) = \sum_{t} g_{s,t} p^s (1-p)^t \; . \end{aligned} $$
(4.2)

The values of \(g:{s,t}\) can be found for smaller values of s. However, while this may give us interesting information about the smaller cluster, and therefore for smaller values of p, it does not help us to develop a theory for the behavior for p close to \(p:c\).

In order to address the cluster number density, we will need to study the characteristics of \(n(s,p)\), for example by generating numerical estimates for its scaling behavior, and then propose a general scaling form which will be tested in various settings.

4.1.1 Numerical Estimation of \(n(s,p)\)

We discussed how to measure \(n(s,p)\) from a set of numerical simulations in Chap. 2. We can use the same method in two and higher dimensions. We estimate \(n(s,p;L)\) using

$$\displaystyle \begin{aligned} \overline{n(s,p;L)} = \frac{N_s}{M \cdot L^d} \; , \end{aligned} $$
(4.3)

where \(N:s\) is the total number of clusters of size s measured for M simulations in a system of size \(L^d\) and for a given value of p. We perform these simulations just as we did in one dimension, using the following program:

The resulting plot of \(\overline {n(s,p;L)}\) for \(L = 200\) is shown in Fig. 4.2. Unfortunately, this plot is not very useful. The problem is that there are too many values of s for which we have little or no data at all. For small values of s we have many clusters for each value of s and the statistics is good. But for large values of s, such as for clusters of size \(s = 10^4\) and above, we have less than one data point for each value of s. Our measured distribution \(\overline {n(s,p;L)}\) is therefore a poor representation of the real \(n(s,p;L)\) in this range.

Fig. 4.2
Two scatter plots of n of s, p versus s. The left graph has data points for linear bins that decline and stabilize along the horizontal axis. The right has data points for linear and logarithmic bins in a decreasing trend. Data points of linear bins are clustered at the end.

Plot of \(n(s,p;L)\) estimated from \(M = 1000\) samples for \(p = 0.58\) and \(L = 200\). (Left) Direct plot. (Right) Log-log plot with linear and logaritmic binning

4.1.2 Measuring Probability Densities of Rare Events

The problem with the measured results in Fig. 4.2 occur because we have chosen a very small bin size for the histogram. For small values of s we want to have a small bin size, since the statistics here is good, but for large values of s we want to have larger bin sizes. This is often solved by using logarithmic binning: We make the bin edges \(a^i\), where a is the basis for the bins and i is bin number. If we chose \(a = 2\) as the basis for the bins, the bin edges will be \(2^0, 2^1, 2^2, 2^3, \ldots \), that is \(1,2,4,8, \ldots \). We then count how many events occur in each such bin. If we number the bins using the index i, then the edges of the bins are \(s_i = a^i\), and the width of bin i is \(\varDelta s_i = s_{i+1} - s_i\). We then count how many events, \(N:i\), occur in the range from \(s:i\) to \(s_i + \varDelta s_i\). The average number of clusters, \(\bar {N}_i\) in each bin in the interval \(\varDelta s_i\) is \(\bar {N}_i = N_i/\varDelta s_i\) for a single realization and \(\bar {N}_i = N_i/(\varDelta s_i M)\) for M realizations. The estimate for the cluster number density in the middle point of the bin, that is for \(\bar {s}_i = (s_{i+1}+s_i)/2\), is

$$\displaystyle \begin{aligned} \overline{n(\bar{s}_i,p;L)} = \frac{\bar{N}_i}{L^d} = \frac{N_i}{M \varDelta s_i L^d} \; . \end{aligned} $$
(4.4)

A common mistake is to forget to divide by the bin size \(\varDelta s_i\) when the bin sizes are not all the same! We implement method by generating an array of all the bin edges. First, we find an upper limit to the bins, that is, we find an \(i:m\) so that

$$\displaystyle \begin{aligned} a^{i_m} > \max (s) \; \Rightarrow \; \log_a a^{i_m} > \log_a \max(s) \; , \end{aligned} $$
(4.5)
$$\displaystyle \begin{aligned} i_m > \log_a \max(s) \; . \end{aligned} $$
(4.6)

We can for example round the right hand side up to the nearest integer

where allarea corresponds to all the s-values. We can then generate an array of indices from 1 to this maximum value

And we can further generate the histogram with this set of bin edges

And calculate the bin sizes and the bin centers

Finally, we calculate the estimated value for \(\overline {n(s,p;L)}\):

The complete code for this analysis is found in the following script

The resulting plot for \(a = 1.2\) is shown in Fig. 4.2. Notice that the logarithmically binned plot is much easier to interpret than the linearly binned plot. You should, however, always reflect on whether your binning method may influence the resulting plot in some way, since there may be cases where your choice of binning method may affect the results you get. Although this is not expected to play any role in your measurements in this book. We will in the following adapt logarithmic binning strategies whenever we measure a dataset which is sparse.

4.1.3 Measurements of \(n(s,p)\) When \(p \rightarrow p_c\)

What happens to \(n(s,p;L)\) when p is close to \(p:c\)? We perform a sequence of simulations for various values of \(p:c\) and plot the resulting values for \(\overline {n(s,p;L)}\). The resulting plot is shown in Fig. 4.3.

Fig. 4.3
2 line graphs. A of log base 10 of n of s, p versus log base 10 of s plots a decreasing trend for p equals 0.45, 0.5, 0.54, 0.57, and 0.58. B of S xi versus p plots a concave-up increasing trend from (0.45, 0) to (0.575, 4 times 10 power 4). Values are estimated.

(a) Plot of \(n(s,p;L)\) as a function of s for various values of p for a \(512 \times 512\) lattice. (b) Plot of \(s_{\xi }(p)\) measured from the plot of \(n(s,p)\) corresponding to the points shown in circles in (a)

Since the plot is double-logarithmic, a straight line corresponds to a power-law behavior, \(n(s,p) \propto s^{-\tau }\). We see that as p approaches \(p:c\) the cluster number density \(n(s,p)\) approaches a power-law. We see that the \(n(s,p)\) curve follows the power-law behavior over some range of s-values, but drops rapidly for larger s-values. This is an effect of the characteristic cluster size, which also can be visually observed in Figs. 1.4 and 1.5, where we see that the characteristic cluster size increases as p approaches \(p:c\). How can we characterize the characteristic cluster size based on this measurement of \(n(s,p)\)? We could measure \(s_{\xi }\) directly from the plot, by drawing a straight line parallel to but below \(n(s,p:c)\), as illustrated in Fig. 4.3. When the measured, \(\overline {n(s,p)}\) intersects this drawn line, \(n(s,p)\) has fallen by a constant factor below \(n(s,p:c)\). We define this as \(s_{\xi }\), and we measure it by reading the values from the s-axis. The resulting set of \(s_{\xi }\) values are plotted as a function of p in Fig. 4.3. We see that \(s_{\xi }\) increases and possibly diverges as p approaches \(p:c\). This is an effect we also found in the one-dimensional and the infinite-dimensional case, where we found that

$$\displaystyle \begin{aligned} s_{\xi} \propto | p - p_c|^{-1/\sigma} \end{aligned} $$
(4.7)

where \(\sigma \) was 1 is one dimension. We will now use this to develop a theory for both \(n(s,p;L)\) and \(s_{\xi }\) based on our experience from one and infinite dimensional percolation.

4.1.4 Scaling Theory for \(n(s,p)\)

When we develop a theory, we realize that we are only interested in the limit \(p \rightarrow p_c\), that is \(|p - p_c| \ll 1\), and \(s \gg 1\). In this limit, we expect \(s_{\xi }\) to mark the cross-over between two different behaviors. There is a common behavior for \(n(s,p)\) for all p-values for small s, up to a cut-off, \(s_{\xi }\), as we also observe in Fig. 4.3: The curves for different p-values are approximately equal for small s.

Based on what we observed in one-dimension and infinite-dimensions, we expect and propose the following scaling form for \(n(s,p)\):

$$\displaystyle \begin{aligned} n(s,p) = n(s,p_c) F(\frac{s}{s_{\xi}}) \;, \end{aligned} $$
(4.8)
$$\displaystyle \begin{aligned} n(s,p_c) = C s^{-\tau} \; , \end{aligned} $$
(4.9)
$$\displaystyle \begin{aligned} s_{\xi} = s_0 | p - p_c|^{-1/\sigma} \; . \end{aligned} $$
(4.10)

Based on the methods presented in this book, we have estimated the exponents for various systems and listed them in Table 4.1. You can find an up-to-date list of all the exponents in the wikipedia article on percolation thresholds at https://en.wikipedia.org/wiki/Percolation_critical_exponents.

Table 4.1 Values for scaling exponents for percolation in 1, 2, 3, 4 and infinite dimensions [8, 37]

We will often simplify the scaling form by writing it on the form:

$$\displaystyle \begin{aligned} n(s,p) = s^{-\tau}F(s/s_{\xi}) = s^{-\tau}F((p-p_c)^{1/\sigma} s) \; {} . \end{aligned} $$
(4.11)

What can we expect from the scaling function \(F(x)\) ?

This is essentially the prediction of a data-collapse. If we plot \(s^{\tau } n(s,p)\) as a function of \(s| p - p_c|^{1/\sigma }\) we would expect to get the scaling function \(F(x)\), which should be a universal curve, as illustrated in Fig. 4.4.

Fig. 4.4
A line graph of log base 10 of n of s, p times s superscript tau versus log base 10 of s vertical bar p minus p c vertical bar to the power of 1 over sigma plots fluctuating trends for p equals 0.45, 0.5, 0.54, 0.57, and 0.58 in an increasing trend initially and fall after negative 1.2 on the x-axis.

A plot of \(n(s,p)s^{\tau }\) as a function of \(|p - p_c|^{1/\sigma } s\) shows that the cluster number density satisfies the scaling ansatz of (4.11)

An alternative scaling form is

$$\displaystyle \begin{aligned} n(s,p) = s^{-\tau} \hat{F}((p - p_c)s^{\sigma}) \; , \end{aligned} $$
(4.12)

where we have introduced the function \(\hat {F}(u) = F(u^{\sigma })\). These forms are equivalent, but in some cases this form produces simpler calculations.

This scaling form should in particular be valid for both the 1d and the Bethe lattice cases—let us check this in detail.

4.1.5 Scaling Ansatz for 1d Percolation

In the case of one-dimensional percolation, we know that we can write the cluster density exactly as

$$\displaystyle \begin{aligned} n(s,p) = (1-p)^2 e^{-s/s_{\xi}} \; . \end{aligned} $$
(4.13)

We showed that we could rewrite this as

$$\displaystyle \begin{aligned} n(s,p) = s^{-2} F(\frac{s}{s_{\xi}}) \; , \end{aligned} $$
(4.14)

where \(F(u) = u^2e^{-u}\). This is indeed on the general scaling form with \(\tau = 2\).

4.1.6 Scaling Ansatz for Bethe Lattice

For the Bethe lattice we found that the cluster density was approximately on the form

$$\displaystyle \begin{aligned} n(s,p) \propto s^{-\tau}e^{-s/s_{\xi}} \; , \end{aligned} $$
(4.15)

which is already on the wanted form, so that

$$\displaystyle \begin{aligned} n(s,p) = s^{-\tau} F(s/s_{\xi}) \; . \end{aligned} $$
(4.16)

4.2 Consequences of the Scaling Ansatz

While the scaling ansatz has a simple form, it has powerful consequences. Here, we address the theoretical consequences of the scaling ansatz, and demonstrate how we can use the scaling ansatz in theoretical arguments. The methods we introduce here are important methods in scaling theories, and we will use them in theoretical arguments throughout this text.

4.2.1 Average Cluster Size

Let us demonstrate how we can use the scaling ansatz to calculate the scaling of the average cluster size, S, and how this can be used to provide limits for the exponent \(\tau \).

Definition of Average Cluster size S

The average cluster size, S, is defined as follows: We point to a random point in the percolation system. What is the average size of the cluster connected to that point? The probability that a random point is part of the cluster of size s is \(s n(s,p)\) and the size of that cluster is s. We find the average cluster by summing over all (finite) clusters, that is from \(s = 1\) to infinity:

$$\displaystyle \begin{aligned} S(p) = \sum_{s=1}^{\infty} s sn(s,p) = \sum_{s=1}^{\infty} s^2 n(s,p) \; . \end{aligned} $$
(4.17)

We assume that we study systems where p is close to \(p:c\) so that the cluster number density \(n(s,p)\) is wide and that its drop-off (crossover) \(s_{\xi }\) is rapid. The sum over s will then be a sum with many non-negligible terms and we can approximate this sum by an integral over s instead:

$$\displaystyle \begin{aligned} S(p) = \sum_{s=1}^{\infty} s^2 n(s,p) \simeq \int_1^{\infty} s^2 n(s,p) \, \mathrm{d} s \; . \end{aligned} $$
(4.18)

We can now insert the scaling ansatz \(n(s,p) = s^{-\tau } F(s/s_{\xi })\), getting:

$$\displaystyle \begin{aligned} S(p) = \int_{1}^{\infty} s^{2 - \tau} F(s/s_{\xi} ) \, \mathrm{d} s \; , \end{aligned} $$
(4.19)

We know that the function \(F(s/s_{\xi })\) goes very rapidly to zero when s is larger than \(s_{\xi }\), and that it is approximately a constant when s is smaller than \(s_{\xi }\). We will therefore approximate \(F(u)\) by a step function which is a constant up to \(u=1\) and then 0 for \(u>1\). Consequently, we only integrate up to \(s_{\xi }\), over a region where \(F(s/s_{\xi })\) is approximately a constant:

$$\displaystyle \begin{aligned} S(p) = \int_{1}^{\infty} s^{2 - \tau} F(s/s_{\xi} ) \, \mathrm{d} s \simeq \int_{1}^{s_{\xi}} C s^{2 - \tau} \, \mathrm{d} s \; . \end{aligned} $$
(4.20)

We solve this integral, finding that

$$\displaystyle \begin{aligned} S(p) = C' s_{\xi}^{3 - \tau} \; , \end{aligned} $$
(4.21)

where \(C'\) is a constant. We insert \(s_{\xi } = |p-p_c|^{-1/\sigma }\), giving:

$$\displaystyle \begin{aligned} S(p) \propto \left(|p-p_c|^{-1/\sigma}\right)^{3-\tau} \propto |p-p_c|^{\frac{3-\tau}{\sigma}} \; . \end{aligned} $$
(4.22)

We recall that \(\gamma \)we is the scaling exponent of \(S(p)\): \(S(p) \propto |p-p_c|^{-\gamma }\). We have therefore found what we call a scaling relation between exponents:

$$\displaystyle \begin{aligned} \gamma = \frac{3 - \tau}{\sigma} \; . \end{aligned} $$
(4.23)

Consequences for \(\tau \)

We have demonstrated that the average cluster size diverges when \(p \rightarrow p_c\), which implies that the exponent \(\gamma \) must be positive. In turn, this implies that

$$\displaystyle \begin{aligned} \gamma > 0 \; \Rightarrow \; \frac{3 - \tau}{\sigma} > 0 \; \Rightarrow \; 3 > \tau \; . \end{aligned} $$
(4.24)

We have therefore found a first bound for \(\tau \): \(\tau <3\). As an exercise, you can check that this relation holds for the one-dimensional system and the Bethe lattice.

4.2.2 Density of Spanning Cluster

We may use a similar argument to find the behavior of \(P(p)\) from the cluster number density, which will give us further scaling relations between exponents and another bound on the exponent \(\tau \).

Relation Between \(P(p)\) and \(n(s,p)\)

We recall the general relation

$$\displaystyle \begin{aligned} \sum_s s n(s,p) + P(p) = p \; . \end{aligned} $$
(4.25)

This equation expresses that a site picked at random is occupied with probability p (right hand side), and that this site must either be in a finite cluster, with a probability corresponding to the sum \(\sum _s sn(s,p)\), or in the infinite cluster with probability \(P(p)\). We can therefore find \(P(p)\) from

$$\displaystyle \begin{aligned} P(p) = p - \sum_s s n(s,p) \; . {} \end{aligned} $$
(4.26)

by calculating the sum on the right hand side.

Finding the Sum Using the Scaling Ansatz

We can find the sum over \(s n(s,p)\) when p is close to \(p:c\) by transforming the sum to an integral and inserting the scaling ansatz \(n(s,p) = s^{- \tau } F(s/s_{\xi })\):

$$\displaystyle \begin{aligned} \sum_{s=1}^{\infty} s n(s,p) \simeq \sum_{s=1}^{\infty} s s^{-\tau} F(s/s_{\xi}) \; . \end{aligned} $$
(4.27)

Again, we approximate the sum with an integral over s:

$$\displaystyle \begin{aligned} \sum_{s=1}^{\infty} s^{1-\tau} F(s/s_{\xi}) \simeq \int_1^{\infty} s^{1-\tau} F(s/s_{\xi}) ds \; . \end{aligned} $$
(4.28)

Here, \(F(s/s_{\xi })\) is approximately a constant when \(s<s_{\xi }\) and goes very rapidly to zero when \(s>s_{\xi }\), so we integrate up to \(s_{\xi }\) assuming that \(F(s/s_{\xi })\) is a constant C up to \(s_{\xi }\), giving

$$\displaystyle \begin{aligned} \int_1^{\infty} s^{1-\tau} F(s/s_{\xi}) ds \simeq \int_1^{s_{\xi}} C s^{1-\tau} ds = c_1 + c_2 s_{\xi}^{2- \tau} \; . \end{aligned} $$
(4.29)

We insert this back into the expression for \(P(p)\) in (4.26) getting:

$$\displaystyle \begin{aligned} P(p) = p - \sum_s sn(s,p) \simeq p - c_1 - c_2 s_{\xi}^{2-\tau} \; . {} \end{aligned} $$
(4.30)

Consequences for \(\tau \)

First, we realize that \(P(p)\) cannot diverge when \(p \rightarrow p_c\). Since \(s_{\xi }\) diverges, this means that the exponent \(2- \tau \) must be smaller than or equal to zero, otherwise \(P(p)\) will diverge. This gives us a new bound for \(\tau \):

$$\displaystyle \begin{aligned} 2- \tau \leq 0 \; \Rightarrow \; 2 \leq \tau \; . \end{aligned} $$
(4.31)

This means that \(\tau \) is bounded by 2 and 3: \(2 \leq \tau < 3\). This is an impressive result from the scaling ansatz.

Relating the Exponents \(\beta \) and \(\tau \)

We can rewrite the expression in (4.30) for \(P(p)\) and insert \(s_{\xi } = s_0 |p-p_c|^{-1/\sigma }\), getting:

$$\displaystyle \begin{aligned} P(p) \simeq p - c_1 - c_2 s_{\xi}^{2-\tau} \simeq (p-p_c) + c_2 \left(| p - p_c |^{-1/\sigma} \right)^{2-\tau} \end{aligned} $$
(4.32)

We realize that when \(p \rightarrow p_c\) the linear term \((p-p:c)\) will be smaller than the term \(|p-p_c|^{(\tau -2)/\sigma }\). And we remember that \(P(p) \propto (p-p_c)^{\beta }\). This gives us a new scaling relation for \(\beta \):

$$\displaystyle \begin{aligned} \beta = \frac{\tau - 2}{\sigma} \; . {} \end{aligned} $$
(4.33)

We have therefore again demonstrated the power of the scaling ansatz by both calculating bounds for \(\tau \) and by finding relations between the scaling exponents.

4.3 Percolation Thresholds

While the exponents are universal and independent of the details of the lattice but dependent on the dimensionality, the percolation threshold, \(p:c\), depends on details of the system such as the lattice type and the type of percolation. We typically discern between site percolation, where neighboring sites on a lattice are connected if present, and bond percolation, where the presence of bonds between the sites determines the connectivity. Table 4.2 provides basic values for the percolation thresholds. These results have been measured with code in this book and therefore have limited precision. You can find an updated set of percolation threshold for various models on the Wikipedia page for percolation at https://en.wikipedia.org/wiki/Percolation_threshold.

Table 4.2 Percolation thresholds for various models

Exercises

Exercise 4.1 (Alternative Way to Analyze Percolation Clusters)

In this exercise we will use python to generate and visualize percolation clusters. We generate a \(L \times L\) matrix of random numbers, and will examine clusters for a occupation probability p.

We generate the percolation matrix consisting of occupied (1) and unoccupied (0) sites, using

We have then produced the array lw that contains labels for each of the connected clusters.

  1. (a)

    Familiarize yourself with labeling by looking at lw, and by studying the second example in the python help system on the image analysis toolbox.

    We can examine the array directly by mapping the labels onto a color-map, using imshow.

    We can extract information about the labeled image using measurements, for example, we can extract an array of the areas of the clusters using

    You can also extract information about the clusters using the skimage.measure module. This provides a powerful set of tools that can be used to characterize the clusters in the system. For example, you can determine if a system is percolating by looking at the extent of a cluster. If the extent in any direction is equal to L, then the cluster is spanning the system. We can use this to find the area of the spanning cluster or to mark if there is a spanning cluster:

  2. (b)

    Using these features, write a program to calculate \(P(p,L)\) for various p for the two-dimensional system.

  3. (c)

    How robust is your algorithm to changes in boundary conditions? Could you do a rectangular grid where \(L_x \gg L_y\)? Could you do a more complicated set of boundaries? Can you think of a simple method to ensure that you can calculate P for any boundary geometry?

Exercise 4.2 (Finding \(\varPi (p,L)\) and \(P(p,L)\))

  1. (a)

    Write a program to find \(P(p,L)\) and \(\varPi (p,L)\) for \(L = 2,4,8,16,32,64,128\). Comment on the number of samples you need to make to get a good estimate for P and \(\varPi \).

  2. (b)

    Test the program for small L by comparing with the exact results from above. Comment on the results?

Exercise 4.3 (Determining \(\beta \))

We know that when \(p>p_c\), the probability \(P(p,L)\) for a given site to belong to the percolation cluster, has the form

$$\displaystyle \begin{aligned} P(p,L) \sim (p - p_c)^{\beta} \; . \end{aligned} $$
(4.34)

Use the data from above to find an expression for \(\beta \). For this you may need that \(p_c = 0.59275\).

Exercise 4.4 (Determining the Exponent of Power-Law Distributions)

In this exercise you will build tools to analyse power-law type probability densities.

Generate the following set of data-points in python:

Your task is to determine the distribution function \(f:Z(z)\) for this distribution.

Hint

The distribution is on the form \(f(u) \propto u^{\alpha }\).

  1. (a)

    Find the cumulative distribution, that is, \(P(Z>z)\). You can then find the actual distribution from

    $$\displaystyle \begin{aligned} f_Z(z) = \frac{d P(Z>z)}{dz} \; . \end{aligned} $$
    (4.35)
  2. (b)

    Generate a method to do logarithmic binning in python. That is, you estimate the density by doing a histogram with bin-sizes that increase exponentially in size.

Hint

Remember to divide by the correct bin-size.

Exercise 4.5 (Cluster Number Density \(n(s,p)\))

We will generate the cluster number density \(n(s,p)\) from the two-dimensional data-set.

Hint 1

The cluster sizes are extracted using area = measurements.sum(z, lw, labelList) as described in a previous exercise.

Hint 2

Remember to remove the percolating cluster.

Hint 3

Use logarithmic binning.

  1. (a)

    Estimate \(n(s,p)\) for a sequence of p values approaching \(p_c = 0.59275\) from above and below.

  2. (b)

    Estimate \(n(s,p:c;L)\) for \(L = 2^k\) for \(k = 4,\ldots ,9\). Use this plot to estimate \(\tau \).

  3. (c)

    Can you estimate the scaling of \(s_{\xi } \sim | p - p_c|^{-1/\sigma }\) using this data-set?

Hint 1

Use \(n(s,p)/n(s,p_c) = F(s/s_{\xi }) = 0.5\) as the definition of \(s_{\xi }\).

Exercise 4.6 (Average Cluster Size)

  1. (a)

    Find the average (finite) cluster size \(S(p)\) for p close to \(p:c\), for p above and below \(p:c\).

  2. (b)

    Determine the scaling exponent \(S(p) \sim | p - p_c|^{-\gamma }\).

  3. (c)

    In what ways can you generate \(S^{(k)}(p)\)? What do you think is the best way?