Page 1 of 1

Problem 163

Posted: Thu Nov 29, 2007 7:31 pm
by bunuelo
Hello,
I just spend a bit of time thinking that the size 3 triangle in Problem 163 was composed of four size 2 triangles (that is to say, I thought a size n+1 triangle was constructed using three upright size n triangles surrounding one inverted size n triangle), rather than the intended 9 size 1 triangles. It didn't take long to realize that the answer would be too many digits for the textbox, but I don't think anything in the problem text or illustrations favors one interpretation over the other.

Re: Problem 163 wording

Posted: Fri Nov 30, 2007 4:26 am
by rayfil
The description of the problem seems quite clear about what is to be used as the building block, i.e.
Using size 1 triangles as building blocks, larger triangles can be formed.

It may be a bit difficult to interpret that as using a (n-1) triangle as a building block, considering that the size 1 triangle is well identified in the sketch..

Re: Problem 163 wording

Posted: Fri Nov 30, 2007 9:28 am
by bunuelo
Well, in my incorrect interpretation, size 1 triangles are still the "building blocks" of size n triangles. There are just more of them. It's an issue of whether things are built by multiplication or addition. Consider two functions:

Code: Select all

def f(n):
   if n == 1: return 1
   return f(n-1) + f(n-1)

def g(n):
   if n == 1: return 1
   return f(1) + f(n-1)
Both use 1 as "building blocks", in that 1 is the only non-recursive return value of any call to f or g (in fact, it is the only constant mentioned in either function). However, one returns 2n-1 and one returns n.

Anyway, if I'm the only person in the project euler community capable of making this mistake, I suppose it's not a big deal. I know now what it means. Just mentioning my own confusion, borne of my own stupidity. Fair enough?

Re: Problem 163 wording

Posted: Fri Nov 30, 2007 3:09 pm
by daniel.is.fischer
But if a size n triangle were always composed of 4 size (n-1) triangles, wouldn't the natural sizes for the given examples be size 0 and size 1 instead of size 1 and size 2?

Earnestly, I think the one interpretation is so much more natural than the other that there's no need to change the wording.

Re: Problem 163 wording

Posted: Fri Nov 30, 2007 6:44 pm
by bunuelo
It seems that Project Euler 1-indexes most problems, so I don't think size 0 is more likely here than size 1. Problem 151 calls your "size 0" sheet of paper size A5, which not everyone has the domain knowledge to know is defined in an ISO.

Re: Problem 163 wording

Posted: Fri Nov 30, 2007 10:12 pm
by daniel.is.fischer
But an A0 sheet of paper has an area of 2-0m2, an A1 has an area of 2-1m2 and an A5 sheet has - surprise - an area of 2-5m2, so it's a 0-based sequence of sizes.

Re: Problem 163 wording

Posted: Sat Dec 01, 2007 12:56 am
by bunuelo
Again, all fine and good for someone with domain knowledge, but in terms of the problem statement standing alone, the indexing of paper sizes seems either 1-indexed (starting with the biggest sheet A1) or arbitrarily indexed (starting with the smallest sheet A5). The problem statement makes no mention of size A0 paper existing or 'm'.

Oh well, as I said before, I was just mentioning it. I concede that I am dumb and that nobody else could possibly be confused by the wording. Fair enough?

Re: Problem 163 wording

Posted: Sat Dec 01, 2007 1:12 am
by daniel.is.fischer
The fact that you are solving Project Euler problems is a witness against you being dumb. And I agree that the problem wording can be interpreted differently. But I believe the intended interpretation is far more natural, so your misconception would be quite rare (not necessarily unique) and it's easily detectable, as you said you quickly saw the number would be far too large.
My remarks were mostly tongue in cheek, if I offended you, I apologize and assure you that it was completely unintentional.

Re: Problem 163 wording

Posted: Sat Dec 01, 2007 5:32 am
by bunuelo
no sweat-- i wasn't offended at all. and i am pretty dumb, most of the time :)

Re: Problem 163 wording

Posted: Sun Feb 10, 2008 5:59 am
by rbihun
I too, originally thought it was t(2) became the building blocks for t(3) etc..
But i too realized the numbers grew exponentially large (too large for an answer to be correct).

I'm still having trouble with the problem, wish i was better at math (part of why i'm doing these, that and they're fun) I'm just not seeing the whole pattern here, i'm missing something small and probably really obvious.

Re: Problem 163 wording

Posted: Thu Feb 14, 2008 4:38 pm
by xan
I had the same misinterpretation as bunuelo.

Re: Problem 163 wording

Posted: Fri Feb 15, 2008 5:18 am
by rayfil
To minimize any further misinterpretation, I've added a short paragraph to the description.

Do you think it's adequate?

Re: Problem 163 wording

Posted: Fri Feb 15, 2008 2:52 pm
by xan
Works for me! Thanks.