2

I have a circle with N points on it, and I want to determine how many triangles can be formed using these points.

How can I do this?

Thanks!

Andrew

AndrewL
  • 163
  • The vertices of those triangles have to be from these $N$ points, right? – JACKY88 Oct 03 '12 at 20:24
  • @PatrickLi Yes - that is right. – AndrewL Oct 03 '12 at 20:25
  • 1
    The question is unclear. What's the relevance of the points being on a circle ? Please show an example figure and pinpoint the triangles that should be counted. –  Mar 31 '16 at 06:47

2 Answers2

9

Each set of $3$ of the $N$ points determines a triangle, and each triangle is determined in this way, so all you have to do is determine how many $3$-element subsets a set of $N$ things has. If you don’t already know this, you should read this article.

Brian M. Scott
  • 616,228
  • That's one way of interpreting the question. Another (more interesting, in my opinion) is to look at all triangles that can be generated by chords using $N$ points on a circle. For example, with $N=4$ points we have, essentially, divided the circle and its interior into 4 triangular regions, defined by a square and its two diagonals. For $N=5$ we'll have 11 possible triangles (look at $K_5$). If you allow overlapping triangles, you get an even larger number. – Rick Decker Oct 04 '12 at 00:41
  • 1
    @Brian M. Scott: Answer would be NC3 which is nothing but N(N-1)(N-2)/6, am I correct? – Mani Dec 28 '13 at 18:01
  • This helped me a lot with a code challenge at work, thanks! Also, this calculates it for you as a shortcut: https://www.hackmath.net/en/calculator/n-choose-k?n=7&k=3&order=0&repeat=0 – james-see Feb 24 '19 at 19:02
2

The number of triangles that can be formed given N non collinear points is n = N(N-1)(N-2) / 6