Can you tell the answer? I am getting a huge value :P

0 votes

- ๐ฉ Duplicate | ๐ฎ reboot | ๐ฌ โmerge it here please "https://gateoverflow.in/159677/p-and-c-doubt"โ

7 votes

1 vote

Total possible triangles = $\binom{16}{3}$ = 560

Now we know that if all points are collinear then the triangle is not possible.

So we will simply deduct the cases wherein we are selecting 3 points which are collinear,

**How many groups of 4 collinear points do we have?**

4 horizontal lines + 4 vertical lines + 2 diagonals = 10

So $10*\binom{4}{3}=40$ invalid counts

**How many groups of 3 collinear points do we have?**

Only 4.

So $4*\binom{3}{3}=4$ invalid counts

**Therefore the total number of triangles =**

560 โ (40+4) = 516