Skip to content

Task 2 of the Meltdown exercise should be rephrased. #2565

Closed

Description

@kbuc

Our reactor will Meltdown!

The intervals:

green -> 80-100% efficiency
orange -> 60-79% efficiency
red -> 30-59% efficiency
black -> <30% efficient

are not properly closed. In which interval does the 79.5% fall? And 59.73%?

The exemplar solution does suggest that voltage, current and theoretical_max_power being integers (but why?);
this fact however does not make the percentage_range automatically integer as well.

I see two options:

  1. Casting the percentage_range to integer (but why?), and staying in the integer scope with the existing intervals.
    The integer percentage should then also be mentioned in the instructions.

  2. Keep floating percentage_range and include/exclude left and right interval limits with a proper use of < and <=.

Personally, I would go with the second suggestion, it's much more realistic and let the students also think about the limits.
In both cases, instructions should be updated.

The border cases should also be verified in the tests!

A proposal for rephrasing the intervals:

green -> efficiency of 80% or more,
orange -> efficiency of less than 80% but at least 60%, 
red -> efficiency below 60%, but still 30% or more,
black ->  less than 30% efficient.

I'm happy to do a PR after reaching the agreement between options 1 and 2.

Activity

  1. BethanyG commented on Sep 8, 2021

    @BethanyG
    Member

    @kbuc - excellent catch! Thank you for logging this!

    I am inclined at first glance to go with option 2. BUT. 😄 So if we are going to do option 2, I would want the instructions to be really clear with students, so we don't get solutions that use round or floor or some other funky mechanic. There are always more decimal places, so a limit needs to be a limit of precision as well.

    I'd also suggest that the revised intervals be written as floats (with the expected precision), or otherwise nudge students toward the option that they will want to use => and > appropriately, to account for the infinite amount of numbers between the intervals. And yes, test cases need to be done. 😄

    And I would be happy if you want to take this on! In fact, there is also contention around some of the other tasks in the exercise (see #2535 and #2566 ), which could use some fresh eyes - if you wouldn't mind giving it a full once-over?

  2. added
    claimed 🐾For new exercises being written by contributors and maintainers.
    x:action/improveImprove existing functionality/content
    x:status/claimedSomeone is working on this issue
    on Sep 9, 2021
  3. kbuc commented on Sep 10, 2021

    @kbuc
    ContributorAuthor

    Since the focus of the exercise is on conditionals, I would not complicate with floating point peculiarities. As long as the student uses proper math (normal division, comparison with bounds included or not), the tests should pass.

    I have rewritten the tests to verify more points, especially around the border cases. For this, I discontinued the practice of making a separate test for each combination of input parameters (because that leads to too many overhead and is also slower), but only made 3 tests (one for each function) and looping through the several testing points in each test.

  4. BethanyG commented on Sep 22, 2021

    @BethanyG
    Member

    Closing this as PR2568 has been merged and closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

claimed 🐾For new exercises being written by contributors and maintainers.x:action/improveImprove existing functionality/contentx:status/claimedSomeone is working on this issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions