Which one is more complex; $(1-e^a)^{(b^c)}$ or $\frac{e^a \times a^b}{b!}$

48 Views Asked by At

I know this is a simple question but I cannot find an answer for it. I have two functions,

$$1:\ (1-e^a)^{(b^c)}$$

and

$$2:\ \frac{e^a \times a^b}{b!}$$

where $a,c$ are real numbers, $b=1,2,3,...$, $log(e)=1$ and $b!=b(b-1) ... 1$.

which one is more complex in computations for a machine (computer)?

1

There are 1 best solutions below

3
On

Addition is fast compared to multiplication. To tackle this, let's first assume that a and c are also positive integers.

1: To calculate $e^a$ you need $a$ multiplications. To calculate $b^c$ it's $c$ multiplications. Then to raise the base (1-e^a) to the power of (b^c) you need $b^c$ multiplications. Total: $b^c + b + a$ multiplications.

2: In the same manner we get $a + 2b$ multiplications.

Having non-integer exponent is not so straightforward. But anyway I think it won't add much complexity. So it comes to deciding if $b^c>b$.