How many triangles with side of lengths in integral cm can we get if length of the greatest side is given to be $2m$ cm

combinatoricsgeometrypermutationsrecursion

How many triangles with side of lengths in integral cm can we get if length of the greatest side is given to be $2m$ cm? Also find how many of the triangle are isosceles and how many of them are equilaterals?

My Thinking:

Let length of other two sides will be $i,j$ and length of third side is $2m$

We know that using triangle inequality

$i+j>2m$ and $i+2m>j$ and $j+2m>i$

Keeping above inequalities in mind

(1) let $i=1$ $\;$ then $j=2m$ only

(2) let $i=2$ $\;$ then $j=2m,2m-1$

(3) let $i=3$ $\;$ then $j=2m,2m-1,2m-2$

$\vdots$

(m) $\;$ let $i=m$ $\;$ then $j=2,2m-1,2m-2, \dots m+1$

(m+1) $\;$ let $i=m+1$ $\;$ then $j=2m,2m-1,\dots,m$ (But here $(m+1,m)$ is overcounted. This case is already counted in previous case)

(m+2) $\:$ let $i=m+2$ $\;$ then $j=2m,2m-1, \dots m-1$ (but here $(m+2,m+1), (m+2,m),(m+2,m-1)$ is overcounted)

Note: Overcounted means I previously already counted.

So total number of such triangle are $(1+2+3+\dots m)+(m+(m-1)+(m-2)+\dots 1)$=$2\cdot \frac{m(m+1)}{2}=m(m+1)$

Is my approach and Answer correct?

Also I don't know how to count number of isosceles triangles.

Can anyone help me in this?

This problem is similar to Number of integer triangles with longest side $2m+1$

Best Answer

Yes, $m(m+1)$ is correct. See the end of this answer.

Also, as Henry commented, there are two types of such isosceles triangles : $(i,i,2m)$ where $m\lt i\leqslant 2m$ and $(i,2m,2m)$ where $1\leqslant i\leqslant 2m$ (Note that an equilateral triangle $(2m,2m,2m)$ is overcounted).

So, the number of such isosceles triangles is $2m-(m+1)+1+2m-1=3m-1$.

The number of such equilateral triangles is $1$.


I would solve the first part as follows (but basically this is almost the same as yours) :

We may assume that $i\leqslant j\leqslant 2m$. This enables us to avoid overcounting.

So, we want to find the number of $(i,j)$ such that

$$\begin{align}&i\leqslant j\leqslant 2m,i+j>2m,i+2m>j,j+2m>i \\\\&\iff i\leqslant j\leqslant 2m,2m-i\lt j,j\lt i+2m,i-2m\lt j \\\\&\iff i\leqslant j\leqslant 2m,2m-i+1\leqslant j,j\leqslant i+2m-1,i-2m+1\leqslant j \\\\&\iff \max(i,2m-i+1,\underbrace{i-2m+1}_{\leqslant\ 1})\leqslant j\leqslant \min(2m,\underbrace{i+2m-1}_{\geqslant\ 2m}) \\\\&\iff \max(i,2m-i+1)\leqslant j\leqslant 2m\tag1\end{align}$$

Case 1 : $i\leqslant 2m-i+1$, i.e. $i\leqslant m$

$$(1)\iff 2m-i+1\leqslant j\leqslant 2m$$ The number of such $j$ is given by $(2m)-(2m-i+1)+1=i$. So, in this case, the number of such $(i,j)$ is $\displaystyle\sum_{i=1}^{m}i$.

Case 2 : $i\gt 2m-i$, i.e. $i\gt m$

$$(1)\iff i\leqslant j\leqslant 2m$$ The number of such $j$ is given by $2m-i+1$. So, in this case, the number of such $(i,j)$ is $\displaystyle\sum_{i=m+1}^{2m}(2m-i+1)$.

Therefore, the answer is $$\sum_{i=1}^{m}i+\sum_{i=m+1}^{2m}(2m-i+1)=\frac{m(m+1)}{2}+\frac{m(m+1)}{2}=m(m+1)$$

Related Question