5 ms·
a lot of words for "the larges number of times a loop/operation might have to run, for a list of size 'n'" honestly the language of maths too often obfuscates
by twelvechairs 13y ago
a lot of words for "the larges number of times a loop/operation might have to run, for a list of size 'n'"
honestly the language of maths too often obfuscates rather than simplifies
- deleted 13y ago[deleted]
- velis_vel 13y agoBecause you've simplified it to the point of being incorrect. First, you've confused big-O, which is an upper bound, with big-theta, which is a strict bound. But leaving that aside, big-O also drops constant factors, and your explanation doesn't. Also, it ignores finitely many 'irregularities', if I have a loop that normally runs n^2 times, except when n=17, 30, or 483, in which case it runs 10 billion times, that's still O(n^2). [That's actually implied by it ignoring constant factors, since you could just crank up the constant to 10 billion/17^2]. Finally, big-O notation describes arbitrary function growth, not just the runtime of some operation when applied to a list. It's used a lot in numerical analysis where you can show that some function can be approximated by, say, x - x^3/6 + x^5/120 + O(x^7).
- twelvechairs 13y agoThanks for the detail - self taught so I'll defer and try to take on board (also written quickly - I'm sure doing no help to my annoyance that sparked the response - the single minded and to me complex approach of most of these explanations - which I'm sure you'll agree many of which make the same mistakes I have) one question though - do you have a source for this 'irregularities' bit? I've never seen that mentioned before at all and a Google hasn't helped. doesn't seem to fit with 'upper bound' and 'worst case'. [edit: also still not sure how you say im confusing for theta. that's what 'the largest number of times it might' was for.]
- velis_vel 13y agoIf you look at the Wikipedia article on big-O notation, it says that f(x) = O(g(x)) if and only if there exists some M > 0 and x_0 such that |f(x)| < M|g(x)| for all x > x_0. The x_0 is what lets you ignore early irregularities; without it, you couldn't say that sin(x) + 1 is O(x) since there's obviously no M such that sin(0) + 1 < M * 0. You're right about the theta thing, my mistake.
- 10098 13y ago> honestly the language of maths too often obfuscates rather than simplifies This is wrong on so many levels, I don't even know where to begin. Mathematical formulas and equations are the ultimate tool for simplification and abstraction, the best that humankind could come up with. Explaining mathematical concepts precisely in natural language can be extremely difficult and time-consuming. The only problem is, you have to learn that language, just like any other language. Otherwise, it's like complaining that Japanese "obfuscates" things because you can't read a sentence in Japanese.
- kitsune_ 13y agoThis is true, however, mathematical notation is often intrinsically linked to its historical origin and might not be the optimal solution from a usability perspective.
- twelvechairs 13y agothe language of maths is precise yes but its still only one way of looking at maths. there's too many people who think because they have rote learned something it is the only way to see it. its like saying you shouldn't read in Japanese because everything can be adequately describednin English.