## What is log² x?

Please compose all posts in Emacs.

Moderators: phlip, Moderators General, Prelates

## What is the correct way to interpret log² x?

log(log x)
9
21%
(log x)²
15
36%
Parsing Error: log² x is inherently ambiguous and should never be used, and anyone who types it is bad and should feel bad.
18
43%

Elmach
Posts: 155
Joined: Sun Mar 13, 2011 7:47 am UTC

### What is log² x?

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.

Flumble
Yes Man
Posts: 2111
Joined: Sun Aug 05, 2012 9:35 pm UTC

### Re: What is log² x?

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.

operator[]
Posts: 155
Joined: Mon May 18, 2009 6:11 pm UTC
Location: Stockholm, Sweden

### Re: What is log² x?

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).

Soupspoon
You have done something you shouldn't. Or are about to.
Posts: 3825
Joined: Thu Jan 28, 2016 7:00 pm UTC
Location: 53-1

### Re: What is log² x?

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...

Elmach
Posts: 155
Joined: Sun Mar 13, 2011 7:47 am UTC

### Re: What is log² x?

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...

Euphonium
Posts: 162
Joined: Thu Nov 12, 2009 11:17 pm UTC
Location: in ur bourgeois bosses' union, agitating ur workers

### Re: What is log² x?

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 '.

Derek
Posts: 2179
Joined: Wed Aug 18, 2010 4:15 am UTC

### Re: What is log² x?

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.

moiraemachy
Posts: 190
Joined: Wed Jan 04, 2012 9:47 pm UTC

### Re: What is log² x?

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".

Demki
Posts: 199
Joined: Fri Nov 30, 2012 9:29 pm UTC

### Re: What is log² x?

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)

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.

Flumble
Yes Man
Posts: 2111
Joined: Sun Aug 05, 2012 9:35 pm UTC

### Re: What is log² x?

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.)

Demki
Posts: 199
Joined: Fri Nov 30, 2012 9:29 pm UTC

### Re: What is log² x?

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...

somitomi
Posts: 681
Joined: Fri Nov 06, 2015 11:21 pm UTC
Location: can be found in Hungary
Contact:

### Re: What is log² x?

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...
—◯-◯
FG Discord