Some questions about statistical randomness From Wikipedia's statistical randoness:

Global randomness and local randomness are different. Most
philosophical conceptions of randomness are global—because they are
based on the idea that "in the long run" a sequence looks truly
random, even if certain sub-sequences would not look random. In a
"truly" random sequence of numbers of sufficient length, for example,
it is probable there would be long sequences of nothing but zeros,
though on the whole the sequence might be random. Local randomness
refers to the idea that there can be minimum sequence lengths in which
random distributions are approximated. Long stretches of the same
digits, even those generated by "truly" random processes, would
diminish the "local randomness" of a sample (it might only be locally
random for sequences of 10,000 digits; taking sequences of less than
1,000 might not appear random at all, for example).
A sequence exhibiting a pattern is not thereby proved not statistically random. According to principles of Ramsey theory,
sufficiently large objects must necessarily contain a given
substructure ("complete disorder is impossible").

I don't quite understand the meanings of the two sentences in bold.

*

*Does the first sentence mean that something makes a sequence local
random at a longer length, and not local random at a shorter length?
How does the example inside the parenthesis work?


*Does the second sentence mean that a sequence exhibiting a pattern
cannot be proved to be not statistically random? Why?
Thanks
 A: This excerpt uses terms "local randomness" and "global randomness" to distinguish between what can occur with a finite number of samples of a random variable, and the probability distribution or expectation of a random variable.
For example, repeated trials $x_i$ of a Bernoulli random variable (taking values in $\{0,1\}$) with expectation $\theta$ will, as the number of samples of goes to infinity, produce sample mean $\theta$.  That is, $\lim_{n \to \infty} \frac{1}{n} \sum_{i=1}^n x_i = \theta$.  This comes from the law of large numbers.
However, when evaluating the sample mean for finite samples we will get all kinds of values  in $[0,1]$.  In fact there is a finite probability of getting the sample mean to fall in the range $[a,b]$ for any $0 \leq a < b \leq 1$ for any value of $\theta$.
Nothing new here.
However, this excerpt seems to be making the rather obvious point that the larger $n$ is, the more likely we are to see behavior looks "locally random" with "locally random" defined (incorrectly) as exhibiting patterns that are close to the mean (in this example.)  
Thus, I wouldn't burn too many brain cells thinking about this excerpt.  It's not mathematically so precise and is actually misleading about the nature of randomness.
Edit based on comment: @kjetilbhalvorsen +1 to your comment for the historical knowledge. However, I still think the value of these terms is limited and misleading. The tables you're describing seem to make the misleading implication that small samples which have, for example, sample mean far from the actual expected value or perhaps an improbable but certainly possible long sequence of repeated 0's (in my Bernoulli example), somehow exhibit less randomness (by saying they do not exhibit this phony "local randomness"). I can't think of anything more misleading for the budding statistician! 
A: The concept can be neatly illustrated by some executable code.  We begin (in R) by using a good pseudo random number generator to create a sequence of 10,000 zeros and ones:
set.seed(17)
x <- floor(runif(10000, min=0, max=2))

This passes some basic random number tests.  For instance, a t-test to compare the mean to $1/2$ has a p-value of $40.09$%, which allows us to accept the hypothesis that zeros and ones are equally likely.
From these numbers we proceed to extract a subsequence of $1000$ successive values starting at the 5081st value:
x0 <- x[1:1000 + 5080]

If these are to look random, they should also pass the same random number tests.  For instance, let's test whether their mean is 1/2:
> t.test(x0-1/2)

    One Sample t-test

data:  x0 - 1/2 
t = 2.6005, df = 999, p-value = 0.009445
alternative hypothesis: true mean is not equal to 0 
95 percent confidence interval:
 0.01006167 0.07193833 
sample estimates:
mean of x 
    0.041 

The low p-value (less than 1%) strongly suggests the mean is significantly greater than $1/2$.  Indeed, the cumulative sum of this subsequence has a strong upward trend:
> plot(cumsum(x0-1/2))


That's not random behavior!
Comparing the original sequence (plotted as a cumulative sum) to this subsequence reveals what's going on:

The long sequence indeed behaves like a random walk--as it should--but the particular subsequence I extracted contains the longest upward rise among all subsequences of the same length.  It looks like I could have extracted some other subsequences exhibiting "nonrandom" behavior, too, such as the one centered around $9000$ where approximately 20 ones in a row appear!

As these simple analyses have shown, no test can "prove" that a sequence appears random. All we can do is test whether sequences deviate enough from the behaviors expected of random sequences to offer evidence that they are not random.  This is how batteries of random-number tests work: they look for patterns highly unlikely to arise in random number sequences.  Every once in a long while they will cause us to conclude that a truly random sequence of numbers does not appear random: we will reject it an try something else.
In the long run, though--just as we are all dead--any truly random number generator will generate every possible sequence of 1000 digits, and it will do so infinitely many times.  What rescues us from a logical quandary is that we would have to wait an awfully long time for such an apparent aberration to occur.
A: I think the authors of the Wikipedia post are misconstruing randomness. Yes, there might be stretches that appear not to be random, but if the process that created the sequence is truly random, so must be the output. If certain sequences appear to be non random, that is an erroneous perception of the reader (i.e. humans are designed to find patterns). Our ability to see the Big Dipper, and Orion, etc in the night sky is no evidence that the patterns of stars is nonrandom. I agree that randomness often appears nonrandom. If a process generates truly nonrandom patterns for short sequences, it isn't a random process.
I don't think that the process changes at different sample sizes. You increase the sample size, you increase the probability that we see a random sequence that appears to us to be nonrandom. If there is a 10% chance that we would see a pattern in 20 random observations, increasing the total number of observations to 10000 would increase the likelihood that we would see nonrandomness, somewhere.
