FoldPair
FoldPair[f,y0,list]
gives the last element of FoldPairList[f,y0,list].
FoldPair[f,y0,list,g]
gives the last element of FoldPairList[f,y0,list,g].
Examples
open allclose allApplications (2)
Properties & Relations (2)
FoldPair returns the last element of the list returned by FoldPairList:
FoldPair does not return by default the remainder of the process:
Use Last in the fourth argument to get the remainder:
Use Identity in the fourth argument to get both:
Possible Issues (2)
The function in the first argument of FoldPair must return a pair of expressions:
FoldPairList[f,y0,{}] returns an empty list, with no last element:
Therefore FoldPair[f,y0,{}] stays unevaluated:
Text
Wolfram Research (2015), FoldPair, Wolfram Language function, https://reference.wolfram.com/language/ref/FoldPair.html.
CMS
Wolfram Language. 2015. "FoldPair." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FoldPair.html.
APA
Wolfram Language. (2015). FoldPair. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FoldPair.html