1.9 KiB
1.9 KiB
LaTeX Writeup Notes
Claude Aside - RANDU Mathematical Verification
Context: During development, Claude added a mathematical verification to prove RANDU's planar structure beyond just visual inspection.
The Insight: RANDU's fatal flaw isn't just visible in 3D plots - it can be mathematically proven. Every triplet of consecutive values (x_n, x_{n+1}, x_{n+2}) satisfies the linear relationship:
x_{n+2} ≡ 6·x_{n+1} - 9·x_n (mod 2^31)
Why This Matters:
- This equation defines a plane in 3D space
- All RANDU outputs lie on just 15 such parallel planes
- This makes RANDU catastrophically bad for Monte Carlo simulations
- The verification code (see problem1.rs:92-109) proves this relationship holds for every triplet
For LaTeX Writeup: Consider adding this mathematical verification as a proof/aside that:
- Shows the limitation isn't just visual - it's algebraically constrained
- Demonstrates that statistical tests (mean, std dev) alone miss critical structural flaws
- Explains why RANDU fails: deterministic linear constraint reduces 3D space to 15 planes
Cool Factor: This is a case where the AI assistant didn't just visualize the problem - it provided mathematical proof of the underlying structural flaw. The self-checking approach (generating triplets and verifying the constraint) demonstrates both the problem and a rigorous testing methodology.
Other Sections to Include
Problem 1A - Basic LCG Implementation
- Show first 5 random numbers
- Discuss LCG formula: x_{n+1} = (a·x_n + c) mod m
Problem 1B - Comparison
- Good LCG vs RANDU
- Statistics comparison (both look fine!)
- 3D scatter plots (visual difference)
- Mathematical verification (definitive proof)
Figures to Include
good_lcg_3d.png- Uniform 3D distributionrandu_3d.png- Visible planar structure- Consider adding histogram comparison if needed