Let's suppose that your house is located at (0,0)
1 block south from here puts you at (0, -1/16)
1 block east from here now puts you at (1/16, -1/16)
5 blocks north from here puts you at (1/16, 4/16)
2 blocks east from here puts you at (3/16, 4/16)
You have traveled (1/16) ( 1 + 1 + 5 + 2) = 9 / 16 of a mile
The "straightline" distance between (0, 0) and (3/16, 4/16) =
sqrt [ (3/16^2 + (4/16)^2 ] = sqrt [ 25 / 256] = 5/16 of a mile
Your trip would be { 9/16 - 5/16 } equals 4/16 and simplifies equals 1/4 of a mile.
Goodluck and I hope this helped!