Is the following definition of the variance of the number of points correct? I have been asked to calculate "the variance of the number of points" in the following pictures, inside the circles:

I was looking for the definition of "the variance of the number of points" in the literature, which I found this one:
The variance of a set of points is the sum of the squares of the distances from each point to the centroid of the set.
Is this the correct definition of "the variance of the number of points"? (Intuitively, one also expects the division by the number of points, which is absent in this definition.)
EDIT
The pictures are taken from here. For example, it says the variance of the number of points in the left picture scales as $R^2$, but it doesn't give any definition of the variance of the number of points and how it is calculated.
 A: The answer is in a paper by Torquato on hyperuniformity, linked from the Wikipedia page that you cite. In 2 dimensions as in your diagram, it's the variance of the number of particles among multiple random circles of radius $R$ (taken from within a very large area, not a limited area as might be implied by the squares in your diagram).
It's the standard formula for the variance: the difference between the mean of the square of the number of particles and the square of the mean number of particles. Quoting from page 4 of the paper:

the number variance $\sigma_N^2(R) \equiv \left< N(R)^2\right>  - \left< N(R)\right>^2.$

The statistical issue here is that for a Poisson distribution, with independence among all the particles, the number variance equals the mean value. In that case, as the sampled area increases with $R^2$, both the mean number of particles and the variance scale with $R^2$. With a hyperuniform distribution, the variance of the number of particles scales more slowly than that. This can be extended to any d-dimensional Euclidean space.
Your far left example seems to be designed to represent a Poisson distribution. The center example is evidently a hyperuniform but not completely regular distribution; to calculate its variance you would need to know a formula for the distribution or have a simulation. The rightmost example is for a uniform square lattice; Torquato notes that the variance then scales approximately with $R^{d-1}$ (with $R$ in your 2-dimensional case), as the fluctuations among sample are mostly near the boundaries of the sampled regions.
A: I am hopeful that the following code and resulting graph will be helpful. I believe that what you're reading is spreading the points over a wide area and varying where the circle is centered. I believe that it is equivalent to keeping the circle centered at the origin and drawing repeated samples of points. (Do you see why?) If you deviate from independent and uniform marginal distributions along the axes, then there would have to be modifications.
library(ggplot2)
library(dplyr)
set.seed(2021)
N <- 5000 # Number of points in the square [-10, 10] x [-10, 10]
B <- 1000 # Number of times to sample per circle radius
Rs <- seq(0.01, 1, 0.01) # Circle radii
L <- list() # Empty list to hold data frames produced in the upcoming loop
# Loop over the circle radii
#
for (i in 1:length(Rs)){
  
  n_points <- rep(NA, B) # Blank vector to hold number of points within the circle of radius Rs[i], centered at (0, 0)
  
  # Loop B-many times
  #
  for (j in 1:B){
    
    # Sample from independent U(-10, 10) distributions
    #
    x <- runif(N, -10, 10)
    y <- runif(N, -10, 10)
    rs <- sqrt(x^2 + y^2)

    # Count how many points are within the circle of radius Rs[i], centered at (0, 0)
    #
    n_points[j] <- length(which(rs <= Rs[i]))
    
    
  }
  
  # Made one-row data frames of the radius and either variance or mean number of points
  # Add to list L
  # 
  L[[i]] = data.frame(Radius = Rs[i], Value = mean(n_points), Moment = "Mean")
  L[[i + 1*length(Rs)]] = data.frame(Radius = Rs[i], Value = var(n_points), Moment = "Variance")
  # L[[i + 2*length(Rs)]] = data.frame(Radius = Rs[i], Value = sd(n_points), Moment = "Standard Deviation")
  
  if (i %% 5 == 0 | i < 5){
    print(paste(i/length(Rs) * 100, "% complete", sep = ""))
  }
}

# Concatenate the data frames in L 
#
d <- bind_rows(L)

# Plot
#
ggplot(d, aes(x = Radius, y = Value, col = Moment)) +
  geom_line() +
  geom_point() +
  # facet_grid(~Moment, scales = "free_y") +
  theme_bw()


As EdM discussed, the Poisson distribution has equal mean and variance. The graph above almost has equal means and variances, but not quite, so the distribution is not Poisson, right? No! Those are the sample means and sample variances, where we expect some sampling variation. That both follow about the same curve tells me that the population mean and variance are about equal. Something Poisson or at least nearly Poisson seems quite plausible.
(Poisson makes sense to me if there is independence between the axes and uniform marginal distributions. You're essentially asking how many particles are going to pass through a circle, which is what the Poisson distribution is.)
Perhaps you can use some of what I did here to make your own simulation. Particularly if you're showing this to a friend, you may create stronger evidence by running simulations and presenting graphs than by writing a formal mathematical proof; many people like pictures.
A: Per Wikipedia on to quote:

Spatial variability occurs when a quantity that is measured at different spatial locations exhibits values that differ across the locations. Spatial variability can be assessed using spatial descriptive statistics...

In accord with the above, a sampling scheme that may assist is as follows:

*

*Draw a horizontal diameter (an x-axis) for each circle.


*Fit a simple linear (two-parameter) regression model (Least-Squares or perhaps a robust Least-Absolute Deviations model) to predict the x-values (dependent variable) versus the # of the point in the sample (independent variable) as they occur and happen to fall on the diameter.


*Select one of the usual goodness-of-fit metrics for the regression model.


*Rank the circles based on the chosen comparative statistic.
Arguably, a valid spatial variability analysis concurrent with the definition provided above, as to quote, "a quantity that is measured at different spatial locations exhibits values that differ across the locations". Note, clearly an extension from the recommended mean model (which recommended the employment of the distance formula) as compared to a linear model. Likely, in my opinion, more informative than a mean model and executed with a sampling design that is a de facto data-reduction technique (often necessary).
