Find the number of trapeziums that it can be formed with the vertices of a regular polygon of n sides.
I'll be using the American "trapezoids".
This looked quite horrendous when in the queue, much more than D2. Differing angles incorporating 1, 2, ... sides' endpoints, and then having to account for trapezoids that occur in more than one angle (slope), make it more difficult. I'm sure some people would prefer to leave out those trapezoids that are also parallelograms, while others would include them. Those parallelograms also need weeding out of duplicates, so they need to be recognized as parallelograms.
So when it went "live" I wrote a program to actually examine each set of four vertices for a given n-gon, assuring that no trapezoid is either missed or counted twice. Each trapezoid is counted once, and if it's also a parallelogram its also counted in a count of those.
The MATLAB program:
clc
for sides=4:50
tot=0; para=0;
deltaAngle=360/sides;
for vertex=1:sides
angle=(vertex-1)*deltaAngle+3; % tilted 3° to avoid div by zero later
x=cosd(angle); y=sind(angle);
coord(vertex,1)=x; coord(vertex,2)=y;
end
quads=nchoosek([1:sides],4);
for i=1:size(quads)
quad=quads(i,:);
parallelCt=0;
slope1=(coord(quad(1),2)-coord(quad(2),2))/(coord(quad(1),1)-coord(quad(2),1));
slope2=(coord(quad(3),2)-coord(quad(4),2))/(coord(quad(3),1)-coord(quad(4),1));
if abs(slope1-slope2) < .0000001
parallelCt=parallelCt+1;
end
slope1=(coord(quad(1),2)-coord(quad(4),2))/(coord(quad(1),1)-coord(quad(4),1));
slope2=(coord(quad(2),2)-coord(quad(3),2))/(coord(quad(2),1)-coord(quad(3),1));
if abs(slope1-slope2) < .0000001
parallelCt=parallelCt+1;
end
if parallelCt>0
tot=tot+1;
if parallelCt>1
para=para+1;
end
end
end
% disp([sides tot para])
fprintf('%3d %6d %4d
',sides,tot,para)
end
The figure for trapezoids includes the count of parallelograms from column 3.
n trap para
4 1 1
5 5 0
6 9 3
7 21 0
8 30 6
9 54 0
10 70 10
11 110 0
12 135 15
13 195 0
14 231 21
15 315 0
16 364 28
17 476 0
18 540 36
19 684 0
20 765 45
21 945 0
22 1045 55
23 1265 0
24 1386 66
25 1650 0
26 1794 78
27 2106 0
28 2275 91
29 2639 0
30 2835 105
31 3255 0
32 3480 120
33 3960 0
34 4216 136
35 4760 0
36 5049 153
37 5661 0
38 5985 171
39 6669 0
40 7030 190
41 7790 0
42 8190 210
43 9030 0
44 9471 231
45 10395 0
46 10879 253
47 11891 0
48 12420 276
49 13524 0
50 14100 300
I tried looking up 1,5,9,21,30,54 in the OEIS, put came up with nothing.
However, I tried subtracting the parallelograms from the total in each case, and looked up 5,6,21,24 and found
A060423, Number of obtuse triangles made from vertices of a regular n-gon. The triangles are apparently those using the base of the trapezoid and one of the other two vertices. At first I thought that my count of trapezoids should be half of their value, but then realized there are odd values in their list, so the symmetry of the regular figures apparently would find only duplicates if the remaining vertex of the trapezoid were counted separately. (I haven't verified this, but the match in numbers with mine indicate this is so.)
The OEIS gives formulae for the triangles and therefore the non-parallelogram trapezoids:
a(n) = n*(n-1)*(n-3)/8 when n odd; n*(n-2)*(n-4)/8 when n even.
Then to this must be added the parallelograms: (n/2 - 1)*n/4, but only for even n. That adds up to:
n*(n-1)*(n-3)/8 when n is odd
n*(n-2)*(n-4)/8 + (n/2-1)*n/4 when n is even.
Wolfram Alpha simplifies the formula for even to
n * (n - 2) * (n - 3) / 8 when n is even
which works even for n=4.
Edited on February 18, 2021, 12:46 pm
|
Posted by Charlie
on 2021-02-18 10:54:02 |