pythagorean-triplet: Describe problem with variable sum N#1395
pythagorean-triplet: Describe problem with variable sum N#1395petertseng merged 1 commit intoexercism:masterfrom petertseng:pytrip
Conversation
| ``` | ||
|
|
||
| There exists exactly one Pythagorean triplet for which a + b + c = 1000. | ||
| Given an input integer N, find all Pythagorean triplets for which `a + b + c = N`. |
There was a problem hiding this comment.
Debatable: whether to explicitly note here that "none" is a possible answer. For example:
all Pythagorean triplets for which
a + b + c = N(possibly zero triplets)
I chose not to since…
- The additional clarification is not necessary for this to be a true statement. Zero triplets is a valid result for the word "all".
- Even if a student were to miss the possibility of zero triplets, it is highly unlikely to be a fatal error requiring a rewrite of the entire implementation upon discovery. The student has already been dealing with a variable number of triplets because the test case for zero triplets comes after the test cases for multiple triplets. Even in a language whose type system prevents the return type from having zero elements, in the only such language I know, making that change is a mere one-character change (change a + to a *)
There was a problem hiding this comment.
the only such language I know
Well, today I learned about http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List-NonEmpty.html . But perhaps I can say that this is likely not the default thing that the student will reach for. So I will stand by the judgment of not explicitly saying "possibly zero"
This is as described in exercism/problem-specifications#1395 The current README will really confuse non math-savvy students, as it asked to find `a*b*c`, while the tests actually check for the triplets. Change it to asks for the triplet explicitly. Give the answer for N = 1000 as it's also spoiled in the test file ;)
coriolinus
left a comment
There was a problem hiding this comment.
This looks entirely reasonable. It's been open for a week without discussion. Is there any reason not to merge this immediately?
|
Given it's been a week, everyone else has missed the boat if they wanted to get on at all. |
This is as described in exercism/problem-specifications#1395 The current README will really confuse non math-savvy students, as it asked to find `a*b*c`, while the tests actually check for the triplets. Change it to asks for the triplet explicitly. Give the answer for N = 1000 as it's also spoiled in the test file ;)
…754) This is as described in exercism/problem-specifications#1395 The current README will really confuse non math-savvy students, as it asked to find `a*b*c`, while the tests actually check for the triplets. Change it to ask for the triplet explicitly. Give the answer for N = 1000 as it's also spoiled in the test file ;)
This form of the problem was ratified in the canonical data
#1332
Closes #1211