There are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points.
In other words, find the number of 4-element subsets of these points that can be written as {A, B, C, D\} such that AB||CD,and BC||AD.
No four points are in a straight line.
For example,n=6 and the 6 points are (0,0),(2,0),(4,0),(1,1),(3,1),(5,1) the
number of parallelograms is 5. I can find out the number of parallelograms manually if n is small
but how can I find out the number of parallelograms if n is large? Is there any efficient method? If so,what is the method?
Please explain it in details.
In other words, find the number of 4-element subsets of these points that can be written as {A, B, C, D\} such that AB||CD,and BC||AD.
No four points are in a straight line.
For example,n=6 and the 6 points are (0,0),(2,0),(4,0),(1,1),(3,1),(5,1) the
number of parallelograms is 5. I can find out the number of parallelograms manually if n is small
but how can I find out the number of parallelograms if n is large? Is there any efficient method? If so,what is the method?
Please explain it in details.