Is $\log{N}^2$ read as $(\log{N})^2$ or $\log{(N^2)}$?

281 Views Asked by At

Is $\log{N}^2$ read as $(\log{N})^2$ or $\log{(N^2)}$?

How can I write $(\log{N})^2$ without using parenthesis?

3

There are 3 best solutions below

0
On

$\log{N^2}=\log(N^2)$.

$(\log{N})^2=\log^2N$.

2
On

I've seen both. I think most people would say $\log\left(N^2\right)$ is "correct", because in the order of operations, an exponentiation has higher priority than a function application.

However, I have also seen authors write $\log N^2$ and intend $\left(\log N\right)^2$. These authors are avoiding the ugliness of the parentheses in $\left(\log N\right)^2$, and rely on the reader knowing the context of the expression to understand what they mean.

To write $\left(\log N\right)^2$ in a way that doesn't use parentheses and respects the order of operations as I described it above, you only have uglier options: $\log N \log N$ (which is maybe equally problematic without parentheses) or $\log N^{\log N}$.

0
On

In general you can write $f^2(x)=(f(x))^2$ but $f(x^2)$ is not $f^2(x)$ in general.

Here $\log N^2=2\log N=\log(N^2)\neq (\log N)^2=(\log N)\cdot (\log N)$, in general (Obviously equality holds for $N=1$ and $N=e^2$ in base $e$)