Here's how I like to solve my equations: just walk around randomly until I trip over a solution!

I am excited to tell you that I just released the alpha version of my “Pydont's” book, a book that compiles all my “Pydon't” articles. You can get the book at leanpub:

A 3D graph showing the random walk evolution

Random walks (check my older post here) and Diophantine equations are two simple mathematical beasts. After a college seminar, I tried putting them together to make something neat, and came up with this: just pick a Diophantine equation, simulate a random walk, and try to see if the random walk went over any solutions! In this report I briefly go over how I came up with this, and show the code I wrote/some results. The Matlab code is all in here (I also have some Python code about random walks here, check my post!).

In the image above, the blue line represents a path taken by the random walk and in orange/red the nodes tell us how far we are from a solution (the smaller the node, the closer we are). Note that this notion of proximity isn't given by actually computing the distance to a known solution, but just by looking at how similar the two sides of the equation are. The image below shows the evolution of three independent random walks trying to find an example solution of \(\frac{4}n = \frac1x + \frac1y + \frac1z\) with \(n = 25\) (that expression is the expression of the Erdös-Straus conjecture).

Three random walks in 3D

If you liked this article and would like to support the mathspp project, then you may want to buy me a slice of pizza 🍕.

Previous Post Next Post

Blog Comments powered by Disqus.