Closed 1s0m0rph closed 5 years ago
Please think about what strictly monotonically increasing means.
Is that f'(x) has to be greater than zero a part of the definition? I don't see why that's necessary for something to be strictly monotonically increasing.
Please reread the definition in the notebook immediately above the cell you're working on or consult another resource such as https://en.wikipedia.org/wiki/Monotonic_function.
That's what I was referring to. What I don't see is why a differentiable function that is strictly increasing must have its derivative be greater than zero for all x. x^3 is, under that assumption, not strictly increasing. Wouldn't that imply there exists some real a and b such that a < b and a^3 >= b^3? Unless, of course, the derivative being greater than zero is a requirement for a differentiable function to be strictly increasing.
Edit: Got continuous and differentiable mixed up; also forgot a '^3'
Ah, I get your point about that implication when the definition does not involve a limit, but please work with f'(x) > 0 for this question.
Okay, awesome. I'll find a different function then. Thanks for the clarification!
I've found a function that should work for the first question, but the tests don't pass because they run into a division by zero (the function I used is completely flat at x=1, that is, f'(1) = 0). They don't pass, though, because a Python error gets in the way.
The line that throws the error is, quite clearly, the second one listed here. The way the code is written, it seems to me like this try/except block was put there to catch divisions by zero. However, when this happens Python throws a
ZeroDivisionError
and not aFloatingPointError
. From what I can tellFloatingPointError
only ever gets thrown if it's explicitly been enabled (https://docs.python.org/3.6/library/fpectl.html#fpectl.FloatingPointError) afterturnon_sigfpe()
is executed. If that line is executed it looks like Python should throw the error this code seems to be expecting, but otherwise it gives aZeroDivisionError
.Just wanted to know if this was intended so I can look elsewhere for a solution to this problem.