Better HN
topnewbestaskshowjobs
Log inSign up

Sadgrinner

3 karma · joined Jul 2, 2015 (11y ago) · 2 submissions

Submissions

comment 11y ago · link · parent

In all seriousness, the definition of monotonically increasing that I was taught is the same as exists in wikipedia:

"A function is called monotonically increasing (also increasing or non-decreasing), if for all x and y such that x <= y one has f(x) <= f(y).

https://en.wikipedia.org/wiki/Monotonic_function#/media/File...

This definition allows for 'flatness' in a graph, since the derivative does not change sign.

Or, from http://www-history.mcs.st-and.ac.uk/~john/analysis/Lectures/... :

    A sequence f(n) is monotonic increasing if f(n+1) ≥ f(n) for all n ∈ N.
    The sequence is *strictly* monotonic increasing if we have > in the definition instead of ≥.

comment 11y ago · link · parent

Isn't your answer technically wrong, though?

The sequence is not monotonically increasing. It's strictly increasing. If you test [1, 1, 2] or [1, 1, 1] or [1, 2, 2], you'll get "No" answers even though those sequences are monotonically increasing.