[Math] Number of triangles inside given n-gon

binomial-coefficientscombinatoricsdiscrete mathematics

How many triangles can be drawn all of whose vertices are vertices of a given n-gon and all of whose sides are diagonals ( not sides ) of the n-gon ?
How many k-gons can be drawn in such a way ?

Best Answer

This is the same as asking how many ways $k$ vertices can be chosen from the $n$-gon such that no two of the chosen vertices are neighbors. If we select one of the $n$ vertices to be the "first" one and write them down in order $$ 1 ~~ 2 ~~ 3 ~~ \cdots ~~ n $$ we must choose $k$ of these numbers such that no neighbors are chosen and such that $1$ and $n$ are not both chosen.

It is convenient to split into two cases: those where vertex $1$ is not among the chosen vertices, and those where it is chosen.

If vertex $1$ is not chosen, we just need to fill out the distribute $k$ blocks of the shape "no yes" and $n-2k$ blocks of the shape "no" into the linear array. There are $\binom{n-k}{k}$ ways to do this.

If vertex $1$ is chosen, then effectively there's a "no yes" block straddling the positions $n$ and $1$. The remaining blocks can be placed in $\binom{n-k-1}{k-1}$ ways.

So the total number of possibilities is $\binom{n-k}{k}+\binom{n-k-1}{k-1}$.

Related Question