Page 1 of 1

What is log² x?

Posted: Mon Apr 03, 2017 4:23 am UTC
by Elmach
This came up in Computer Science : Deliberately Bad Algorithms, and I'm wondering what people think is correct.

I was going to put an undecided/depends on context option, but have decided that that would be a bad idea; choose which one you think is more correct.

----
It's clearly log(log x).
----
As a side note, I believe most people interpret
  • sin2(x) as (sin(x))2 and not sin(sin(x))
  • sin-1(x) as arcsin(x) and not csc(x).
  • log-1(x) as exp(x) = ex and not 1/log x
  • fn(x) as f(f(... (f(x)...)) and not (f(x))n.
I assume this is consensus enough that people will not debate about this; if one wishes, do let the thread know.

Re: What is log² x?

Posted: Mon Apr 03, 2017 10:02 am UTC
by Flumble
It was obvious from context that in that particular instance log^2 n meant (log n)*(log n).
But of course you shouldn't abuse the notation like that -same goes for sin^k n- and log^2 x is log(log x)) in the general case.

Re: What is log² x?

Posted: Mon Apr 03, 2017 2:53 pm UTC
by operator[]
Sensibility aside, I've only ever seen log^2 x as referring to (log x)^2. For example: [1], [2]. I think it's reasonable from an oral perspective: O(N log^2 N) would be pronounced "oh n log squared n" while O(N (log N)^2) would be the rather more ambiguous "oh n log n squared". O(N log log N) doesn't have the same problem, and "log" is shorter than "squared" anyway. Also, "log(x)^2" is a bit ambiguous, and "log^2(x)" can clarify it without having to add extra parenthesis.

For iterated functions I see f(n)(x) more frequently than fn(x).

Re: What is log² x?

Posted: Mon Apr 03, 2017 4:07 pm UTC
by Soupspoon
Apart from differentiating log (n²) from (log n)² in "log en squared", that at least makes sense without overloading the superscript-2's meaning. You cannot "square" a function (rather than the result of a function) and whilst I acknowledge that trig functions are so notated (at least with the likes of sin²(x), but not sin-1(x), and sin-2(x) could therefore be considered confusing), "iterate twice", i.e. "log of log of n", is really the only way I would understand this, without guidance to the contrary.

It doesn't help if it's pronounced as "log squared en", as (unless we're breaking into perhaps some sort of Polish notation - thus log (n²)?), it really should be said as "log twice en" or nothing... Like log-1 is "unlog n", if that weren't "(unstated base) to the power of n", anyways (also highlighting trouble with "logb2(n)" notation), and the reciprocal of the log is often better written otherwise ("1/log n"? "1/log n"? "(log n)-1"? and also a proper TEX layout - according to availability in the medium being written in...).


I'll admit that I've never actually done much log of logging, or else squaring of logging, in a pure maths-theory environment where this may be necessary to understand the inconvenient precedents for (as per trigs). In coding, nested parentheticals make it clear(er!) what is meant, in a different manner. The "in the order of" notation of programming theory just has never required me to delve into this inconvenient version of alternate applications of notation until now... I just have a sense that somebody, somewhere has got it wrong, and obviously it aten't me... ;)

Re: What is log² x?

Posted: Mon Apr 03, 2017 5:54 pm UTC
by Elmach
operator[] wrote:For iterated functions I see f(n)(x) more frequently than fn(x).

This smells like a context issue - I expect f(n)(x) to be the nth derivative without context. Of course, there is no reason to put derivatives inside of big Ohs...

Re: What is log² x?

Posted: Sun Apr 09, 2017 11:48 pm UTC
by Euphonium
Elmach wrote:
operator[] wrote:For iterated functions I see f(n)(x) more frequently than fn(x).

This smells like a context issue - I expect f(n)(x) to be the nth derivative without context. Of course, there is no reason to put derivatives inside of big Ohs...


I've never seen higher-order derivatives expressed in any way other than with '.

Re: What is log² x?

Posted: Thu Apr 13, 2017 1:03 am UTC
by Derek
Euphonium wrote:
Elmach wrote:
operator[] wrote:For iterated functions I see f(n)(x) more frequently than fn(x).

This smells like a context issue - I expect f(n)(x) to be the nth derivative without context. Of course, there is no reason to put derivatives inside of big Ohs...


I've never seen higher-order derivatives expressed in any way other than with '.

That gets unwieldy for large orders or when the order is variable, such as in the definition of a Taylor series. Here's an example on Wikipedia.

Re: What is log² x?

Posted: Thu Apr 13, 2017 1:13 pm UTC
by moiraemachy
Ugh, all 3 answers are equally bad. I'll go with log(log(x)) if it's in print, and (log(x))² if it's handwritten. log(log(x)) is clearly the correct one, but using it as (log x)² is much more useful when writing stuff at hand because "o shit I forgot to open the parenthesis now it's too late wait we totally square functions on trig let's do this".

Re: What is log² x?

Posted: Fri Apr 14, 2017 12:04 am UTC
by Demki
I'd write (log ∘ log)(x), and for variable(or large) function application, something like (on log)(x) and maybe for a given sequence of functions (fm,fm+1,fm+2...,fn-1,fn), I'd write something like (i=mon fi)(x), similar to sigma notation and pi notation for sums and products, the main difference is that composition isn't commutative, so the order of the sequence matters(at least composition is associative so we don't have to worry about that).
I'd use the first function of the sequence as the innermost function
(so fn∘fn-1∘...∘fm+2∘fm+1∘fm for the sequence above)
edit: looks like I am not the first to think about this notation

I don't like fn(x) used for composition, in fact I even prefer not to use it for exponentiation.
f(n)(x) is fine by me for differentiation, since it stands out.
(f(x))n is definitely exponentiation.
f-1(x) for inverse is annoying but I don't have a good alternative.

Re: What is log² x?

Posted: Fri Apr 14, 2017 2:26 am UTC
by Flumble
Analogous with the sums and products it should have some capital greek letter, like E (because ενώνω is the only word related to composition that doesn't start with a σ), instead of a bigger ∘. (Or actually history should be revised and all of sums, products, unions and whatnot should be split into their components: on one hand generating the values, on the other folding them with an operator. But considering the electron's charge is still negative, I won't get my hopes up.)

Re: What is log² x?

Posted: Fri Apr 14, 2017 6:59 pm UTC
by Demki
Well, a bigger ∘ fits with union and intersection notation, and I believe ∘ is closer to sets than to numbers. I also recall seeing + and × used instead of the sigma and pi somewhere - oh right it was a Youtube video talking about notation...

Re: What is log² x?

Posted: Sat Apr 15, 2017 8:51 pm UTC
by somitomi
Elmach wrote:[*]fn(x) as f(f(... (f(x)...)) and not (f(x))n.[/list]

Strange, I've never seen such a notation, although I didn't study math beyond what is necessary for my engineering studies. Well, you learn something every day...