2n + 2n
is equal to 2n * 2
or 2n * 21
.
That's equivalent to 2n+1
because xm * xn = xm+n
(see note 1 below).
(note 1) As to why this is the case, you can see the reason here:
x2 * x3
= (x * x) * (x * x * x)
= x * x * x * x * x
= x5
Pregunta
If the bases are same and variables are adding , then it becomes like this
^ represent power
X^N + X^N = 2X^N not X^2N
like we take common
X^N(1 + 1) = 2X^N
but in the case 2^N + 2^N = 2^(N+1)
if we take common
2^N(1 + 1) = (2)2^N
How it is becoming
2^(N+1)
I read this formula in a book Data Structures and algorithm analysis in Java 3rd edition. I am confuse.
Thanks
Solución
2n + 2n
is equal to 2n * 2
or 2n * 21
.
That's equivalent to 2n+1
because xm * xn = xm+n
(see note 1 below).
(note 1) As to why this is the case, you can see the reason here:
x2 * x3
= (x * x) * (x * x * x)
= x * x * x * x * x
= x5
Otros consejos
Here the rule for multiplication of powers is applied
X^N * X^N = X^(N+N)
So if we take your example now
2^N + 2^N = 2*(2^N) = 2^1 * 2^N = 2^(1+N) = 2^(N+1)
With extra steps for clarity