Предположим, вы соблюдаете последовательность:
7, 9, 0, 5, 5, 5, 4, 8, 0, 6, 9, 5, 3, 8, 7, 8, 5, 4, 0, 0, 6, 6, 4, 5, 3, 3, 7, 5, 9, 8, 1, 8, 6, 2, 8, 4, 6, 4, 1, 9, 9, 0, 5, 2, 2, 0, 4, 5, 2, 8. ..
Какие статистические тесты вы примените, чтобы определить, является ли это действительно случайным? К вашему сведению, это ые цифры π . Итак, являются ли цифры π статистически случайными? Означает ли это что - нибудь сказать о постоянном П ?
random-generation
randomness
Cam.Davidson.Pilon
источник
источник
Ответы:
The US National Institute of Standard has put together a battery of tests that a (pseudo-)random number generator must pass to be considered adequate, see http://csrc.nist.gov/groups/ST/toolkit/rng/stats_tests.html. There are also tests known as the Diehard suite of tests, which overlap somewhat with NIST tests. Developers of Stata statistical package report their Diehard results as a part of their certification process. I imagine you can take blocks of digits ofπ , say in groups of consecutive 15 digits, to be comparable to the double type accuracy, and run these batteries of tests on thus obtained numbers.
источник
Answering just the first of your questions: "What tests would you apply to determine if this [sequence] is truly random?"
How about treating it as a time-series, and checking for auto-correlations? Here is some R code. First some test data (first 1000 digits):
Check the counts of each digit:
Then turn it into a time-series, and run the Box-Pierce test:
which tells me:
Typically you'd want the p-value to be under 0.05 to say there are auto-correlations.
Run
acf(d)
to see the auto-correlations. I've not included an image here as it is a dull chart, though it is curious that the biggest lags are at 11 and 22. Runacf(d,lag.max=40)
to show that there is no peak at lag=33, and that it was just coincidence!P.S. We could compare how well those 1000 digits of pi did, by doing the same tests on real random numbers.
This generates 1000 random digits, does the test, and repeats this 100 times.
So our result was comfortably within the first standard deviation, and pi quacks like a random duck. (I used
set.seed(1)
if you want to reproduce those exact numbers.)источник
It's a strange question. Numbers aren't random.
As a time series of base 10 digits,π is completely fixed.
If you are talking about randomly selecting an index for the time series, and picking that number, sure it's random. But so is the boring, rational number0.1212121212… . In both cases, the "randomness" comes from picking things at random, like drawing names from a hat.
If what you're talking about is more nuanced, as in "If I sequentially reveal a possibly random sequence of numbers, could you tell me if it's a fixed subset fromπ ? And where did it come from?". Well first, though π is not repeating, different random sequences will at least locally align for a small run. That's a number theory result, not a statistical one. As soon as you break, you have to scan on to the next instance of alignment. Computationally it's not tractable to align any random sequence because π could match up to the 2222+1 -th place. Heck even if the sequence did align with π somewhere, doesn't mean it's not random. For instance, I could choose 3 at random, doesn't mean it's the first digit of π .
источник