Can I use Nest iteration variable as the variable of Limit?
$begingroup$
Can anybody tell me what is wrong with this:
Limit[Nest[1/(1 + #) &, x0, n], n -> ∞]
nest
$endgroup$
add a comment |
$begingroup$
Can anybody tell me what is wrong with this:
Limit[Nest[1/(1 + #) &, x0, n], n -> ∞]
nest
$endgroup$
2
$begingroup$
The 3rd argument ofNestmust be numeric
$endgroup$
– Coolwater
Nov 18 '18 at 14:02
2
$begingroup$
ThisFixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1]might help.
$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
1
$begingroup$
Or for an exact valuex /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]
$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35
add a comment |
$begingroup$
Can anybody tell me what is wrong with this:
Limit[Nest[1/(1 + #) &, x0, n], n -> ∞]
nest
$endgroup$
Can anybody tell me what is wrong with this:
Limit[Nest[1/(1 + #) &, x0, n], n -> ∞]
nest
nest
edited Nov 18 '18 at 14:20
Αλέξανδρος Ζεγγ
4,2341929
4,2341929
asked Nov 18 '18 at 13:53
pablopablo
162
162
2
$begingroup$
The 3rd argument ofNestmust be numeric
$endgroup$
– Coolwater
Nov 18 '18 at 14:02
2
$begingroup$
ThisFixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1]might help.
$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
1
$begingroup$
Or for an exact valuex /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]
$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35
add a comment |
2
$begingroup$
The 3rd argument ofNestmust be numeric
$endgroup$
– Coolwater
Nov 18 '18 at 14:02
2
$begingroup$
ThisFixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1]might help.
$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
1
$begingroup$
Or for an exact valuex /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]
$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35
2
2
$begingroup$
The 3rd argument of
Nest must be numeric$endgroup$
– Coolwater
Nov 18 '18 at 14:02
$begingroup$
The 3rd argument of
Nest must be numeric$endgroup$
– Coolwater
Nov 18 '18 at 14:02
2
2
$begingroup$
This
FixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1] might help.$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
$begingroup$
This
FixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1] might help.$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
1
1
$begingroup$
Or for an exact value
x /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35
$begingroup$
Or for an exact value
x /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Nest is a functional programming construct whereas Limit works primarily with mathematical expressions. It simply has no way to work with Nest[...].
This can instead be handled by converting the nested expression into a solved recurrence.
recval =
RSolveValue[{f[n] == 1/(1 + f[n - 1]), f[0] == x0}, f[n], n]
(* Out[591]= ((2/(1 + Sqrt[5]))^
n (-2^(1 - n) (1 - Sqrt[5])^n +
2^(1 - n) (1 + Sqrt[5])^n + (1/2 (1 - Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 - Sqrt[5]))^n x0 - (1/2 (1 + Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 + Sqrt[5]))^n x0))/(1 + Sqrt[
5] - ((1 - Sqrt[5])/(1 + Sqrt[5]))^n +
Sqrt[5] ((1 - Sqrt[5])/(1 + Sqrt[5]))^n + 2 x0 -
2 ((1 - Sqrt[5])/(1 + Sqrt[5]))^n x0) *)
Since we are only really interested in integer n I will use DiscreteLimit on this.
dlim = DiscreteLimit[recval, n -> Infinity]
(* Out[592]= (2 + (-1 + Sqrt[5]) x0)/(1 + Sqrt[5] + 2 x0) *)
This is actually independent of initial value:
FullSimplify[dlim]
(* Out[610]= 1/2 (-1 + Sqrt[5]) *)
Another well known way to deduce candidate values for the limit is to solve the fixed point equation.
Solve[x == 1/(1 + x), x]
(* Out[594]= {{x -> 1/2 (-1 - Sqrt[5])}, {x -> 1/2 (-1 + Sqrt[5])}} *)
$endgroup$
$begingroup$
+1 You get the same result withLimit[recval, n -> Infinity] // FullSimplify. Also, it is useful to includeFullSimplifyin definition ofrecval
$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "387"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186238%2fcan-i-use-nest-iteration-variable-as-the-variable-of-limit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Nest is a functional programming construct whereas Limit works primarily with mathematical expressions. It simply has no way to work with Nest[...].
This can instead be handled by converting the nested expression into a solved recurrence.
recval =
RSolveValue[{f[n] == 1/(1 + f[n - 1]), f[0] == x0}, f[n], n]
(* Out[591]= ((2/(1 + Sqrt[5]))^
n (-2^(1 - n) (1 - Sqrt[5])^n +
2^(1 - n) (1 + Sqrt[5])^n + (1/2 (1 - Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 - Sqrt[5]))^n x0 - (1/2 (1 + Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 + Sqrt[5]))^n x0))/(1 + Sqrt[
5] - ((1 - Sqrt[5])/(1 + Sqrt[5]))^n +
Sqrt[5] ((1 - Sqrt[5])/(1 + Sqrt[5]))^n + 2 x0 -
2 ((1 - Sqrt[5])/(1 + Sqrt[5]))^n x0) *)
Since we are only really interested in integer n I will use DiscreteLimit on this.
dlim = DiscreteLimit[recval, n -> Infinity]
(* Out[592]= (2 + (-1 + Sqrt[5]) x0)/(1 + Sqrt[5] + 2 x0) *)
This is actually independent of initial value:
FullSimplify[dlim]
(* Out[610]= 1/2 (-1 + Sqrt[5]) *)
Another well known way to deduce candidate values for the limit is to solve the fixed point equation.
Solve[x == 1/(1 + x), x]
(* Out[594]= {{x -> 1/2 (-1 - Sqrt[5])}, {x -> 1/2 (-1 + Sqrt[5])}} *)
$endgroup$
$begingroup$
+1 You get the same result withLimit[recval, n -> Infinity] // FullSimplify. Also, it is useful to includeFullSimplifyin definition ofrecval
$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
add a comment |
$begingroup$
Nest is a functional programming construct whereas Limit works primarily with mathematical expressions. It simply has no way to work with Nest[...].
This can instead be handled by converting the nested expression into a solved recurrence.
recval =
RSolveValue[{f[n] == 1/(1 + f[n - 1]), f[0] == x0}, f[n], n]
(* Out[591]= ((2/(1 + Sqrt[5]))^
n (-2^(1 - n) (1 - Sqrt[5])^n +
2^(1 - n) (1 + Sqrt[5])^n + (1/2 (1 - Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 - Sqrt[5]))^n x0 - (1/2 (1 + Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 + Sqrt[5]))^n x0))/(1 + Sqrt[
5] - ((1 - Sqrt[5])/(1 + Sqrt[5]))^n +
Sqrt[5] ((1 - Sqrt[5])/(1 + Sqrt[5]))^n + 2 x0 -
2 ((1 - Sqrt[5])/(1 + Sqrt[5]))^n x0) *)
Since we are only really interested in integer n I will use DiscreteLimit on this.
dlim = DiscreteLimit[recval, n -> Infinity]
(* Out[592]= (2 + (-1 + Sqrt[5]) x0)/(1 + Sqrt[5] + 2 x0) *)
This is actually independent of initial value:
FullSimplify[dlim]
(* Out[610]= 1/2 (-1 + Sqrt[5]) *)
Another well known way to deduce candidate values for the limit is to solve the fixed point equation.
Solve[x == 1/(1 + x), x]
(* Out[594]= {{x -> 1/2 (-1 - Sqrt[5])}, {x -> 1/2 (-1 + Sqrt[5])}} *)
$endgroup$
$begingroup$
+1 You get the same result withLimit[recval, n -> Infinity] // FullSimplify. Also, it is useful to includeFullSimplifyin definition ofrecval
$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
add a comment |
$begingroup$
Nest is a functional programming construct whereas Limit works primarily with mathematical expressions. It simply has no way to work with Nest[...].
This can instead be handled by converting the nested expression into a solved recurrence.
recval =
RSolveValue[{f[n] == 1/(1 + f[n - 1]), f[0] == x0}, f[n], n]
(* Out[591]= ((2/(1 + Sqrt[5]))^
n (-2^(1 - n) (1 - Sqrt[5])^n +
2^(1 - n) (1 + Sqrt[5])^n + (1/2 (1 - Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 - Sqrt[5]))^n x0 - (1/2 (1 + Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 + Sqrt[5]))^n x0))/(1 + Sqrt[
5] - ((1 - Sqrt[5])/(1 + Sqrt[5]))^n +
Sqrt[5] ((1 - Sqrt[5])/(1 + Sqrt[5]))^n + 2 x0 -
2 ((1 - Sqrt[5])/(1 + Sqrt[5]))^n x0) *)
Since we are only really interested in integer n I will use DiscreteLimit on this.
dlim = DiscreteLimit[recval, n -> Infinity]
(* Out[592]= (2 + (-1 + Sqrt[5]) x0)/(1 + Sqrt[5] + 2 x0) *)
This is actually independent of initial value:
FullSimplify[dlim]
(* Out[610]= 1/2 (-1 + Sqrt[5]) *)
Another well known way to deduce candidate values for the limit is to solve the fixed point equation.
Solve[x == 1/(1 + x), x]
(* Out[594]= {{x -> 1/2 (-1 - Sqrt[5])}, {x -> 1/2 (-1 + Sqrt[5])}} *)
$endgroup$
Nest is a functional programming construct whereas Limit works primarily with mathematical expressions. It simply has no way to work with Nest[...].
This can instead be handled by converting the nested expression into a solved recurrence.
recval =
RSolveValue[{f[n] == 1/(1 + f[n - 1]), f[0] == x0}, f[n], n]
(* Out[591]= ((2/(1 + Sqrt[5]))^
n (-2^(1 - n) (1 - Sqrt[5])^n +
2^(1 - n) (1 + Sqrt[5])^n + (1/2 (1 - Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 - Sqrt[5]))^n x0 - (1/2 (1 + Sqrt[5]))^n x0 +
Sqrt[5] (1/2 (1 + Sqrt[5]))^n x0))/(1 + Sqrt[
5] - ((1 - Sqrt[5])/(1 + Sqrt[5]))^n +
Sqrt[5] ((1 - Sqrt[5])/(1 + Sqrt[5]))^n + 2 x0 -
2 ((1 - Sqrt[5])/(1 + Sqrt[5]))^n x0) *)
Since we are only really interested in integer n I will use DiscreteLimit on this.
dlim = DiscreteLimit[recval, n -> Infinity]
(* Out[592]= (2 + (-1 + Sqrt[5]) x0)/(1 + Sqrt[5] + 2 x0) *)
This is actually independent of initial value:
FullSimplify[dlim]
(* Out[610]= 1/2 (-1 + Sqrt[5]) *)
Another well known way to deduce candidate values for the limit is to solve the fixed point equation.
Solve[x == 1/(1 + x), x]
(* Out[594]= {{x -> 1/2 (-1 - Sqrt[5])}, {x -> 1/2 (-1 + Sqrt[5])}} *)
answered Nov 18 '18 at 14:44
Daniel LichtblauDaniel Lichtblau
46.9k276163
46.9k276163
$begingroup$
+1 You get the same result withLimit[recval, n -> Infinity] // FullSimplify. Also, it is useful to includeFullSimplifyin definition ofrecval
$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
add a comment |
$begingroup$
+1 You get the same result withLimit[recval, n -> Infinity] // FullSimplify. Also, it is useful to includeFullSimplifyin definition ofrecval
$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
$begingroup$
+1 You get the same result with
Limit[recval, n -> Infinity] // FullSimplify. Also, it is useful to include FullSimplify in definition of recval$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
$begingroup$
+1 You get the same result with
Limit[recval, n -> Infinity] // FullSimplify. Also, it is useful to include FullSimplify in definition of recval$endgroup$
– Bob Hanlon
Nov 18 '18 at 16:16
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f186238%2fcan-i-use-nest-iteration-variable-as-the-variable-of-limit%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
$begingroup$
The 3rd argument of
Nestmust be numeric$endgroup$
– Coolwater
Nov 18 '18 at 14:02
2
$begingroup$
This
FixedPoint[1/(1 + #) &, #] & /@ Range[0., 4, 1]might help.$endgroup$
– Αλέξανδρος Ζεγγ
Nov 18 '18 at 14:17
1
$begingroup$
Or for an exact value
x /. Solve[{1/(1 + x) == x, x > 0}, x][[1]]$endgroup$
– Bob Hanlon
Nov 18 '18 at 14:35