Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lib] For showing complexity, use $N \log N$ #1275

Merged
merged 1 commit into from Mar 3, 2017

Conversation

jensmaurer
Copy link
Member

and not $N \log(N)$ or other variants.

Partially addresses #1088.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 20, 2016

Why drop the parentheses? Mathematical function application notation usually uses parentheses; I would find this change both unconventional and unsightly. Note also that we sometimes say things like "log(a - b)" where we need the parentheses anyway.

@jensmaurer
Copy link
Member Author

We say $N \log N$ fairly often (in the containers section); the algorithms section uses $N \log(N)$ more often. This is an attempt to harmonize towards $N \log N$.
My impression is that for single-token arguments in complexity expressions, it is sort-of common to omit the parenthesis, but maybe I'm mistaken.

@godbyk
Copy link
Contributor

godbyk commented Dec 20, 2016

If you end up using nested parentheses (e.g., \bigoh{log(a - b)}$), then you should consider using larger parentheses on the outside (e.g., \mathscr{O}\big(log(a - b)\big)$).

@jensmaurer
Copy link
Member Author

@godbyk: Yes, except I thought math mode would auto-scale such things? Anyway, the uses I've come across in our standard use just "N" or "N log N" and then define what N means in an extra phrase. I haven't come across nested parens, yet, except possibly for \bigoh{\log(N)}, which the proposed patch will fix (by removing the inner set of parens).

@godbyk
Copy link
Contributor

godbyk commented Dec 20, 2016

@jensmaurer I'm afraid there's no such autoscaling. The closest autoscaling would be using \left( and \right), but those won't scale up unless the material inside them exceeds the vertical height of the normal parentheses—and $log(a - b)$ wouldn't. If you wrote $\left( log ( a - \frac{(n-1)n}{2} ) \right)$ then the outer parentheses would autoscale.

@tkoeppe
Copy link
Contributor

tkoeppe commented Dec 20, 2016

You can use \bigl(, \Bigl(, etc. (but only the first one fits on a normal line). But... that should be considered with utmost care and restraint.

and not $N \log(N)$ or other variants.

Partially addresses cplusplus#1088.
@jensmaurer
Copy link
Member Author

Rebased.

@burblebee
Copy link
Contributor

I prefer log(N) to log N so as not to run into ambiguity issues with what log a + b means

@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 2, 2017

@burblebee: See #1088 for the editorial direction.

@zygoloid: This seems ready to merge.

@zygoloid zygoloid merged commit 42c6d5c into cplusplus:master Mar 3, 2017
@jensmaurer jensmaurer deleted the b21 branch March 18, 2017 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants