Jump to content
Sign in to follow this  
Daedalus

Daedalus' Third Challenge

Recommended Posts

I know most of you have seen this problem at one point in time or another. The question normally wants you to count all of the triangles you see in the image. This challenge is not concerned with just counting triangles, but wants the equation which predicts the total number of triangles given [math]n[/math] number of rows.

 

post-51329-0-40454300-1324092924_thumb.jpg

 

The equation uses elementary operators and I will not accept a solution that is based on floor / ceiling, modular arithmetic, or piecewise functions / two part solutions. You must provide a single function which predicts the count of triangles given any number of rows. As with all of my challenges, I will give reputation to the person who can solve this problem before I post the solution within a couple of weeks : )

 

Sorry for all the edits to this post. My initial search on the internet did not reveal a solution to this problem. However, subsequent searches did yield a few solutions. Luckily, I did not find the solution that I have derived and I have modified the rules to narrow down the solution I am looking for. Most of my challenges were solved many years ago, before I had a computer. Back then, I worked most of these problems out by hand or with a TI-88.

Edited by Daedalus

Share this post


Link to post
Share on other sites

 

 

Two parts to this:

 

Part 1: Right-side-up triangles:

 

In general, you will find that if there are n rows of triangles, then there are (n-m+1)(n-m+2)/2 right-side-up triangles of size m.

 

Upside-down triangles:

It turns out that this is effectively equal to right-side-up triangles, but only once you decrease the size of the triangle by m. So you get (n - 2m + 1) (n - 2m + 2)/2.

 

So we have:

[math]\frac{1}{2}(\sum_{m = 1}^n (n - m + 1)(n - m + 2) + \sum_{m = 1}^{m \leq \frac{n}{2}} (n - 2m + 1)(n - 2m + 2))[/math]

There are then two cases: n even or n odd.

 

First: n even:

[math]= \frac{1}{2}(\sum_{m' = 1}^{m' = n} m'(m'+1) + \sum_{m = 1}^\frac{n}{2}(n - 2m + 1)(n - 2m + 2))[/math]

 

[math]= \frac{1}{2}(\frac{1}{3} n(n+1)(n+2) + \sum_{m' = 0}^{\frac{n}{2} - 1} (2m' + 1)(2m' + 2))[/math]

[math]= \frac{n(n + 1)(n + 2)}{6} + \sum_{m' = 0}^{\frac{n}{2} - 1} 2 m' (m' + 1) + m' + 1[/math]

 

[math]= \frac{n(n + 1)(n + 2)}{6} + \frac{2(\frac{n}{2} - 1)\frac{n}{2}(\frac{n}{2} + 1)}{3} + \frac{(\frac{n}{2} - 1)\frac{n}{2}}{2} + \frac{n}{2}[/math]

 

[math] = \frac{n(n + 1)(n + 2)}{6} + \frac{(n - 2)n(n + 2)}{12} + \frac{(n - 2)n}{8} + \frac{n}{2}[/math]

 

[math]= \frac{4n^3 + 12n^2 + 8n + 2n^3 - 8n + 3n^2 - 6n + 12n}{24}[/math]

 

[math]= \frac{2n^3 + 5n^2 + 2n}{8}[/math]

 

Second: n odd:

[math]= \frac{1}{2}(\sum_{m' = 1}^{m' = n} m'(m'+1) + \sum_{m = 1}^\frac{n-1}{2}(n - 2m + 1)(n - 2m + 2))[/math]

 

[math]= \frac{n(n+1)(n+2)}{6} + \frac{1}{2}\sum_1^\frac{n-1}{2}2m'(2m' + 1)[/math]

 

[math]= \frac{n(n+1)(n+2)}{6} +\sum_1^\frac{n-1}{2}2m'(m'+1) - m'[/math]

 

[math]= \frac{n(n+1)(n+2)}{6} + \frac{2\frac{n-1}{2}(\frac{n-1}{2} + 1)(\frac{n-1}{2} + 2)}{3} - \frac{\frac{n-1}{2}(\frac{n-1}{2} + 1)}{2}[/math]

 

[math]= \frac{n(n+1)(n+2)}{6} + \frac{(n-1)(n+1)(n+3)}{12} - \frac{(n-1)(n+1)}{8}[/math]

 

[math]= \frac{4n^3 + 12n^2 + 8n + 2n^3 + 6n^2 - 2n - 6 - 3n^2 + 3}{24}[/math]

 

[math]= \frac{2n^3 + 5n^2 + 2n - 1}{8}[/math]

 

So more generally, the answer is

[math]\frac{2n^3 + 5n^2 + 2n}{8} + \frac{(-1)^n - 1}{16}[/math]

 

 

=Uncool-

Edited by uncool

Share this post


Link to post
Share on other sites

You are unstoppable uncool. Good job!!! I see I'm going to have to come up with an even harder challenge for you. Now let's see you crack part 2 of my second challenge : )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.