Problem set — probability and emergence
Problem set: probability and emergence¶
Exam-style problems. Work the first three with a pen before touching a computer; the last five are meant to be finished numerically, in the module’s laboratory notebook.
Throughout, a walk of steps has independent, identically distributed steps with mean and variance , and . Nothing in this problem set carries a unit.
Problem 1 — the binomial from the ground up¶
Write the number of right-steps in coin flips as , where each is 1 with probability and 0 otherwise.
(a) Compute and directly from the definition.
(b) Use additivity of means and of variances to obtain and , stating clearly where independence is used and where it is not.
(c) The walker’s position is . Deduce and , and check that the fair-coin case reproduces .
(d) At fixed , for which value of is largest? Explain in one sentence why that answer is intuitively right.
Problem 2 — de Moivre–Laplace by hand¶
Let with .
(a) Using Stirling’s approximation, show that is stationary at .
(b) Expand to second order about that point and show that the coefficient of is .
(c) Fix the prefactor by requiring the resulting Gaussian to have unit area, and hence obtain
(d) Evaluate both the exact and the approximate for , , and quote the relative error.
(e) Repeat (d) for . Explain why the relative error is now enormous, and say what that implies about using this approximation for rare events.
Problem 3 — deviation, error, and a mean of means¶
A quantity has standard deviation . You measure it times and average.
(a) Show that the standard error of the average is .
(b) You now repeat that whole procedure times, obtaining averages, and average those. What is the standard error of the final number? Show that it depends only on , and explain why that had to be so.
(c) A student reports: “I took 400 measurements, so the standard deviation of my data is .” Identify the error precisely, and state what quantity is equal to .
(d) You need to halve an error bar. By what factor must the number of measurements grow, and what does that imply about buying precision by brute force?
Problem 4 — computational: the exponent for a different step¶
Using thermolab.sampling:
(a) Generate 5000 walkers taking 1024 steps drawn uniformly from , and measure the cloud’s spread at .
(b) Fit the exponent with validation.scaling_exponent and report it with an uncertainty
obtained from a seed study of at least eight seeds.
(c) Compare the measured coefficient with for the uniform step, which you should compute analytically first. State the agreement as a relative error.
(d) Repeat (a)–(c) for the biased coin. Which of the exponent and the coefficient changed, and which did not?
Problem 5 — computational: how often does a walker come home?¶
(a) For a walk, measure the fraction of walkers standing exactly at the origin after steps, for even from 2 to 1024, using at least 104 walkers.
(b) Plot that fraction against on log-log axes and fit the exponent. Explain the value you get in terms of the results derived on the module page. (Hint: the cloud has spread over sites, and the walkers must be distributed among them somehow.)
(c) Explain why the answer to (b) says nothing about whether a walker ever returns to the origin, and why those are genuinely different questions.
(d) Does a walker who has just returned to the origin behave any differently from one who has never left it? Answer from the model specification, then test it numerically.
Problem 6 — challenge: two dimensions¶
A walker takes independent steps in and in , each drawn from the same distribution.
(a) Show analytically that , where is the distance from the origin.
(b) Measure it with random_walk(..., dim=2) and confirm the coefficient 2.
(c) Is the distribution of itself Gaussian? Compute it numerically, and explain what you find. (The distribution of a distance and the distribution of a coordinate are not the same object, and the difference is the point of this part.)
Problem 7 — challenge: measuring the cost of correlation¶
The persistent walk repeats its previous step with probability and otherwise draws afresh.
(a) Show analytically that the correlation between steps separated by is .
(b) Sum the covariance matrix to obtain the long-time variance .
(c) Measure with correlated_walk for
at , and compare with (b). Report each as a
relative error.
(d) Standardise the sums with the correct variance from (b) rather than with , and show that the histogram now matches the Gaussian. State in one sentence what this means about which part of the central limit theorem the correlation actually broke.
Problem 8 — challenge: a failure of a different kind¶
Now replace the steps with draws from a Cauchy distribution (rng.standard_cauchy), whose
steps are independent and identically distributed but have no finite variance.
(a) Estimate the variance of a Cauchy sample of size 103, then of 104, then of 105. Repeat each estimate under several seeds. Describe what happens and explain it.
(b) Build a walk from Cauchy steps and measure the spread of the cloud at using the sample standard deviation. Fit the exponent, then repeat the whole fit under six independent seeds and report the six values you get. What do you conclude about this measurement — not about the walk, but about the estimator?
(c) Measure the spread again with a statistic that does not depend on the tails: the interquartile range. Fit that exponent, again under six seeds. It should be far more reproducible than (b). What power of do you get, and can you show analytically that it is exact? (Hint: what distribution is the sum of independent Cauchy variables?)
(d) Standardise the sums by and plot the histogram for growing . Does it collapse onto anything at all? Now standardise by the power you found in (c) instead, and say what the limit distribution is.
(e) Both this problem and problem 7 break the central limit theorem, but they break different hypotheses and fail in different ways. Contrast them in a short paragraph, and say which of the two you would be more likely to meet without noticing in real data.