Professor showed that random dart throwing can be used to estimate pi. $ \sqrt{x^2 + y^2} < 1 $ to count if in the circle or out of circle.
$ 4 * \frac{\text{number of darts in the circle}}{\text{number of darts}} = \pi $
makes sense because if r = 1, then area of square will be 2x2 = 4 and area of circle will be $\pi$.
2026-07-08
Tech/infrastructure
Xlsx Edit Library
Started working on a library to edit xlsx files that does not break formatting (unlike openpyxl). I was surprised that there aren't any better libraries out there for python. Learnt the structure from python-docx and ppt from scanny, parts factory and using lxml to do surgical edits.
Excel is simlar to word document, all the contents are saved in xml and zipped. It also usese relationships to link all the files together.