When converting the lecture from Jupyter I noticed some strange Julia code. It looks like the intention was to modify the π_hat variable, but the function does not actually do that.
So I suspect that the code does not match the math, although the result looks correct. Can you verify this, and modify the code to resolve the comments that I wrote?
What is the π_hat variable? Can we just remove it?