Define a square of some known size (1x1 should be fine, I think)
Inscribe a circle inside the square
Generate random points inside the square
Look at how many fall inside the square but not the circle, versus the ones that do fall in the circle.
From that, using what you know about the area of the square and circle respectively, the ratio of "inside square but not in circle" and "inside circle" points can be used to set up an equation for the value of pi.
Somebody who's more familiar with this than me can probably fix the details I got wrong, but I think that's the general spirit of it.
For Markov Chains in general, the only thing that jumps to mind for me is generating text for old school IRC bots. :-)
[1]: which is probably not the point of this essay. For for muddying the waters, I have both concepts kinda 'top of mind' in my head right now after watching the Veritasium video.
[1] https://claude.ai/public/artifacts/1b921a50-897e-4d9e-8cfa-0...
Back in like 9th grade, when Wikipedia did not yet exist (but MathWorld and IRC did) I did this with TI-Basic instead of paying attention in geometry class. It's cool, but converges hilariously slowly. The in versus out formula is basically distance from origin > 1, but you end up double sampling a lot using randomness.
I told a college roommate about it and he basically invented a calculus approach summing pixels in columns or something as an optimization. You could probably further optimize by finding upper and lower bounds of the "frontier" of the circle, or iteratively splitting rectangle slices in infinitum, but thats probably just reinventing state of the art. And all this skips the cool random sampling the monte carlo algorithm uses.
In the sample programs there's a big red one... https://www.dangermouse.net/esoteric/piet/samples.html
There's also the IOCCC classic https://www.ioccc.org/1988/westley/index.html
Monte Carlo Value for Pi
Each successive sequence of six bytes is used as 24 bit X and Y co-ordinates within a square. If the distance of the randomly-generated point is less than the radius of a circle inscribed within the square, the six-byte sequence is considered a “hit”. The percentage of hits can be used to calculate the value of Pi. For very large streams (this approximation converges very slowly), the value will approach the correct value of Pi if the sequence is close to random. A 500000 byte file created by radioactive decay yielded:
Monte Carlo value for Pi is 3.143580574 (error 0.06 percent).