You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As in, it's too easy to cheese your way through it, without actually solving it.
Let's consider the top 5 solutions to this exercise, by most submitted:
Sorted by group:
Just using standard math.sqrt. 29 people submitted it.
It's either trying to be funny, or being lazy, or just misunderstanding the exercise. Either way, submitting such a solution doesn't help anybody, including the student. It works and it's valid, but IMO it's not a solution.
Raising the radicand to the power of 1/2.
That's better, but still. Doesn't really teach you anything. It works and it's valid, but again, not a solution.
Looping through all natural numbers until you stumble upon a square root of the radicand.
I think it's obvious that this solution would lead to an infinite loop if a floating point value was passed into it. It works but it's invalid, and obviously not a solution.
Using binary search.
Now, this is pretty creative. Binary search is introduced a few exercises prior to that, which means that you don't actually learn something new with this, but out of the other top 5, this is great (and has also been mentored). It works and is valid, and definitely is a solution.
Suggestions
Add floating point values to the test, as well as natural numbers that aren't squares (e.g. 5, 12, 888).
This would make most of the invalid but currently working solutions fail the test. However, it could also block a lot of perfectly valid solutions. See t/12815.
Make the instructions more verbose.
Specifically, discuss some of the methods that can be used to calculate square roots, show some equations to go off of, etc. The Wikipedia article linked certainly is helpful, but some people might get confused by this.
Mention in the instructions that using math.sqrt isn't welcome.
Usage of standard library functions instead of writing your own code is already discouraged in the instructions for some other exercises. It would certainly be nice to see that under Square Root too.
The text was updated successfully, but these errors were encountered:
As in, it's too easy to cheese your way through it, without actually solving it.
Let's consider the top 5 solutions to this exercise, by most submitted:
Sorted by group:
math.sqrt
. 29 people submitted it.It's either trying to be funny, or being lazy, or just misunderstanding the exercise. Either way, submitting such a solution doesn't help anybody, including the student. It works and it's valid, but IMO it's not a solution.
That's better, but still. Doesn't really teach you anything. It works and it's valid, but again, not a solution.
I think it's obvious that this solution would lead to an infinite loop if a floating point value was passed into it. It works but it's invalid, and obviously not a solution.
Now, this is pretty creative. Binary search is introduced a few exercises prior to that, which means that you don't actually learn something new with this, but out of the other top 5, this is great (and has also been mentored). It works and is valid, and definitely is a solution.
Suggestions
This would make most of the invalid but currently working solutions fail the test. However, it could also block a lot of perfectly valid solutions. See t/12815.
Specifically, discuss some of the methods that can be used to calculate square roots, show some equations to go off of, etc. The Wikipedia article linked certainly is helpful, but some people might get confused by this.
math.sqrt
isn't welcome.Usage of standard library functions instead of writing your own code is already discouraged in the instructions for some other exercises. It would certainly be nice to see that under Square Root too.
The text was updated successfully, but these errors were encountered: