# Pegs, Pick’s and Proof

# BLOG: Heidelberg Laureate Forum

I was recently introduced to a fun app on the iPad (also available as a web app) called Geoboard. It’s a virtual version of the classic pegboard and rubber bands which you might associate with small children learning about shapes – but the whole thing is virtual and you can drag the bands around and attach them to pegs, as well as changing the size of the board. Even though it was intended for kids, it reminded me of a surprising and interesting result.

When making a shape on the pegboard, the corners (vertices) of the shape have to be at one of the pegs, and they’re arranged in a square grid. This is the only constraint – otherwise, the shapes can have as many edges and vertices as you like (one minor issue with real elastic bands is that making something too complicated can result in snapping – not a problem with virtual bands!)

I have a memory of being at school and being tasked with finding the areas of shapes – pretty easy for simple shapes like rectangles, and the area of a triangle is just half the area of the rectangle it’s in (or, if it’s not got a right angle anywhere, it can usually be made up from smaller right-angled triangles) – and I have a distinct recollection of counting squares within a shape drawn on a square grid, and counting half-squares where the lines ran diagonally.

But working out the area this way is too complicated. Surely mathematics has a neat formula I can use that doesn’t involve this much effort? Of course it does.

Pick’s theorem, first described by Georg Alexander Pick in 1899, gives a simple formula for the area of a polygon with integer coordinates for its vertices. The information you need to put into the formula is the following:

- The number of grid points that lie on the boundary of the polygon (including the vertices, and any others that lie along the boundary), called
*p* - The number of grid points that lie in the interior of the polygon, called
*i*.

Given these two pieces of information, Pick’s theorem gives an expression for the area. I’ve created a few examples below (using the Geoboard app!) and written the numbers *p* and *i* for each one along with the area of the polygon. If you fancy a puzzle, see if you can work out the relationship between them – it’s not completely trivial, but you might like to have a play with it before I tell you the answer.

It turns out the area of a polygon can be calculated by adding the number of internal points to half the number of boundary points and then subtracting 1; that is, *area = i + ½ p − 1*. It’s a simple relationship, but not immediately obvious – and it’s also not immediately obvious why it works.

One way to prove it is to start by considering an easy case – a simple rectangle. (The theorem doesn’t apply to polygons with area 0 – they have to have non-zero area, or else they could have any number of boundary points!) Assuming our rectangle is width *a* and length *b*, it’ll have area *ab*; it’ll have boundary points along the edge, and if the edge lengths are *a* and *b* there’ll be *p = 2(a + b)* of them; it’ll also have interior points, of which there’ll be *i = (a-1)×(b-1).* (It’s easy enough to check both of these formulae – if you consider the whole* (a+1)* by *(b+1) *grid of dots and look at the *(a-1)* by *(b-1)* rectangle inside it, they make intuitive sense.)

Then the formula for the area via Pick’s theorem will be

*i + ½ p − 1 = (a-1)×(b-1) + ½ × 2(a+b) – 1*

which works out to just be *ab*, as we already knew.

Similar thought processes can lead you to the conclusion that the area of any right-angled triangle (*½ × ab*, where *a* and* b* are the width and height of the rectangle it sits inside) also obeys this theorem. The only remaining step is to convince yourself that if we take two existing shapes whose areas obey Pick’s theorem, and combine them by sticking them together along one edge, the resulting polygon also obeys the theorem.

Roughly, you can think of this as: if you’re sticking them together along an edge, their areas will be added, and while each will lose the boundary points on the glued-together edge, the resulting shape will gain those as internal points – but each of the boundary points was present on both polygons, so there were twice as many, so the numbers all work out the same.

The same principle works for removing shapes from other shapes, and with these tools, you should be able to build up any polygon, which means the theorem generalises.

Even though this neat little result applies to any 2-dimensional polygon with integer vertices, it sadly doesn’t always work in higher dimensions. There’s a famous counter-example – the Reeve tetrahedron, which is a 3D polyhedron with corners at (0, 0, 0), (1, 0, 0), (0, 1, 0) and (1, 1, r) (where r is any positive integer). While this shape has four corners all at whole number coordinates, no other integer lattice points in 3D lie on the surface or within its interior. The volume of this shape is simply r/6, which means it can have theoretically any volume while still only having four boundary points and zero interior points – so no generalisation of Pick’s theorem to 3D is possible.

If you’d like to find out more about Pick’s theorem, there’s a great video by Kelsey Houston-Edwards over at the PBS Infinite Series YouTube channel, which proves the theorem more thoroughly using the more advanced machinery of the Euler characteristic, and here’s an account by Greg Benedis-Grab of writing a little program to model this theorem.