Freecodecamp: Poorly worded challenge: Project Euler: Problem 2: Even Fibonacci Numbers

Created on 7 May 2020  路  21Comments  路  Source: freeCodeCamp/freeCodeCamp


Describe your problem and how to reproduce it:
The current challenge description makes it sound like n terms have to be generated while what we're checking for is the current term to be less than n

Add a Link to the page with the problem:
https://www.freecodecamp.org/learn/coding-interview-prep/project-euler/problem-2-even-fibonacci-numbers

first timers only help wanted learn

Most helpful comment

@ChoukseyKhushbu I believe we have already decided not to reword the instruction and instead focus on adding extra tests.

All 21 comments

You do not think this is clear and succinct:

...whose values do not exceed n...find the sum.

I cannot think of a better way to say that. "[F]ind the sum", indicates one number is to be returned. "[V]alues do not exceed _n_", indicates you should not consider a term greater than _n_.

Do you have a suggestion for re-wording?

Nope. I don't. Took me some time to figure it out.

Find the sum of all even Fibonacci numbers less than n

Simple and to the point. (^)

How it is now:

By considering the terms in the Fibonacci sequence whose values do not exceed n, find the sum of the even-valued terms.

Is a very roundabout way of just saying the same thing IMO.

Fair enough. I would be happy with that wording. Do you want to set this up as a _first-timer's_ issue?

I'm not sure about this. The original wording is quite precise and avoids ambiguities about nth Fibonacci number vs the Fibonacci number of value n. In other words, do you mean by an even Fibonacci number? Is 8 an even Fibonacci number?

Why don't we just add some extra tests to make it obvious?

fiboEvenSum(8) should return 10

and

fiboEvenSum(7) should return 2.

The original wording is what initially tripped me.

The original wording is quite precise and avoids ambiguities about nth Fibonacci number vs the Fibonacci number of value n.

This is exactly what I didn't understand after going through the challenge. Maybe it's just me though

It won't be just you.

I think the best approach would be to add extra hints via the tests. Something like

Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10, not 7.

What do you reckon?

I think the best approach would be to add extra hints via the tests

I would think it better to include more info in the instructions section, than in the tests. If we could add some actual numbers to the instructions, that always helps clear-up the _ask_.

In general, sure. However these are coming from Project Euler and we don't (to my knowledge) state anywhere that we've modified them. It does not seem right to imply that they're actually Project Euler problems, when the instructions are no longer the same.

True, I had completely disassociated from Project Euler. In this case, I would prefer if the problems remained as is, else they would either be more of a Project Euler tutorial, or too different to the original.

It won't be just you.

I think the best approach would be to add extra hints via the tests. Something like

Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10, not 7.

What do you reckon?

This works.

In general, sure. However these are coming from Project Euler and we don't (to my knowledge) state anywhere that we've modified them. It does not seem right to imply that they're actually Project Euler problems, when the instructions are no longer the same.

You're right. I think this is worth a discussion.

Okay, cool. I think any broader discussion of Project Euler would be better in its own thread.

As for this one, does anyone have any more thoughts on clarification via tests? If not, I think this would be a good issue for first timers.

Hi @Sky020 , can I take this up as my first contribution?
According to what I've read in the thread, I need to an extra message to the instruction like @ojeytonwilliams suggested. Like Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10, not 7.
Is this ok?

Hello @tosinibrahim96 , You are welcome to take this up. Unfortunately, after re-reading the suggested test text, I think it is a very odd description. I suggest we need something better.

@ojeytonwilliams ,

should return 10, not 7

This sounds so pointless. It makes it sound like our tests are written:

assert(fiboEvenSum(8) === 10 && fiboEvenSum(8) !== 7);

I cannot imagine this is any more clarifying for a user than:

Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10

Shall we add, just one more example in the description?

True. My wording looks a little weird unless already know what's going on. Arguably even then.

Let's go with your wording. I think it conveys what I wanted to, but does so a little better.

I am going to leave a comment here instead of a review on the PR.

It's unclear to me what you guys decided on. Did we want to add an example to the description, like the PR shows. Or an additional test, Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10. I think you wanted an additional test.

Also, I would like to point out that many people will be "tripped up" by many of the descriptions in the Euler and Rosetta sections. Some of these challenges are quite complex and need to be read several times before comprehension - I remember having to read this one more than once. This one is probably on the easier side versus some of the others as well. How much are we willing to alter Rosetta and Euler descriptions to help people understand things?

How about we change the question language to:
Find the sum of the even numbers in the Finonacci sequence such that the numbers are less than or equal to n
and add an extra test
fiboEvenSum(34) should return 44

It's unclear to me what you guys decided on ... Or an additional test, Your function should sum the even-valued Fibonacci numbers: fiboEvenSum(8) should return 10. I think you wanted an additional test.

Sorry for letting this slide - yes, that's what I think should happen.

This one is probably on the easier side versus some of the others as well. How much are we willing to alter Rosetta and Euler descriptions to help people understand things?

Adding extra tests is effectively adding to the description, so I think that's enough. Any more than that and we start diverging from Project Euler while still calling the section 'Project Euler'.

Hello, @thecodingaviator. I am totally new to open source contribution and I want to contribute to this issue.
Can I take this up, if it is still open?
I read the conversation and came up with a suggestion.

How about structuring the question like this -
For a given value n, find the sum of all even numbers in the Fibonacci sequence whose values do not exceed n.

@ChoukseyKhushbu I believe we have already decided not to reword the instruction and instead focus on adding extra tests.

@RandellDawson Okay, I think I may have misunderstood the conversations above. Apologies.

Was this page helpful?
0 / 5 - 0 ratings