?
Quiz Verified
Autocorrelation
PostedJun 4, 2026
You are trying to optimize generating a simulation of autocorrelated coin flips with p = 0.7. The baseline is simply iterating over each element, using random generation with the previous element's value. Can we do better?
Hints:
think XOR, prefix/suffix operations, vectorization
Extensions:
How to benchmark? What factors affect performance? What if we have more than 2 states?