Samin_Mustakim's blog

By Samin_Mustakim, history, 4 hours ago, In English

Problem: There are $$$n$$$ sticks of length $$$1,2,3,...,n$$$. How many incongruent triangles can be formed by using three of the given sticks?

My solution: After solving the problem, I found the number of triangles, $$$x$$$, to be:

$$$\begin{align}x = \sum_{i=1}^{n} i \cdot \left\lceil \frac{i+1}{2} \right\rceil + 2 \cdot \sum_{i=1}^{n} \left\lceil \frac{i+1}{2} \right\rceil - \sum_{i=1}^{n} \left\lceil \frac{i+1}{2} \right\rceil^2 - n(n+1)\newline \end{align}$$$

However, I am not satisfied with this expression. Can it be simplified? (Can we express this equation without using the summation sign?)

  • Vote: I like it
  • -2
  • Vote: I do not like it

»
3 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

I will give you two formulas for the number of scalene triangles with side lengths in $$${1,\dots,n}$$$. The first is

$$$ \frac12\binom n3 -\frac14\binom n2+ \frac14 \left\lfloor \frac n2\right\rfloor,\tag1 $$$

and the second is

$$$ \frac{n(n-2)(2n-5)}{24}-\frac{1+(-1)^{n+1}}{16}.\tag2 $$$

Let $$$\epsilon_n=(1+(-1)^{n+1})/16$$$. Formula $$$(2)$$$ says that $$$\frac{n(n-2)(2n-5)}{24}$$$ is equal to the number of triangles plus $$$\epsilon_n$$$. Since $$$0\le \epsilon_n\le 1/16$$$, this means the number of triangles is given by $$$\lfloor n(n-2)/(2n-5)/24\rfloor$$$.

  • »
    »
    3 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Can you solve it after this part?

    For any integer $$$i$$$: If $$$i$$$ is even, $$$\frac{i+1}{2}$$$ is not an integer, and $$$\left\lceil \frac{i+1}{2} \right\rceil = \frac{i+2}{2}$$$. If $$$i$$$ is odd, $$$\frac{i+1}{2}$$$ is already an integer, so $$$\left\lceil \frac{i+1}{2} \right\rceil = \frac{i+1}{2}$$$. Thus, $$$\left\lceil \frac{i+1}{2} \right\rceil$$$ simplifies to: $$$\left\lceil \frac{i+1}{2} \right\rceil = \frac{i+2}{2}$$$ for even $$$i$$$ and $$$\left\lceil \frac{i+1}{2} \right\rceil = \frac{i+1}{2}$$$ for odd $$$i$$$.