# Matlab got this wrong: Limit as n goes to infinity: (1+(i/n))^(n^2). Matlab says it's exp(2), which is wrong. Pls confirm.

조회 수: 8 (최근 30일)
Moses 2024년 5월 22일
편집: Torsten 2024년 5월 27일
Matlab got this wrong: Limit as n goes to infinity: (1+(i/n))^(n^2). Matlab says it's exp(2), which is wrong.
##### 댓글 수: 13이전 댓글 11개 표시이전 댓글 11개 숨기기
Moses 2024년 5월 22일
@Sam Chak, the first one:
syms n
expr1 = (1 + (1i)/n)^(n^2)
VBBV 2024년 5월 22일
@Moses if you are investigating the expr1 as given by @Sam Chak, then from the standard form of limit, defined for n, your expression should be
syms n
limit((1 + (1i)/n^2)^(n^2),n,inf)
ans =

댓글을 달려면 로그인하십시오.

### 채택된 답변

I recommend consulting technical support. It's probably a bug.
##### 댓글 수: 2없음 표시없음 숨기기
Moses 2024년 5월 22일
Yes, it is. Thanks. How can I inform technical support?
Stephen23 2024년 5월 22일

댓글을 달려면 로그인하십시오.

### 추가 답변 (2개)

David Goodmanson 2024년 5월 22일
편집: David Goodmanson 2024년 5월 22일
Hi Moses,
not every expression has a limit, or should. That's the case here, as anyone can check. For large n the function zips around (nearly) a circle, and it's interesting that the circle is not the unit circle but has, for large n, radius e^(1/2) = 1.6487 as a limit.
The plot below brings up a question: why do the lines connecting the points stay near the perimeter of the circle? It seems like the line connecting point n to point n+1 could cut across the circle, but it doesn't happen. This suggests a large-n limit for the angle between point n and point n+1 and that is correct, with a value of 1 radian.
The finite limit e^2 is an error as you said.
n = 1:100;
y = (1+i./n).^(n.^2);
plot(y) % complex plane
##### 댓글 수: 3이전 댓글 1개 표시이전 댓글 1개 숨기기
Torsten 2024년 5월 22일
WolframAlpha returns the expression without modifications. This could either indicate that the software was not able to compute it or (what would be the correct answer) that the limit does not exist.
David Goodmanson 2024년 5월 23일
Hi Moses,
the function does move around a circle in the complex plane, but it is not the unit circle. See the direct numerical calculation in the answer above.
The absolute value of the function is
(abs(1+i/n))^(n^2)
= (sqrt(1+1/n^2))^(n^2)
= ((1+1/n^2)^(1/2))^(n^2)
= ((1+1/n^2)^(n/2))^(1^2) % since (x^a)^b = (x^b)^a = x^(ab)
and since
limit m-->inf (1+1/m)^m = e
the result, which is the radius of the circle, is e^(1/2) as stated in the answer.

댓글을 달려면 로그인하십시오.

James Tursa 2024년 5월 22일
편집: James Tursa 2024년 5월 23일
I have been looking at this for a couple of days now and have finally convinced myself that this limit doesn't exist and MATLAB is in error. Since you are raising a complex number to a potentially fractional power in this limit expression, and such operations are multi-valued for complex numbers, I would question whether the limit should exist at all simply on that basis. But suppose we restrict ourselves to integer n to avoid that discussion. Start with this expression:
(1 + i/n) ^ (n^2)
Extract the magnitude of the inner part so we are left with the form ( r * u ) ^ (n^2) where u is a unit complex number:
[ sqrt(1 + 1/n^2) * (1 + i/n) / sqrt(1 + 1/n^2) ) ] ^ (n^2)
Separate the magnitude out:
sqrt(1 + 1/n^2) ^ (n^2) * [ (1 + i/n) / sqrt(1 + 1/n^2) ) ] ^ (n^2)
Rewrite the magnitude part using 1/2 exponent instead of sqrt():
[ (1 + 1/n^2) ^ (1/2) ] ^(n^2)
Rearrange:
[ (1 + 1/n^2) ^ (n^2) ] ^(1/2)
The limit of the inside part is clearly e, so we have the magnitude converging to:
e^(1/2)
Now for the unit complex number part, we have a point on the complex unit circle raised to a positive integer power, so the result will clearly also be on the complex unit circle. The question is, does this converge to a particular point or not? To examine that, consider the triangle where it came from and just examine the angle of this triangle:
The angle x associated with our unit complex number is the same as the original triangle it came from, so we have:
tan(x) = (1/n) / 1 = 1/n
So
x = atan(1/n)
The taylor series for atan() is:
syms y
taylor(atan(y))
ans =
So for small angles we can just use y, or in our case 1/n.
Since our complex unit vector is raised to the power n^2, we can just multiply that by our small angle to get the expected resulting angle:
(1/n) * n^2 = n
Thus, as n -> infinity, the angle grows without bound.
In conclusion, although the magnitude of the original expression converges to e^(1/2), the angle does not converge, hence the overall limit does not converge. For large n, with a magnitude of e^(1/2) and an angle of n, the original expression (1 + 1i/n)^(n^2) will be pretty close to:
exp(1/2) * (cos(n) + 1i * sin(n)) = exp(1/2 + 1i * n)
##### 댓글 수: 15이전 댓글 13개 표시이전 댓글 13개 숨기기
James Tursa 2024년 5월 27일
편집: James Tursa 2024년 5월 27일
@Torsten Yes I did find that link interesting! And I suspect you are correct as it probably wouldn't be too hard to massage the proof in that link to fit our case (e.g., pick n large enough so that magnitude being close to exp(1/2) is sufficiently < ϵ and then copy the rest of the proof from there). As a consequence, it is also interesting that even though the original set (sequence of points) is countable (since they map to the positive integers), the set of all subsets must be uncountable since a portion of them map to a real dense set of points.
Torsten 2024년 5월 27일
편집: Torsten 2024년 5월 27일
As a consequence, it is also interesting that even though the original set (sequence of points) is countable (since they map to the positive integers), the set of all subsets must be uncountable since a portion of them map to a real dense set of points.
Yes, like the rationals are dense in the reals. Each element of the uncountable set of reals can be approximated by the countable set of the rationals with arbitrary precision.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by