Considering in sequence, where N is the number of gunmen and A, B, C, etc. are individual representations of same:
Trivially:
- Where N = 1, all gunmen survive as none can shoot themselves.
- Where N = 2, both gunmen die as no other gunman can be further away.
- Where N = 3, one gunman must live, as:
Let x, y, and z be the distances A->B, B->C, C->A respectively.
If x=y=z (a triangle or 3-sided polygon), then A, B, and C will all shoot the tallest other person. Since no two gunmen have the same height, one gunman will be shot twice and one will not be shot at all as there are only three bullets.
If x>y>z or x>y=z, then A will shoot B, while B and C will shoot each other. (Rotating the distance assignments incorporates all possible combinations of distances between the three gunmen.)
Extended:
- Where N = 4 and for all other even numbers of gunmen, it is possible to trivially create a scenario where pairs of gunmen stand next to each other, yet further away from all others; in this scenario all gunmen die, as it is the instance of N = 2 repeated N/2 times.
- Where N = 5, again one gunman must live:
Let v, w, x, y, and z be the distances between A-B, B-C, etc. respectively (as with N=3).
As with N = 3, if v > w > x > y > z, v > w = x = y = z, or variants of equality where v > (some combination of w,x,y,z), then A will live as no gunman can be closest to A by definition.
If v=w=x=y=z (a 5-sided polygon), then everyone is closest to 2 other people and will shoot the tallest other person. Since no two gunmen have the same height, one must be the tallest, and that person will be shot by both people beside him; since the only way for all gunmen to die is for each gunmen to be shot only once, then someone must live.
This extends out for all odd numbers of gunmen, as the definition of an N-sided polygon is that all the sides (ie distance between gunmen, who are the vertices) be equal. Thus, where N = 101, one gunman must survive.