Strengthen your programming skills with tips and techniques from the experts
![Distances on rectangular grids Visualization of L1 distance matrix for items arranged on a 6 x 6 grid](https://blogs.sas.com/content/iml/files/2018/09/distgrid4-640x336.png)
Given a rectangular grid with unit spacing, what is the expected distance between two random vertices, where distance is measured in the L1 metric? (Here "random" means "uniformly at random.") I recently needed this answer for some small grids, such as the one to the right, which is a 7 x 6