{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 255 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 56 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 167 228 12 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "Courier" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "Courier" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 56 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 0 1 0 0 5 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 272 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4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 1 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT 326 34 "DISCOVERING MATHEMATICS WITH MA PLE" }{TEXT 325 0 "" }}{PARA 258 "" 0 "" {TEXT 327 77 "An Interactive \+ Exploration for Mathematicians, Engineers, and Econometricians" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT 290 34 "Chapte r 2. Functions and Sequences" }{TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT -1 0 "" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 29 "A Tricky Probabil ity Function" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 397 "One of the objectives of the present Maple session is to show \+ what we can find out about the mathematical functions known to Maple a nd their properties. Although we considered this briefly in the first \+ chapter, here we intend to present a more systematic approach. Further we shall learn to construct our own functions and use Maple to extrac t information from the definitions of these functions. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 22 "Mathematical Functions" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "A rather long list of the initially-known mathematical function s is given by the command " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "?inifcns" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 663 "You will undoubtedly recognize some of these Maple fun ctions, but others may be less well-known. The most elementary of math ematical functions, the polynomial and rational functions, are missin g from this list. There is an obvious reason for this. Indeed, the de finition of these functions only involves the standard arithmetic oper ations of addition, subtraction, multiplication and division. We have \+ learned from the first chapter's two worksheets that Maple has a perfe ct understanding of these standard operations, even if indeterminate q uantities are involved in the arithmetic expressions concerned. Polyno mial functions are easy to define, are they not? " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "polynomial(x ) := x^7 - x^5 + 4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "poly nomial(t), polynomial(1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "App arently it is not possible to simply substitute values for " } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 15 " in polynomial(" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 79 ") in the same way we generally use fo r functions. Let us try another approach. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "polynomial_express ion := x^7 - x^5 + 4;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 98 "We wond er whether this truly is a function in the sense of a 'function prescr iption'. There is no " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 103 " in the left-hand side, so how can it be a function description? What doe s Maple have to say about it? " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "whattype(polynomial_expressi on);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "This output indicates t hat " }{TEXT 266 1 " " }{TEXT 256 21 "polynomial_expression" }{TEXT -1 121 " is an expression sequence of type + (addition). In order to obtain a function (prescription) from an expression like " }{TEXT 257 21 "polynomial_expression" }{TEXT 267 1 " " }{TEXT -1 44 "- that i s the prescription which assigns to " }{XPPEDIT 18 0 "x" "6#%\"xG" } {TEXT -1 25 " the expression given by " }{TEXT 268 1 " " }{TEXT 258 21 "polynomial_expression" }{TEXT 269 1 " " }{TEXT -1 127 "- we have t o somehow invert the assigning process. In the usual functional termi nology, instead of applying the prescription " }{XPPEDIT 18 0 "f" "6# %\"fG" }{TEXT -1 6 " to " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 22 ", we have to extract " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 22 " \+ from the expression " }{XPPEDIT 18 0 "f" "6#%\"fG" }{TEXT -1 1 "(" } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 58 "). This inverse process ther efore has been given the name " }{TEXT 259 7 "unapply" }{TEXT -1 1 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "polynomial := unapply(polynomial_expression,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 200 "The form of the output tells us that he re we are dealing with a function prescription. Indeed, we immediately recognize the arrow notation generally used for mathematical function s. The verifications " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "type(polynomial_expression,procedure); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "type(polynomial,procedure);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 "confirm that " }{TEXT 260 21 " polynomial_expression" }{TEXT 271 1 " " }{TEXT -1 13 " is not and " } {TEXT 261 10 "polynomial" }{TEXT 270 1 " " }{TEXT -1 70 " is a procedu re. Further, it is clear from the following output that " }{TEXT 262 10 "polynomial" }{TEXT -1 46 " is a traditional mathematical function and " }{TEXT 263 21 "polynomial_expression" }{TEXT -1 10 " is not. \+ " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "polynomial(t);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "polynomia l_expression(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "Observe t hat in view of the latter, Maple has the impression that " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 31 " is meant to be dependent on " } {XPPEDIT 18 0 "t" "6#%\"tG" }{TEXT -1 1 "!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 101 "As Maple sees a function merel y as a procedure, we can use the procedural form to define a function. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "f := proc(x) x^7 - x^5 + 4 end;" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 32 "evalb(polynomial(t) - f(t) = 0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 244 "To build complex functions from element ary ones, we normally use addition, multiplication, and composition of the corresponding function prescriptions. So does Maple. A couple of \+ examples should clarify this point. Note the use of parentheses. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "(sin+log)(t); (sin*log)(t); (sin@log)(t); (f@@3)(t);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 264 1 "@" }{TEXT -1 59 " operator is used for function compo sition. In particular, " }{TEXT 291 1 "(" }{TEXT 265 4 "f@@3" }{TEXT 292 4 ")(t)" }{TEXT -1 26 " has the same meaning as " }{TEXT 274 2 "f " }{TEXT -1 2 "( " }{TEXT 272 1 "f" }{TEXT -1 2 " (" }{TEXT 273 2 "f \+ " }{TEXT -1 37 "(t))), which is commonly written as " }{XPPEDIT 18 0 "f^3" "6#*$%\"fG\"\"$" }{TEXT -1 6 "(t). \n" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 36 "Investigating a Probabi lity Function" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 256 "In our next example we shall meet a function the behavio ur and fundamental properties of which cannot be directly read from it s prescription. All the same, this function is not really contrived, o n the contrary, the underlying idea is quite a natural one. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 56 "Consider the fo llowing rather daring betting game. Let " }{XPPEDIT 18 0 "x" "6#%\"xG " }{TEXT -1 83 " denote our entire present working capital, expresse d in some suitable unit (0 < " }{XPPEDIT 18 0 "x;" "6#%\"xG" }{TEXT -1 82 " < 1). Our objective is to increase this as quickly as possible to 1. Hence, when " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 103 " = 1 \+ is reached, we have won, and there the game ends. The way we play this game is as follows. If 0 < " }{XPPEDIT 18 0 "x <= 1/2;" "6#1%\"xG*&\" \"\"F&\"\"#!\"\"" }{TEXT -1 30 " we stake our entire capital " } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 37 ". In case of a win, we have gained " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 18 " and so we have 2" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 159 " to bet with in the ne xt round. In case we lose, everything is lost and the game has to stop because there is nothing left to bet with. On the other hand, if " } {XPPEDIT 18 0 "1/2 < x;" "6#2*&\"\"\"F%\"\"#!\"\"%\"xG" }{TEXT -1 85 " < 1 we stake as much as we need to reach our objective in a single s troke, that is " }{XPPEDIT 18 0 "1-x" "6#,&\"\"\"F$%\"xG!\"\"" }{TEXT -1 22 ". Now a win gives us " }{XPPEDIT 18 0 "x+(1-x)" "6#,&%\"xG\"\" \",&F%F%F$!\"\"F%" }{TEXT -1 32 " = 1, and a loss leaves us with " } {XPPEDIT 18 0 "x-(1-x)" "6#,&%\"xG\"\"\",&F%F%F$!\"\"F'" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "2" "6#\"\"#" }{XPPEDIT 18 0 "x" "6#%\"xG" } {XPPEDIT 18 0 "- 1" "6#,$\"\"\"!\"\"" }{TEXT -1 128 " > 0, which can b e used for another bet. Play continues until we reach our objective, o r until we have lost our entire capital. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 "Further, let " }{XPPEDIT 18 0 "p " "6#%\"pG" }{TEXT -1 64 " be the probability of winning a bet, and su ppose the function " }{XPPEDIT 18 0 "g" "6#%\"gG" }{TEXT -1 84 " exp resses the probability of reaching our objective starting with initial capital " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 15 ". The quantity \+ " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 37 " is supposed to be the va riable and " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 32 " is an unkno wn parameter (0 < " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 45 " < 1), which means that for every choice of " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 23 " there is a function " }{XPPEDIT 18 0 "g" "6#%\"gG" } {TEXT -1 75 ". We wish to emphasize that so far it is not clear whethe r these functions " }{XPPEDIT 18 0 "g" "6#%\"gG" }{TEXT -1 33 " are we ll-defined for every real " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 138 ". Who knows whether the process described above will come to an e nd at all? All the same, let us assume for the moment that the functio ns " }{XPPEDIT 18 0 "g" "6#%\"gG" }{TEXT -1 61 " are defined on the en tire interval [0,1]. Then clearly, for " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 11 " in [0,1], " }{XPPEDIT 18 0 "g" "6#%\"gG" }{TEXT -1 1 "( " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 85 ") belongs to [0,1] as wel l. From the function's description we deduce the relations: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 14 " \+ " }{TEXT 302 1 "g" }{TEXT -1 10 "(0) = 0, " }{TEXT 303 1 "g" }{TEXT -1 9 "(1) = 1, " }}{PARA 0 "" 0 "" {TEXT -1 14 " " } {TEXT 304 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 4 ") = " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT 305 1 "g" }{TEXT -1 2 "(2" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 5 ") + (" }{XPPEDIT 18 0 " 1-p" "6#,&\"\"\"F$%\"pG!\"\"" }{TEXT -1 1 ")" }{TEXT 306 1 "g" }{TEXT -1 20 "(0) if 0 < " }{XPPEDIT 18 0 "x<= 1/2" "6#1%\"xG*&\"\" \"F&\"\"#!\"\"" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 25 " \+ " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT 307 1 "g" } {TEXT -1 7 "(1) + (" }{XPPEDIT 18 0 "1-p" "6#,&\"\"\"F$%\"pG!\"\"" } {TEXT -1 1 ")" }{TEXT 308 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "2x-1" "6#,&*&\"\"#\"\"\"%\"xGF&F&F&!\"\"" }{TEXT -1 10 ") if " } {XPPEDIT 18 0 "1/2 < x;" "6#2*&\"\"\"F%\"\"#!\"\"%\"xG" }{TEXT -1 9 " \+ < 1. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 59 "We would like to find out whether this intriguing function " } {TEXT 309 1 "g" }{TEXT -1 66 " is continuous on [0,1], and naturally w e have Maple to assist us." }}{PARA 0 "" 0 "" {TEXT -1 38 "Knowing wha t we do about the function " }{TEXT 310 1 "g" }{TEXT -1 125 ", it seem s quite natural to use a recursive Maple procedure for its definition; no other information is presently available." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "g := proc(x, p) option remember;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "if x = 0 or \+ x = 1 then x" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "elif x <= 1/2 then \+ factor(expand(p*g(2*x,p)))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "else \+ factor(expand(p + (1-p)*g(2*x-1,p)))" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "fi end;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "The Maple funct ions " }{TEXT 275 6 "expand" }{TEXT -1 5 " and " }{TEXT 276 6 "factor " }{TEXT -1 27 " are used here to give the " }{TEXT 293 1 "g" }{TEXT -1 42 "-values a more or less natural appearance." }}{PARA 0 "" 0 "" {TEXT -1 60 "Calling the function for an arbitrary (hence indeterminat e) " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 71 " causes an error messa ge to appear, and likewise, numerical values for " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 25 " are not accepted either." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "g(x,p); g(0. 2345,p);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 93 "This is not really s urprising. The first error is caused by the fact that the indeterminat e " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 41 " can not be compared \+ with the numerical " }{XPPEDIT 18 0 "1/2" "6#*&\"\"\"F$\"\"#!\"\"" } {TEXT -1 20 " in the inequality " }{XPPEDIT 18 0 "x<= 1/2" "6#1%\"xG *&\"\"\"F&\"\"#!\"\"" }{TEXT -1 17 ", simply because " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 86 " does not have a numerical value. This err or can be prevented by checking the type of " }{XPPEDIT 18 0 "x" "6#% \"xG" }{TEXT -1 6 ": if " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 13 " is of type " }{TEXT 277 4 "name" }{TEXT -1 18 " - in which case " } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 32 " has no numerical value - t hen " }{TEXT 296 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "x" "6#%\"xG" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 33 ") is return ed unevaluated. As in " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "if type(x,name) then `g(x,p)` fi;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 242 "for instance. The second error is more serious. Too many levels of recursion cause a stack ove rflow, usually as the result of an infinite loop. This is indeed the c ase here, because the function g is defined in terms of itself (see wo rksheet " }{TEXT 278 11 "TourW1b.mws" }{TEXT -1 54 "). Therefore we ne ed to find out for which values of " }{XPPEDIT 18 0 "x" "6#%\"xG" } {TEXT -1 61 " this recursive process is finite. Clearly, this is so w hen " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 15 " has the shape " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 11 " \+ " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "k/2 ^n" "6#*&%\"kG\"\"\")\"\"#%\"nG!\"\"" }{TEXT -1 10 ", where " } {XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 18 " is natural and " } {XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 11 " = 0,1,...," }{XPPEDIT 18 0 "2^n" "6#)\"\"#%\"nG" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "Indeed, starting off with initial " } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 42 "-value of this form, repeate dly applying 2" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 4 " or " } {XPPEDIT 18 0 "2x" "6#*&\"\"#\"\"\"%\"xGF%" }{XPPEDIT 18 0 "-1" "6#,$ \"\"\"!\"\"" }{TEXT -1 62 " most surely leads to 1 in finitely many st eps. For instance, " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "g(43/128,p);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 16 "As the numbers " }{XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 1 "/" }{XPPEDIT 18 0 "2^n" "6#)\"\"#%\"nG" }{TEXT -1 7 " for " } {XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 9 " = 0,...," }{XPPEDIT 18 0 "2^ n" "6#)\"\"#%\"nG" }{TEXT -1 62 " are uniformly distributed over the i nterval [0,1], a plot of " }{TEXT 297 1 "g" }{TEXT -1 78 " at these po ints may give a realistic impression of the overall behaviour of " } {TEXT 298 1 "g" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 4 "For " }{TEXT 294 1 "g" }{TEXT -1 78 " to h ave numerical values, we naturally have to choose a numerical value fo r " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 25 " as well. Let us choos e " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 98 " = 0.8, but any other \+ value between 0 and 1 will do equally well. Next we build a list of po ints (" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 1 "," }{TEXT 295 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 8 ")) for " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 1 " /" }{XPPEDIT 18 0 "2^7" "6#*$\"\"#\"\"(" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 9 " = 0,...," }{XPPEDIT 18 0 "2^7" "6#*$ \"\"#\"\"(" }{TEXT -1 69 ". It is advisable to suppress the Maple outp ut for such a long list. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "p := 0.8: argumentlist := [seq(k/2 ^7,k=0..2^7)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "pointlist := map(x -> [x,g(x,p)],argumentlist):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 30 "Here we use the Maple command " }{TEXT 279 3 "seq" } {TEXT -1 94 " for the construction of a list of 129 equidistant points in the interval [0,1]. Next Maple's " }{TEXT 280 3 "map" }{TEXT -1 52 " function is evoked in order to apply the function " }{XPPEDIT 18 0 "proc (x) options operator, arrow; [x, g(x,p)] end;" "6#R6#%\"xG7 \"6$%)operatorG%&arrowG6\"7$F%-%\"gG6$F%%\"pGF*F*F*" }{TEXT -1 32 " t o every element of the list " }{TEXT 281 12 "argumentlist" }{TEXT -1 34 ". This produces a list of points " }{TEXT 282 9 "pointlist" } {TEXT -1 47 " that can be plotted on the screen by Maple's " }{TEXT 283 4 "plot" }{TEXT -1 10 " command. " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "plot(pointlist,style=poi nt);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 21 "We choose the option " }{TEXT 284 13 "style = point" }{TEXT -1 193 " because in the default s etting Maple would otherwise join successive points by little line seg ments which would obscure possible discontinuities. The plot clearly s hows the individual points " }{XPPEDIT 18 0 "[x, g(x,p)]" "6#7$%\"xG- %\"gG6$F$%\"pG" }{TEXT -1 38 " well separated. The Maple functions " }{TEXT 285 3 "map" }{TEXT -1 5 " and " }{TEXT 286 3 "seq" }{TEXT -1 170 " are extremely useful, especially when creating datasets as we di d above. The former acts on lists, but also on other objects like arra ys and sets. A related function is " }{TEXT 287 3 "zip" }{TEXT -1 75 " by which two lists (or vectors) can be zipped into a single list of p airs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "dat1 := [1,2,3,4]: dat2 := [a,b,c,d]:" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "zip((x,y) -> (x,y),dat1,dat2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 71 "Returning to the plot, we observe a reas onably continuous behaviour of " }{TEXT 299 1 "g" }{TEXT -1 127 ", pos sibly interrupted by some discontinuities. On the other hand, it might well be that to the immediate right of points like " }{XPPEDIT 18 0 " x" "6#%\"xG" }{TEXT -1 5 " = 0," }{XPPEDIT 18 0 "1/4;" "6#*&\"\"\"F$\" \"%!\"\"" }{TEXT -1 6 ", and " }{XPPEDIT 18 0 "1/2" "6#*&\"\"\"F$\"\"# !\"\"" }{TEXT -1 15 ", the function " }{TEXT 301 1 "g" }{TEXT -1 71 " \+ is continuous but increases very steeply. The best way to investigate \+ " }{TEXT 300 1 "g" }{TEXT -1 41 "'s continuity is to express its argum ent " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 38 " as an infinite binar y fraction, i.e. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 " " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 4 " = \+ " }{XPPEDIT 18 0 "b[1]" "6#&%\"bG6#\"\"\"" }{TEXT -1 1 " " }{XPPEDIT 18 0 "2^(-1)" "6#)\"\"#,$\"\"\"!\"\"" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "b[2]" "6#&%\"bG6#\"\"#" }{TEXT -1 1 " " }{XPPEDIT 18 0 "2^(-2)" "6# )\"\"#,$F$!\"\"" }{TEXT -1 9 " + ... + " }{XPPEDIT 18 0 "b[n]" "6#&%\" bG6#%\"nG" }{TEXT -1 1 " " }{XPPEDIT 18 0 "2^(-n)" "6#)\"\"#,$%\"nG!\" \"" }{TEXT -1 14 " + ... , with " }{XPPEDIT 18 0 "b[i]" "6#&%\"bG6#%\" iG" }{TEXT -1 11 " in \{0,1\}," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 16 "abbreviated as " }{XPPEDIT 18 0 "x" "6#% \"xG" }{TEXT -1 6 " = (0." }{XPPEDIT 18 0 "b[1]" "6#&%\"bG6#\"\"\"" } {XPPEDIT 18 0 "b[2]" "6#&%\"bG6#\"\"#" }{TEXT -1 13 "...)_2 with " } {XPPEDIT 18 0 "b[i]" "6#&%\"bG6#%\"iG" }{TEXT -1 229 " =0 or 1. As you probably know, every real number can be expressed in this way, and th is representation is also essentially unique. The choice of 2 as base \+ for the representation is inspired by the fact that for numbers of typ e " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "k; " "6#%\"kG" }{TEXT -1 1 "/" }{XPPEDIT 18 0 "2^n" "6#)\"\"#%\"nG" } {TEXT -1 32 " the recursive process by which " }{TEXT 311 1 "g" } {TEXT -1 1 "(" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 65 ") is to be determined, is fi nite. This is immediately clear from " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 11 " " }{TEXT 312 1 "g" }{TEXT -1 3 "(0." }{XPPEDIT 18 0 "b[1]" "6#&%\"bG6#\"\"\"" }{XPPEDIT 18 0 "b[ 2]" "6#&%\"bG6#\"\"#" }{XPPEDIT 18 0 "b[3]" "6#&%\"bG6#\"\"$" }{TEXT -1 8 "...)_2, " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 5 ") = " } {XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT 313 1 "g" }{TEXT -1 4 "((0." } {XPPEDIT 18 0 "b[2]" "6#&%\"bG6#\"\"#" }{XPPEDIT 18 0 "b[3]" "6#&%\"bG 6#\"\"$" }{TEXT -1 8 "...)_2, " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 23 ") if " }{XPPEDIT 18 0 "b[1]" "6#&%\"bG6#\"\" \"" }{TEXT -1 6 " = 0, " }}{PARA 0 "" 0 "" {TEXT -1 48 " \+ " }{XPPEDIT 18 0 "p" "6#%\"pG" } {TEXT -1 4 " + (" }{XPPEDIT 18 0 "1-p" "6#,&\"\"\"F$%\"pG!\"\"" } {TEXT -1 1 ")" }{TEXT 314 1 "g" }{TEXT -1 3 "(0." }{XPPEDIT 18 0 "b[2] " "6#&%\"bG6#\"\"#" }{XPPEDIT 18 0 "b[3]" "6#&%\"bG6#\"\"$" }{TEXT -1 8 "...)_2, " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 9 ") if " } {XPPEDIT 18 0 "b[1]" "6#&%\"bG6#\"\"\"" }{TEXT -1 6 " =1. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "Summarizing, th e recursive definition of " }{TEXT 315 1 "g" }{TEXT -1 37 " can be use d to explicitly calculate " }{TEXT 316 1 "g" }{TEXT -1 1 "(" } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\" pG" }{TEXT -1 10 ") for all " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 66 " with finite or periodic binary expansions. This implies that the \+ " }{TEXT 317 1 "g" }{TEXT -1 88 "-value of every rational number betwe en 0 and 1 can be explicitly computed in terms of " }{XPPEDIT 18 0 "p " "6#%\"pG" }{TEXT -1 49 ". An example might be useful at this point. \+ Let " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT -1 3 " :=" }{TEXT 318 2 " g " }{TEXT -1 1 "(" }{XPPEDIT 18 0 "1/5" "6#*&\"\"\"F$\"\"&!\"\"" } {TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 7 "). Then" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "p := 'p': y = p*p*(p + (1-p)*(p +(1-p)*y));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 48 "because the process of two applications of the 2" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 23 "-step followed by two (" } {XPPEDIT 18 0 "2" "6#\"\"#" }{XPPEDIT 18 0 "x" "6#%\"xG" }{XPPEDIT 18 0 "-1" "6#,$\"\"\"!\"\"" }{TEXT -1 30 ")-steps returns the original \+ " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "1/5" "6#*&\"\"\"F$\"\"&!\"\"" }{TEXT -1 65 ". This is best understood by co nsidering the binary expansion of " }{XPPEDIT 18 0 "1/5" "6#*&\"\"\"F$ \"\"&!\"\"" }{TEXT -1 1 ":" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 " " }{XPPEDIT 18 0 "1/5" "6#*&\"\"\"F$\"\"& !\"\"" }{TEXT -1 25 " = (0.001100110011...)_2," }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 18 "with period 0011. " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "`g(1/5,p)` := solve(%,y);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 40 "It appears that for rational values of " }{XPPEDIT 18 0 "x" "6#%\"xG " }{TEXT -1 2 ", " }{TEXT 319 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "x " "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 43 ") is a rational function of the parameter " }{XPPEDIT 18 0 "p" "6 #%\"pG" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "This binary expansion also helps us to show that " } {TEXT 320 1 "g" }{TEXT -1 1 "(" }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 32 ") can be defined \+ for every real " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 35 " in [0,1] \+ and every indeterminate " }{XPPEDIT 18 0 "p" "6#%\"pG" }{TEXT -1 37 " . This follows from the inequalities " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "abs(`g(x,p)` - `g(y,p)`) <= p^i*(1-p)^j;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "k :='k' : p^i*(1-p)^j <= (max(p,1-p))^k;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "for non-negative integers " }{XPPEDIT 18 0 "i" "6#%\"iG " }{TEXT -1 2 ", " }{XPPEDIT 18 0 "j" "6#%\"jG" }{TEXT -1 7 " with " }{XPPEDIT 18 0 "i" "6#%\"iG" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "j" "6#% \"jG" }{TEXT -1 4 " = " }{XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 19 ", \+ where the first " }{XPPEDIT 18 0 "k" "6#%\"kG" }{TEXT -1 33 " bits in the binary expansion of " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 6 " \+ and " }{XPPEDIT 18 0 "y" "6#%\"yG" }{TEXT -1 47 " coincide. Also the \+ continuity of the function " }{TEXT 321 1 "g" }{TEXT -1 1 "(" } {XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "p" "6#%\" pG" }{TEXT -1 68 ") (properly extended to the entire interval [0,1]) a s a function of " }{XPPEDIT 18 0 "x" "6#%\"xG" }{TEXT -1 116 " can be \+ derived from these inequalities. Exercise 1 of section 2.5 considers t he continuity and other properties of " }{TEXT 322 1 "g" }{TEXT -1 49 "; see also Appendix B for a detailed discussion. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 332 "There is an important co nclusion to be drawn from this example. Namely, though very useful in \+ the search for characteristic properties of complicated functions, Map le's proper role is that of a very clever tool that can put us on the \+ right track. But that is all, in the end the user must always supply a rigorous proof by himself. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 32 "I nvestigating a Strange Sequence" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 78 "Finally we shall give some attention to a diverging sequence of real numbers. " }}{PARA 0 "" 0 "" {TEXT -1 53 " We define the following somewhat artificial sequence:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "stranger: = n ->\n n*log(1+1/n)*(cos(n*Pi/4)+(-1)^(n*(n+1)/2));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 65 "Does this sequence perhaps converge to a limit? Let us find out. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "n := 'n': limit(stranger(n),n=infin ity,real);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 26 "We use the extra a rgument " }{TEXT 288 4 "real" }{TEXT -1 178 " to coerce Maple into giv ing a real answer if possible. Maple only gives a numeric range, which means that the value of the limiting expression is known to lie in th at range for " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 71 " sufficientl y large. In other words, the limit points are contained in " } {XPPEDIT 18 0 "[-2, 2];" "6#7$,$\"\"#!\"\"F%" }{TEXT -1 14 ". The comm and " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "?limit[return]" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "gives information on the meaning of the values returned by Maple's " }{TEXT 289 5 "limit" }{TEXT -1 10 " function." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 91 "Let us investigate the li mit behaviour of this strange sequence by plotting its values for " } {XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 98 " in the range [100,500]. It \+ might improve the picture if we plot these values as functions of log( " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 14 ") instead of " } {XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 122 ". One advantage is that pos sible accumulations of points (limit points) become more pronounced. A s only points with large " }{XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 221 "-values are considered, we expect to see a few almost horizontal sets of ever more densely packed points. These almost-lines correspond wit h convergent subsequences and thus with the limit points of the origin al sequence." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "stranger_list := [seq(stranger(n),n=100..500)]:" } }{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "logn_list := [seq(log(n),n=100..50 0)]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "zip((a,b) -> [a,b],logn_lis t,stranger_list):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "plot(% ,style=point);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 187 "The figu re clearly shows that the sequence splits into 7 groups of points, eac h accumulating around 7 distinct values. Therefore, it seems likely th at there are 7 limit points. The limit " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "n := 'n': Limit(n*log(1 +1/n),n=infinity) =" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "limit(n*log( 1+1/n),n=infinity);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 37 "is easily recognized. Moreover, for " } {XPPEDIT 18 0 "n" "6#%\"nG" }{TEXT -1 4 " = 4" }{XPPEDIT 18 0 "k" "6#% \"kG" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "r" "6#%\"rG" }{TEXT -1 3 " ( \+ " }{XPPEDIT 18 0 "r" "6#%\"rG" }{TEXT -1 27 " = 0,1,2,3 ) the values o f " }{XPPEDIT 18 0 "cos(Pi*n/4);" "6#-%$cosG6#*(%#PiG\"\"\"%\"nGF(\"\" %!\"\"" }{TEXT -1 7 " and " }{XPPEDIT 18 0 "(-1)^(n*(n+1)/2);" "6#), $\"\"\"!\"\"*(%\"nGF%,&F(F%F%F%F%\"\"#F&" }{TEXT -1 155 " can be calcu lated without difficulty. Combining these results and observations con firm that our strange sequence indeed has 7 limit points, namely 2, 0, " }{XPPEDIT 18 0 "-1;" "6#,$\"\"\"!\"\"" }{TEXT -1 22 ", and the fou r points " }{XPPEDIT 18 0 "1+1/sqrt(2),1-1/sqrt(2);" "6$,&\"\"\"F$*&F$ F$-%%sqrtG6#\"\"#!\"\"F$,&F$F$*&F$F$-F'6#F)F*F*" }{TEXT -1 2 ", " } {XPPEDIT 18 0 "-1+1/sqrt(2);" "6#,&\"\"\"!\"\"*&F$F$-%%sqrtG6#\"\"#F%F $" }{TEXT -1 7 ", and " }{XPPEDIT 18 0 "-1-1/sqrt(2);" "6#,&\"\"\"!\" \"*&F$F$-%%sqrtG6#\"\"#F%F%" }{TEXT -1 56 ". In particular, we deduce \+ that limsup = 2 and liminf = " }{XPPEDIT 18 0 "-1-1/sqrt(2);" "6#,&\" \"\"!\"\"*&F$F$-%%sqrtG6#\"\"#F%F%" }{TEXT -1 20 " for this sequence. \+ " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 63 "We have come to the end of this Maple ses sion. The worksheets " }{TEXT 323 11 "FuncW2a.mws" }{TEXT -1 5 " and \+ " }{TEXT 324 11 "FuncW2b.mws" }{TEXT -1 142 " offer much exercise mate rial on the Maple commands used in this session, they form a natural s equel to the Maple session we have just ended. " }}}{PARA 3 "" 0 "" {TEXT -1 0 "" }}}{MARK "0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }