Problem 163
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
bunuelo
- Posts: 6
- Joined: Thu Nov 29, 2007 7:26 pm
Problem 163
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.
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.
- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 163 wording
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..
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..
When you assume something, you risk being wrong half the time.
-
bunuelo
- Posts: 6
- Joined: Thu Nov 29, 2007 7:26 pm
Re: Problem 163 wording
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:
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?
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)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?
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Problem 163 wording
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.
Earnestly, I think the one interpretation is so much more natural than the other that there's no need to change the wording.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
bunuelo
- Posts: 6
- Joined: Thu Nov 29, 2007 7:26 pm
Re: Problem 163 wording
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.
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Problem 163 wording
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.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
bunuelo
- Posts: 6
- Joined: Thu Nov 29, 2007 7:26 pm
Re: Problem 163 wording
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?
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?
- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Problem 163 wording
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.
My remarks were mostly tongue in cheek, if I offended you, I apologize and assure you that it was completely unintentional.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
-
bunuelo
- Posts: 6
- Joined: Thu Nov 29, 2007 7:26 pm
-
rbihun
- Posts: 1
- Joined: Sun Feb 10, 2008 5:55 am
Re: Problem 163 wording
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.
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.
- xan
- Posts: 621
- Joined: Sat Jul 28, 2007 12:43 am
- Location: North Carolina, USA
- Contact:
- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 163 wording
To minimize any further misinterpretation, I've added a short paragraph to the description.
Do you think it's adequate?
Do you think it's adequate?
When you assume something, you risk being wrong half the time.
- xan
- Posts: 621
- Joined: Sat Jul 28, 2007 12:43 am
- Location: North Carolina, USA
- Contact: