{VERSION 5 0 "APPLE_PPC_MAC" "5.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 0 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 "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "" -1 23 " Courier" 1 10 0 0 0 0 0 0 0 0 0 0 3 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 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 259 "" 0 1 0 0 0 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 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 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 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 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E "" -1 439 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 440 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 441 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 442 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 444 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 445 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 446 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 447 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Tim es" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } {PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 14 5 }{PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Title" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 9 "Lecture 7" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 36 "Elementary manipulation of Equations" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 32 "Recall that A = B represents an " }{TEXT 305 8 "equation" }{TEXT -1 9 " whereas " }{TEXT 303 5 "A:= B" } {TEXT -1 7 " is an " }{TEXT 306 20 "assignment statement" }{TEXT -1 2 ". " }{TEXT 304 4 "A:=B" }{TEXT -1 55 " means, as we have seen, \"ass ign to A the value of B\"." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "We assign to the v ariable " }{TEXT 288 3 "eq1" }{TEXT -1 14 " the equation " }{TEXT 289 11 "x^2 + x = 1" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "eq1:=x^2+x = 2*x + 1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 " There are several things one can do with an equation: Here are some ex amples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "a:=lhs(eq1);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "b:=rhs(eq1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "solve(eq1,x);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 52 "Note that Maple like the best mathematicians canno t " }{TEXT 414 5 "solve" }{TEXT -1 80 " every equation. However, somet imes it can obtain an approximate solution using " }{TEXT 412 6 "fsolv e" }{TEXT -1 12 " instead of " }{TEXT 413 5 "solve" }{TEXT -1 39 ". We discuss these commands more later." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "fsolve(eq1,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "whattype(eq1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "t ype(eq1,equation);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "type( q*g=r*t,equation);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "type( x:=y,equation);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "isolate( 4*x*sin(x)=3,sin(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "is olate(x^2-3*x-5 = 0,x^2);" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 63 "Int, int, Diff, diff, Sum, sum, Product, product, Limit, limit. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "In general, when Maple has two procedures of the same name where \+ one begins with a capital letter and one with lower case, the capital ized procedure is an " }{TEXT 258 10 "inert form" }{TEXT -1 34 " of th e lower case procedure. The " }{TEXT 290 5 "value" }{TEXT -1 24 " proc edure forces these " }{TEXT 291 16 "inert procedures" }{TEXT -1 9 " su ch as " }{TEXT 292 15 "Int, Limit, Sum" }{TEXT -1 6 ", and " }{TEXT 259 4 "Diff" }{TEXT -1 78 " to be evaluated by their corresponding Map le (lower case) procedure, such as " }{TEXT 260 17 "int, limit, sum, \+ " }{TEXT -1 2 "or" }{TEXT 262 6 " diff." }{TEXT -1 48 " This is best u nderstood by looking at examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "z1:=Int(x^2,x=a..b);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "va lue(z1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Note that " }{TEXT 256 21 "value(Int(x^2,x=a..b)" }{TEXT -1 16 " is the same as " }{TEXT 257 16 "int(x^2,x=a..b):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "int(x^2,x=a..b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "One can get \+ a nice formula in the following manner: (Note that we use " }{TEXT 261 13 "z1 = value(z)" }{TEXT -1 5 " not " }{TEXT 263 14 "z1:=value(z1 )." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "z1=value(z1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "z2:=Diff(sin(x)*exp(x),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "z2=value(z2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "diff(sin(x)*exp(x),x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "z3:=Sum(1/n^2,n=1..infinity);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "z3=value(z3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "sum(1/n^2,n=1..infinity);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "z4:=Product(x-i,i=1..10);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "z4=value(z4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "Product(x-i,i=1..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "z4=expand(value(z4));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "z5:=Limit(sqrt(x^2)/x,x=0,right);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "z5=value(z5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "limit(sqrt(x^2)/x,x=0,right);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "limit(sqrt(x^2)/x,x=0,left); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 49 "sum('f(i)','i'=m ..n) and product('f(i)','i'=m..n)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 13 "The commands " }}{PARA 0 "" 0 "" {TEXT -1 5 " " }}{PARA 0 "" 0 "" {TEXT 293 19 "sum(f(i), i = a..b)" } {TEXT -1 4 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "and " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 294 20 "product(f(i),i=a..b)" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 48 "will work if i has not be en previously assigned " }{TEXT 415 122 "but it is recommended (and of ten necessary) that both f and i be enclosed in single quotes to preve nt premature evaluation" }{TEXT -1 79 ". (For example, i may have a pr evious value.) Thus the preferred commands are " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 264 21 "sum('f(i)', 'i'=m..n)" } {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "and " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 265 27 "product('f(i)', 'i'=m..n). " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 32 "Consider the following examples:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "for i from 1 to 2 do i^2; od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "i;" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "sum(i^2,i=1..n);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "sum('i^2','i'=1..n);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "simplify(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 416 20 "binomial coefficient " }{TEXT -1 163 " (read \"n choose k\") is given in Maple by binomi al(n,k). Recall that this is the number of k element subsets of an n e lement set. Also it is the coefficient of " }{XPPEDIT 18 0 "x^k*y^(n-k );" "6#*&)%\"xG%\"kG\"\"\")%\"yG,&%\"nGF'F&!\"\"F'" }{TEXT -1 21 " in \+ the expansion of " }{XPPEDIT 18 0 "(x+y)^n;" "6#),&%\"xG\"\"\"%\"yGF&% \"nG" }{TEXT -1 172 ". There are many formulas involving sums and bin omial coefficients. Maple knows many of these formulas. This shows th e definition of binomial(n,k) in terms of factorials:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "convert(binomial(n,k),factorial);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 28 "Here's a that Maple \"knows\". " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "s:=Sum('k^2*binomial(n, k)', 'k'=0..n);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "s = valu e(s);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "product(i^2,i=1..n );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "product('i^2','i'=1.. n);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "The answer is in terms of \+ the gamma function " }{XPPEDIT 18 0 "GAMMA;" "6#%&GAMMAG" }{TEXT -1 142 " (GAMMA in Maple input) which is a continuous analogue of the fac torial function. We can convert to factorial notation by the following means." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "convert(%,factor ial);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 12 "add and mul " }{TEXT 417 6 "versus" } {TEXT -1 16 " sum and product" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{PARA 15 "" 0 "" {TEXT -1 4 "The " }{TEXT 266 3 "add" }{TEXT -1 65 " procedure is used to add up an explicit sequence of values. The " } {TEXT 267 3 "mul" }{TEXT -1 104 " procedure computes a product of an e xplicit sequence of values. A typical call to the add procedure is " } {TEXT 268 17 "add(f(i), i=1..n)" }{TEXT -1 2 ". " }{TEXT 307 47 "Here \+ n must be a specific number not a variable" }{TEXT -1 58 ". This compu tes f(1) + f(2) + ... + f(n). More generally, " }{TEXT 269 18 "add(f(i ), i=m..n) " }{TEXT -1 48 "computes f(m) + f(m+1) + ... + f(n). Simila rly, " }{TEXT 270 17 "mul(f(i), i=m..n)" }{TEXT -1 38 " computes f(m) \+ * f(m+1) * ... * f(n). " }}{PARA 15 "" 0 "" {TEXT -1 5 "Both " }{TEXT 271 3 "add" }{TEXT -1 5 " and " }{TEXT 272 3 "mul" }{TEXT -1 162 " are considered to be more efficient that the corresponding do-loop constr uctions. Also you do not have to put quotes around the arguments as yo u need to do with " }{TEXT 273 3 "sum" }{TEXT -1 5 " and " }{TEXT 274 7 "product" }{TEXT -1 131 ". Note also that unlike the for loop constr uction, the value of the index i is unchanged by add and mul, as we se e in our examples:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "i:=984; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "add(i^2,i=1..10);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "i;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "add(i^2,i=1..n);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "mul(i^2,i=1..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "i; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "i nterface(verboseproc=2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "eval(add);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 212 "Note that the ind ex, say i, in a for..do od; looping construction may have a value befo re the loop is entered. But it will have a possibly different values w hen the loop is finished executing. Here's an example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "i:=999;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 39 "for i from 1 to 2 do print(sin(i)); od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "i;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 15 "The procedures " }{TEXT 295 3 "sum" }{TEXT -1 5 " and " }{TEXT 296 7 "product" }{TEXT -1 12 " unlike the " }{TEXT 297 3 "add" }{TEXT -1 5 " and " }{TEXT 298 3 "mul" }{TEXT -1 115 " procedures compute sym bolic sums and products as we have seen already in previous examples. \+ That is the limits in " }{TEXT 299 8 "i = m..n" }{TEXT -1 296 " do not have to be specific values, they can be variables. Note that sum is a very complicated procedure since it not only does simple addition, bu t also has a lot of theory about infinite series and closed forms for \+ other finite series built into the procedure. Let's look at the defin ition of " }{TEXT 308 3 "sum" }{TEXT -1 141 ": (After you view it, rep lace the semicolon by a colon and execute the command again to remove \+ the program. This will help save a few trees.)" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 10 "eval(sum);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 "printf " }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 96 "The command printf can be used to \+ gain more control over the output. You will have noticed that " } {TEXT 418 5 "print" }{TEXT -1 5 " and " }{TEXT 419 6 "lprint" }{TEXT -1 74 " are limited in this respect. First I give a simple example of \+ the use of " }{TEXT 280 6 "printf" }{TEXT -1 1 ":" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 32 "restart:\nA:=evalf(1000*sin(10));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "printf(\"The value of 1000*s in(%d) is %E or %f. \\n\", 10, A, A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 114 "You may wish to skip past the following explanation and \+ look at more example. Then come back and read the details." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{EXCHG {PARA 0 "" 0 "" {TEXT 309 2 "%d" }{TEXT -1 43 " indicates an i nteger of unspecified size.\n" }}{PARA 0 "" 0 "" {TEXT 310 2 "%f" } {TEXT -1 56 " indicates a floating point number of unspecified size.\n " }}{PARA 0 "" 0 "" {TEXT 311 2 "%E" }{TEXT -1 91 " indicates a floati ng point number in scientific notation of unspecified size will go her e." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 362 2 "%s " }{TEXT -1 73 " indicate a string, that is, a sequence of characters \+ inclosed by quotes." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT 312 2 "\\n" }{TEXT -1 67 " is a new line character -- when enc ountered it causes a new line. " }}{PARA 0 "" 0 "" {TEXT -1 157 "\nNum bers can be added between the % and d,f,E, or s to indicate the number s of places allocated for the number being printed. See the followin g examples. \n" }}{PARA 0 "" 0 "" {TEXT -1 167 "Numbers are right just ified unless one places a minus sign, - , juat after the % sign. in wh ich case they are left justified. Examine carefully the following exam ples." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT -1 167 "Note that the vertical lines | are put in mosltly to make it easi er to see the spacing determined by the numbers between % and d, f, E \+ and the effect of the - after %." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 4 "See " }{TEXT 276 8 "?printf " } {TEXT -1 63 "for more details and the use of many more codes in additi on to " }{TEXT 313 1 "d" }{TEXT -1 2 ", " }{TEXT 314 1 "f" }{TEXT -1 5 " and " }{TEXT 315 1 "E" }{TEXT -1 45 " for printing in other styles , for example, " }{TEXT 316 1 "o" }{TEXT -1 12 " for octal, " }{TEXT 317 1 "x" }{TEXT -1 18 " for hexadecimal, " }{TEXT 318 1 "s" }{TEXT -1 19 " for strings, etc. " }{TEXT 275 50 "But for now just concentrat e on use of d, f and E." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 279 128 "Note th at everything between the two quotation marks \" \" is printed verbat im --even spaces --unless it is preceded by a % sign." }{TEXT -1 2 " \+ \n" }}{PARA 0 "" 0 "" {TEXT -1 41 "The stuff between the \" \" is cal led the " }{TEXT 278 13 "format string" }{TEXT -1 67 " The numbers aft er the format code are printed in the place of the " }{TEXT 319 2 "%d " }{TEXT -1 2 ", " }{TEXT 320 2 "%f" }{TEXT -1 5 " and " }{TEXT 321 2 "%E" }{TEXT -1 7 " codes " }{TEXT 277 26 "in the order they appear. " }{TEXT 323 39 "The following was copied from help for " }{TEXT 324 6 " printf" }{TEXT 325 10 ". Execute " }{TEXT 326 7 "?printf" }{TEXT 327 27 " for the entire help file. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 15 "" 0 "" {TEXT -1 19 "The form at string, " }{TEXT 322 3 "fmt" }{TEXT -1 178 ", is a Maple symbol or \+ string made up of a sequence of formatting specifications, possibly se parated by other characters. Each formatting specification has the fol lowing format: " }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 23 39 " \+ %[flags][width][.precision]code" }}{PARA 15 "" 0 "" {TEXT -1 117 "T he % symbol begins the format specification. One or more of the follow ing flags can optionally follow the % symbol: " }}{PARA 14 "" 0 "" {TEXT -1 2 "+ " }}{PARA 14 "" 0 "" {TEXT -1 99 "A signed numeric value is output with a leading positive or negative sign (+ or -) as approp riate. " }}{PARA 14 "" 0 "" {TEXT -1 2 "- " }}{PARA 14 "" 0 "" {TEXT -1 57 "The output is left justified instead of right justified. " }} {PARA 14 "" 0 "" {TEXT -1 6 "blank " }}{PARA 14 "" 0 "" {TEXT -1 153 " A signed numeric value is output with either a leading negative sign ( -) or a leading blank, depending on whether the value is negative or n on-negative. " }}{PARA 14 "" 0 "" {TEXT -1 2 "0 " }}{PARA 14 "" 0 "" {TEXT -1 123 "The output is padded on the left (between the sign and t he first digit) with zeroes. If - is also specified, 0 is ignored. " } }{PARA 15 "" 0 "" {TEXT -1 201 "The optional width indicates the minim um number of characters to output for this field. If the formatted val ue has fewer characters, it is padded on the left (or right if - was s pecified) with blanks. " }}{PARA 15 "" 0 "" {TEXT -1 165 "The optional precision specifies the number of digits that appear after the decima l point for floating point formats, or the maximum field width for str ing formats. " }}{PARA 15 "" 0 "" {TEXT -1 25 "Here are a few examples : " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 152 "In the first example below the width assigned for the floating point number is 13 -- this includ es the decimal point. The 5 after the decimal point in " }{TEXT 301 6 "%13.5f" }{TEXT -1 194 " indicates that we want 5 digits after the decimal point. In the case of the E formats the standard is one digit to the left of the decimal point and the number 5 indicated in the fo rmat code " }{TEXT 302 6 "%13.5E" }{TEXT -1 292 " indicates that there will be 5 digits after the decimal point. You can see the effect of \+ the blank, - or + added after the % signs in the following examples: T o count the blanks more easily click on the paragraph icon at the rig ht end of the menu bar. Clicking again will undo the effect. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "printf(\"example: |%13.5f| \+ \\n\",evalf(10*Pi));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "pri ntf(\"example: |%-13.5f| \\n\",evalf(10*Pi));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "printf(\"example: |%+13.5f| \\n\",evalf(10*Pi)); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "printf(\"example: |%13d | \\n\",123456789012);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "p rintf(\"example: |%13d| \\n\",123456789012.);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "printf(\"example: |%-13d| \\n\",123456789012);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "printf(\"example: |%+13d| \\n\",123456789012);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "pr intf(\"example: |%13.5E| \\n\",evalf(10*Pi));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "printf(\"example: |%-13.5E| \\n\",evalf(10*Pi)); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "printf(\"example: |%+13 .5E| \\n\",evalf(10*Pi));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "printf(\"example: |%s| \\n\", \"Some Word\");" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 43 "printf(\"example: |%-13s| \\n\", \"Some Word \");" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "printf(\"example: | %13s| \\n\", \"Some Word\");" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "H ere we use printf to make a little table:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 233 "printf(\" x | sim(x) | cos(x) | tan(x) \\n\"); \nprintf(\"-----------------------------------\\n\");\nfor x from 90 t o 100 do\na:=evalf(sin(x)):\nb:=evalf(cos(x)):\nc:=evalf(tan(x)):\npr intf(\"%3d | % 6.5f | % 6.5f | % 6.5f \\n\", x, a,b,c);\nod:" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 257 "" 0 "" {TEXT 328 14 "The effect of " }{TEXT -1 3 "\\n " }{TEXT 329 70 "in the format is to cause a new line. Note that if one repeatedly uses" } {TEXT -1 8 " printf " }{TEXT 330 7 "without" }{TEXT -1 4 " \\n " } {TEXT 331 96 "no new line is produced. In the following two examples w e print every 5th number on a new line:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "L:=[seq(i,i=1..20)];\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "for i from 1 to 20 do \n printf(\"%3d \",L[i]); \n if i mod 5 = 0 then printf(\"\\n\"); fi;\nod: " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 44 "\nHere are more examples illustrating use of " }{TEXT 332 2 "\\n" }{TEXT -1 20 " to control printing" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "with(lin alg):\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 103 "Note that the rows of the next matrix are too long to get on one line so the matrix doesn' t look good." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "M:=randmatr ix(5,70, entries=rand(0..1));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 97 " Here's a way to get it printed out nicely: (Note carefully the locatio n of the newline statement " }{TEXT 420 12 "printf(\"\\n\")" }{TEXT -1 2 ".)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 96 "for i from 1 to 5 do\n for j from 1 to 70 do\n printf(\"%1d\",M[i,j]);\n od;\n \+ printf(\"\\n\");\nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "\nAn exa mple using the string format:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "L:=[\"Bill Jones\", \"Ann Sm ith\", \"Kimiko Suzuki\",\"Juan Gonzalez\",\"Xin Lee\"];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "for i from 1 to nops(L) do\nprintf( \"Student number %d is %s. \\n\",i,L[i]);\nend do;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Note the effect of leaving out the " }{TEXT 421 2 "\\n" }{TEXT -1 22 " in the above program:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "for i from 1 to nops(L) do\nprintf(\"Student num ber %d is %s. \",i,L[i]);\nend do;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 3 "map" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT 281 3 "ma p" }{TEXT -1 96 " is a very useful procedure when you want to apply th e same procedure to \nall the elements of a " }{TEXT 282 11 "set, list , " }{TEXT -1 2 "or" }{TEXT 283 7 " matrix" }{TEXT -1 25 ". Here are s ome examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "X0:=\{seq(i,i=1..8)\};" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "X1:=map(sin,X0);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "Note that the following does NOT w ork:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "X2:=sin(\{1,2,3,4,5 ,6,7,8\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 "Now we want to eval uate each of the elements of X1 as floating point numbers:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "XX1:=map(evalf,X1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "We could have done this in one step:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "map(evalf@sin, X0);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "Unlike sin, " }{TEXT 333 5 "evalf " }{TEXT -1 53 " is one of the few functions that do not require map: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "XX2:=evalf(X1); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "(" }{TEXT 422 8 "simplify" }{TEXT -1 95 " is another command that doesn't need map.)---but it won't hurt to use it , in case you forget." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "simplify([(x-y)^2/(x-y), (z^ 2-w^2)/(z-w)]); \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "map(s implify, [(x-y)^2/(x-y), (z^2-w^2)/(z-w)]);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 62 "map can also take \"unnamed\" functions. Here are some \+ examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Y1:=[seq(i,i=1 ..5)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "map(unapply(x^2,x ),Y1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "map(x->x^2,Y1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "map(proc(x) x^2; end, Y1) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 110 "Recall that if U is a list \+ of length two then U[1]+U[2] is the sum of the two elements in the lis t. So we have" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "map(U->U[1]+U[2],[[a,b],[c,d],[e,f]]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "poly2:=-sqrt(2)*x^2-sin(3)*x -4*x-1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "evalf(poly2);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "M:=matrix([[1,2],[3,4]]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "map(sin,M);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "map(evalf@sin,M); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "5 mod 2, modp(5,2); " }{TEXT -1 58 "(Both of these give the remainder when 5 is divided by 2.)" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Now suppose we want to apply the f untion " }{TEXT 423 15 "x->modp( x , 2)" }{TEXT -1 22 " to each elemen t of M." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalm(M);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "map(modp,M,2); " }{TEXT -1 61 "(Note the second argument for `mod` goes after the matrix M)." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "map(modp,M,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "Another way to accomplish this is as foll ows." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "map(x->modp(x,3),M) ;\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "A similar example would be the following: (Note that " }{TEXT 424 12 "igcd(a,b,c) " }{TEXT -1 14 "is the gcd of " }{TEXT 425 8 "integers" }{TEXT -1 11 " a,b and c. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "L:=[seq(i,i=1001..1021) ];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "The goal is to take the igc d of each element of L with 30 and 42. Here's one way:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "map(igcd, L,30,42);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "Another way is this:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 24 "map(x->igcd(x,30,42),L);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 3 "zi p" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "The following examples show w hat " }{TEXT 334 3 "zip" }{TEXT -1 8 " can do:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "zip(f, [a,b ,c,d],[1,2,3,4]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "zip((x ,i)->x[i],[a,b,c,d],[1,2,3,4]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "zip((x,y)->x^y,[a,b,c,d],[1,2,3,4]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "A:=matrix(2,2,[seq(x[1],x=[a,b,c,d])]);\nB:=matr ix(2,2,[seq(x[2],x=[a,b,c,d])]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "zip(Phi,A,B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "zip((x,y)->x*y,A,B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 44 "evalb, linalg[equal], and convert/listlist" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "The purpose of the " }{TEXT 335 5 "evalb " }{TEXT -1 131 " function is to force evaluation of expressions invol ving relational operators, using a three-valued logic system. The retu rns are " }{TEXT 347 4 "true" }{TEXT -1 2 ", " }{TEXT 348 5 "false" } {TEXT -1 6 ", and " }{TEXT 349 4 "FAIL" }{TEXT -1 71 ". If evaluation \+ is not possible, an unevaluated expression is returned." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 "Since " }{TEXT 350 5 "evalb" }{TEXT -1 46 " does not simplify expressions, it may return " }{TEXT 351 5 "false" }{TEXT -1 121 " to a relation which is actually t rue. In such a case, appropriate simplification must be applied to the relation before " }{TEXT 352 5 "evalb" }{TEXT -1 42 " is used. Consid er the following examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "evalb(1 = 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalb( 2 <= 3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalb(x <= x); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "evalb(x <=y);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "f:=(u,v)->evalb(u > v);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "f(1,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "f(3,1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "A:=[1,2,3]:\nB:=[1,2,3]:\nevalb(A=B);\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 39 "S1:=\{1,2,3\}:\nS2:=\{1,2,3\}:\nevalb(S1=S2); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "sin(Pi/12);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "phi:=convert(sin(Pi/12),radical);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "evalb(sin(Pi/12) = phi); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "This shows that even though t he equation is true, Maple does not recognize it." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 51 "A:=matrix([[1,2],[3,4]]);\nB:=matrix([[1,2], [3,4]]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "Clearly these matrice s are equal, but the following command says they are not!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalb(A=B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "We may use " }{TEXT 353 10 "equal(A,B)" }{TEXT -1 68 " in the linear algebra package to test equality of matrices A and \+ B." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "equal(A,B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 73 "Another way to deal with equality of matr ices is to convert them to type " }{TEXT 363 9 "listlist:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "LA:=convert(A,listlist);\nLB:=conve rt(B,listlist);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "evalb(LA = LB);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 11 "What about " }{TEXT 354 6 "tables" }{TEXT -1 14 ". We see that " }{TEXT 355 5 "evalb" } {TEXT -1 52 " doesn't work, but below is a method that does work." }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 93 "We co nstruct tables T and S that are clearly equal, but the command evalb(T =S) returns false." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "T[1]: =1;\nT[red]:=green;\nS[1]:=1;\nS[red]:=green;\nevalb(T = S);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Also equal does not work.\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "equal(T,S);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "However, we can \"look inside\" the tables as follow s." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "op(T);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "op(op(T));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "This reduces the table to a list. We can do the same \+ for S and then Maple will recognize that they are equal." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "evalb(op(op(T)) = op(op(S)));" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 6 "testeq" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 15 "" 0 "" {TEXT -1 13 "The function " }{TEXT 338 6 "testeq" }{TEXT -1 23 " tests for equivalence " }{TEXT 336 17 "probabilistically" } {TEXT -1 13 ". It returns " }{TEXT 337 5 "false" }{TEXT -1 58 " if the expressions are not equal (or not equal to 0) and " }{TEXT 339 4 "tru e" }{TEXT -1 10 " otherwise" }{TEXT 426 35 " for the class of expressi ons that " }{TEXT 340 6 "testeq" }{TEXT 427 13 " understands." }{TEXT -1 12 " The result " }{TEXT 341 5 "false" }{TEXT -1 4 " is " }{TEXT 342 15 "always correct;" }{TEXT -1 12 " the result " }{TEXT 343 4 "tru e" }{TEXT -1 1 " " }{TEXT 344 43 "may be incorrect with very low proba bility." }{TEXT -1 1 " " }}{PARA 15 "" 0 "" {TEXT -1 68 "It will retur n FAIL if the procedures fail to produce an answer see " }{TEXT 428 7 "?testeq" }{TEXT -1 69 " for a few more details and a reference to the mathematics involved. " }}{PARA 0 "" 0 "" {TEXT -1 32 "Consider the f ollowing examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restar t:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 79 "a := (sin(x)^2 - cos( x)*tan(x)) * (sin(x)^2 + cos(x)*tan(x))^2;\nb:=expand(a);\n\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 87 "Clearly a and b should be equal, s ince b is just an expanded version of a, yet we have:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "evalb(a=b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "But testeq recognizes their equality:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "testeq(a=b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Here's another example:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 41 "c:=surd(2+sqrt(5),3) + surd(2-sqrt(5),3);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "According to an article in the Feb ruarly 2001 issue of " }{TEXT 345 20 "Mathematics Magazine" }{TEXT -1 43 " the number c is actually 1. But note that " }{TEXT 346 11 "testeq (c=1)" }{TEXT -1 23 " doesn't tell us this. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "testeq(c=1);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 98 "See the article for a proof that c is, in fact, equal to 1. Mea nwhile we can be fairly confident (" }{TEXT 356 20 "but not totally su re" }{TEXT -1 90 ") by finding a floating point evaluation to say 1000 digits. Let's first try fewer digits:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Digits:=10;\nevalf(c,10);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 26 "Digits:=100;\nevalf(c,100);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 28 "Digits:=1000;\nevalf(c,1000);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 32 "Palindromes and Makin g your own " }{TEXT 429 7 "convert" }{TEXT -1 11 " procedures" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "Here we show how to determine whet her or not a number is a " }{TEXT 287 5 "palin" }{TEXT -1 0 "" }{TEXT 286 5 "drome" }{TEXT -1 85 ", that is whether or not its digits read t he same forward as backwards. For example, " }{TEXT 300 9 "113343311" }{TEXT -1 17 " is a palindrome." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "Recall that t he following command converts an integer to a list of its digits --- i n reversed order." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "L:=con vert(1234,base,10);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 15 "" 0 "" {TEXT -1 49 "A user can make her own conversions known to t he " }{TEXT 358 7 "convert" }{TEXT -1 79 " function by defining a Mapl e procedure in the following way. If the procedure " }{TEXT 357 11 "`c onvert/f`" }{TEXT -1 36 " is defined, then the function call " }{TEXT 359 20 "convert(a,f,x,y,...)" }{TEXT -1 13 " will invoke " }{TEXT 360 22 "`convert/f`(a,x,y,...)" }{TEXT -1 67 "; Here we create a procedur e to convert a list back to an integer." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "`convert/number`:=proc(L)\n local i,n;\n n:=nops(L) ;\n add(L[i]*10^(i-1),i=1..n);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 18 "convert(L,number);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 19 "Here's a procedur e " }{TEXT 284 3 "REV" }{TEXT -1 93 " whose input is a list L and whos e output is the list obtained by reversing the entries in L." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "REV:=proc(L)\n local i;\n \+ [seq(L[-i],i=1..nops(L))];\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "REV([1,2,3,4,5,6,7,8,9]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Using the above we can define a procedue " }{TEXT 361 3 " rev" }{TEXT -1 117 " which given as input a positive integer n returns the integer obtained by writing the digits of n in reversed order:" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 91 "rev:=proc(n)\n local i,L, k;\n L:=convert(n,base,10);\n L:=REV(L);\n convert(L,number);\nend: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "rev(123456789);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "A number n is a " }{TEXT 285 12 " palindrome " }{TEXT -1 91 "if rev(n) = n. Using the above we can eas ily test whether or not a number is a palindrome:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 47 "ispalindrome:=proc(n)\n evalb(n = rev(n)); \nend:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "ispalindrome(1232 1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "ispalindrome(1121); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "Let's find some primes which \+ are palindromes:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "L:=NUL L:\nfor i from 1 to 1000 do \n p:=ithprime(i);\n if ispalindrome (p) then L:=L,p; end if; \nend do:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "L;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "nops( [L]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "So there are twenty pali ndromic primes less than 1000." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 18 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 21 "Can Maple be trusted?" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "From Robert Israel's " }{TEXT 365 24 "Maple Advisor Datatbase:" }} {PARA 0 "" 0 "" {TEXT -1 543 "\nAny very large software project has bu gs, and Maple has plenty of them. You should not have blind faith in \+ Maple, or any other computer algebra system, or a human for that matte r. Use the same general guidelines that you might apply to something \+ one of your colleagues might have come up with (after a long and compl icated calculation): first ask yourself if the answer appears to be re asonable, and then check it if possible. Try some special cases, a di fferent method of calculating the answer, or verify some consequences \+ of the answer." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 167 "In a situation where an error might have serious consequ ences, be especially diligent in checking the answer. You might even t ry it on another computer algebra system." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 201 "It's not unlikely that after usin g Maple for a while you will discover some bugs. If you find what appe ars to be a bug, first make sure that it really is a bug rather than y our own mistake. Check the " }{TEXT 364 22 "Maple Advisor Database" } {TEXT -1 305 " and the help pages on the functions you are using, to b e sure that you are using them correctly. Perhaps try some simpler ex amples, to determine the nature of the problem and under what conditio ns it appears. If possible, consult a more experienced Maple user (yo ur instructor, if you are a student). " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 87 "If you still think it is a bug, you \+ can report it by e-mail to the Maple developers at " }{MPLTEXT 0 21 21 "support@maplesoft.com" }{TEXT -1 47 ", to the Maple User Group, or to the newsgroup " }{MPLTEXT 0 21 24 "comp.soft-sys.math.maple" } {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 36 "solve and fsolve: a few more details" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 14 "The procedure " }{TEXT 370 5 "solve" } {TEXT -1 102 " attempts to find an exact solution to an equation. It o ften fails to do this for theoretical reasons:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "poly:=x^4+x^2+1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 159 "Note carefully the difference in the following two commands and the differ ence in the output. This is sometimes an important distinction as we s hall see later." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "sol1:=so lve(poly,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "sol2:=solve (poly,\{x\});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "Y:=evalf(s ol1); \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "Z:=evalf(sol2); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "pol:=x^5-x^4+x^3+2*x-1; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "S:=solve(pol=0,x);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 230 "This indicates that Maple is unab le to find a solution--it has been proved that in general there are no formulas for polynomials of degree greater than 4. We can, however, \+ obtain the numerical values of these 5 roots as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalf(S);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 108 " We can, also, direct Maple to find floating point app roximations to the solutions to an equations by using " }{TEXT 375 8 " fsolve. " }{TEXT -1 11 "For example" }{TEXT 377 1 ":" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "fsolve(pol,x);" }}}{EXCHG {PARA 15 "" 0 " " {TEXT -1 24 "For a general equation, " }{TEXT 366 46 "fsolve attempt s to compute a single real root." }{TEXT -1 124 " However, for polynom ials it will compute all real (non-complex) roots, although exception ally ill-conditioned polynomials " }{TEXT 367 36 "may cause fsolve to \+ miss some roots" }{TEXT -1 2 ". " }}{PARA 15 "" 0 "" {TEXT -1 11 "To \+ compute " }{TEXT 368 25 "all roots of a polynomial" }{TEXT -1 51 " ove r the field of complex numbers, use the option " }{TEXT 369 7 "complex " }{TEXT -1 13 " as follows: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Sol:=fsolve(pol=0,x,complex) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Note that this gives the sam e result as found above:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "evalb(\{evalf(S)\} = \{Sol\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "If you want to do something \+ with the roots use the following approach:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "Sol:=fsolve(pol=0,x,complex);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 104 "Now Sol[i] is the ith-solution. Note that the sol utions are returned as a sequence -- not a list or set." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "nops([Sol]);\n" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 49 "for i from 1 to nops([Sol]) do\nprint(Sol[i] );\nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 131 "Some solutions may be lost when the equation contains \"transcendental\" functions (sin,co s, exp, ln, etc..). Consider the example " }{XPPEDIT 430 0 "sin(x)-x^ 2 = 0;" "6#/,&-%$sinG6#%\"xG\"\"\"*$F(\"\"#!\"\"\"\"!" }{TEXT -1 65 ". From the graph we see clearly that there are two points where " } {XPPEDIT 431 0 "sin(x) = x^2;" "6#/-%$sinG6#%\"xG*$F'\"\"#" }{TEXT -1 2 " :" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 41 "plot(\{sin(x),x^2\},x=-Pi..Pi,color=BLACK);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "But see what happens when we try both " }{TEXT 373 5 "solve" }{TEXT -1 5 " and " }{TEXT 374 5 "fsolv" }{TEXT -1 32 "e. Neither gives both solution. " }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 22 "solve(sin(x) = x^2,x);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 9 "evalf(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "fsolve(sin(x) = x^2,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "Even specifying that we want a root in the interval -2..2 gives only one root:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "fs olve(sin(x) = x^2,x,-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 432 44 "B ut if we say we want a root in the interval" }{TEXT -1 8 " .5..1, " } {TEXT 433 26 "we do find the other root." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "fsolve(sin(x) = x^2,x,.5..1);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "So the best advice is when seeking roots of transcendental equations: " } {TEXT 376 77 "look at the graph and try to determine an interval conta ining a desired root." }{TEXT -1 10 " Then use " }{TEXT 371 6 "fsolve " }{TEXT -1 51 " specifying the interval as in the above examples. " } {TEXT 378 18 "Keep in mind that " }{TEXT 372 6 "fsolve" }{TEXT 379 48 " is happy to find just one root in any interval." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 14 "Ba sic plotting" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 " " {TEXT 381 16 "[Acknowledgement" }{TEXT -1 47 ": Some of the material below is from the book " }{TEXT 380 21 "Introduction to Maple" } {TEXT -1 17 " by Andre Heck] " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 30 "Note that one may plot either " } {TEXT 382 11 "expressions" }{TEXT -1 4 " or " }{TEXT 383 10 "procedure s" }{TEXT -1 4 " or " }{TEXT 384 9 "functions" }{TEXT -1 2 ". " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 434 10 " Important:" }{TEXT -1 33 " Note that the calculus function " } {XPPEDIT 18 0 "e^x;" "6#)%\"eG%\"xG" }{TEXT -1 54 " is NOT denoted by \+ e^x in Maple. One MUST use instead " }{TEXT 389 6 "exp(x)" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "h:=exp(-x^2)*cos(Pi*x^3);\n" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 18 "Note that h is an " }{TEXT 387 10 "expression" } {TEXT -1 66 " in the variable x. Note h is NOT a function and not a pr ocedure. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "plot(h,x=-2..2 ); #shrink this (and ALL plots) before printing." }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 43 "Or we may turn expression into a procedure." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "f:=unapply(h,x);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 79 "Here's a simple way to get a graph of th e procedure f on the interval (-2..2):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "plot(f,-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "The same result is obtained as follows by plotting the Maple " } {TEXT 385 8 "function" }{TEXT -1 6 " f(t):" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "plot(f(t),t=-2..2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "But here is a common problem: If the procedure has an " } {TEXT 388 10 "if ...then" }{TEXT -1 65 " statement in it Maple will of ten be confused: Here's an example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "g:=proc(u) if u > 0 then u else -u; fi; end:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(g(u),u=-2..2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Here are three ways to remedy this :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "plot(g,-2..2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "plot('g(u)',u=-2..2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "The third way is by using the proc edure " }{TEXT 386 9 "piecewise" }{TEXT -1 25 " to define the procedur e:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "g:=piecewise(u<0,-u,u >=0,u);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(g(u),u=-2.. 2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 96 "Two or more functions may \+ be plotted on the same set of axes as in the next example: This plots \+ " }{XPPEDIT 18 0 "x^3;" "6#*$%\"xG\"\"$" }{TEXT -1 165 " and its first and second derivative. Note that here we use expressions and not func tions. Since the default colors are not easy to see, I have added a co lor option:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "plot(\{x^3, \+ diff(x^3,x), diff(x^3,x$2)\},x=-2..2, color=[red,blue,black]);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 59 "We can also do this with the opera tor notation, as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "f:=x->x^3:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "plot(\{f, D(f),(D@@2)(f)\},-2..2, color=[red,blue,black]);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 188 "Recall that f@g is the composition of f with g an d g@@n is the composition of g with itself n times. So D(f) is the der ivative of f and (D@D)(f) or (D@@2)(f) is the second derivative of f. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "D(f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "(D@D)(f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "(D@@2)(f);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 38 "Finding Maxima and Minima via Calculus" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "Here we show h ow to use some theory from calculus to find the maximum and minimum va lues of a function. Consider the function: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "p := (6*x^4+312*x^2+10706-20*x^3-20*x)/(x^6-197*x^4+10003*x^2+1020 1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "plot(p,x=-20..20);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 129 "Note the different scales on t he x and y axes in the graph above. Let's plot the derivative to see w here the critical points are:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "dp:=diff(p,x): \ndp:=simplify(dp);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(dp,x=-20..20);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 230 "Let's find the exact location of the critical points correspon ding to the three peaks which we see in the graph of p. We can see tha t the peaks occur approximately when x = -10, 0 and 10. But are these \+ the exact values? Let's use " }{TEXT 390 6 "fsolve" }{TEXT -1 1 ":" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "x1:=fsolve(dp=0,x,-11..-9); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "x2:=fsolve(dp=0,x,-(.1) ..(.1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "x3:=fsolve(dp=0 ,x,9..11);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "ff:=unapply(p ,x):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "The three peaks have the \+ following coordinates:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "[ x1,ff(x1)]; \n[x2,ff(x2)]; \n[x3,ff(x3)];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 95 "Note that it looks as if dp has a root at x = 0, however \+ as we see below this is not the case. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "fdp:=unapply(dp,x):\nfdp(0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 102 "We can also see this by plotting the derivative neare r the origin. We see that dp is not 0 when x = 0." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 25 "plot(dp,x=-1/100..1/100);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 38 "Assignment 7 --Due Wed nesday, March 20" }}{EXCHG {PARA 0 "" 0 "" {TEXT 396 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 391 10 "Problem 1." }{TEXT -1 2 " " }}{PARA 0 " " 0 "" {TEXT -1 23 "(a) Plot the graph of " }{XPPEDIT 18 0 "sin(x)*ex p(-x^2)" "6#*&-%$sinG6#%\"xG\"\"\"-%$expG6#,$*$F'\"\"#!\"\"F(" }{TEXT -1 67 " for x in the interval [-2,2]. \n\n(b) Find to 10 decimal digit s the " }{TEXT 398 7 "maximum" }{TEXT -1 5 " and " }{TEXT 399 7 "mimim um" }{TEXT -1 11 " values of " }{XPPEDIT 18 0 "sin(x)*exp(-x^2);" "6#* &-%$sinG6#%\"xG\"\"\"-%$expG6#,$*$F'\"\"#!\"\"F(" }{TEXT -1 17 " for x in [-2,2] " }{TEXT 397 3 "AND" }{TEXT -1 6 " find " }{TEXT 400 33 "th e corresponding values of x. [ " }{TEXT -1 57 "So if the maximum occur s at x=a, you should also compute " }{XPPEDIT 18 0 "sin(a)*exp(-a^2); " "6#*&-%$sinG6#%\"aG\"\"\"-%$expG6#,$*$)F'\"\"#F(!\"\"F(" }{TEXT -1 123 " both to 10 digits. Similarly for the minimum. Using unapply to m ake the expression into a function will be useful here.] " }{TEXT 435 5 "Hint:" }{TEXT -1 164 " Look at the graph of the derivative to f ind intervals where the roots of the derivative are located, Use thes e with fsolve to obtain the zeros of the derivative. " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 405 10 " Problem 2." }{TEXT -1 29 " (a) Find the exact value of " }{XPPEDIT 18 0 "Sum(`mod`(n,5),n = 1 .. 40000);" "6#-%$SumG6$-%$modG6$%\"nG\"\"&/F) ;\"\"\"\"&++%" }{TEXT -1 66 " using each of the following methods: T ime each method by using " }{TEXT 436 17 "starttime:=time()" }{TEXT -1 12 " before and " }{TEXT 437 32 "elapsed_time:=time() - starttime" }{TEXT -1 30 " after the command.\n(1) using " }{TEXT 401 3 "sum" } {TEXT -1 2 ", " }}{PARA 0 "" 0 "" {TEXT -1 10 "(2) using " }{TEXT 402 3 "add" }{TEXT -1 6 ", and " }}{PARA 0 "" 0 "" {TEXT -1 12 "(3) using \+ a " }{TEXT 403 7 "do loop" }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 "[" }{TEXT 404 7 "Remark:" } {TEXT -1 215 " If you look closely at the answers you may find somethi ng wrong. A bug!] Note that for such a problem one really should use \+ add since the limits on the sum are integers and not variables.\n\n(b) Try to use each of " }{TEXT 439 3 "add" }{TEXT -1 5 " , a " }{TEXT 440 7 "do loop" }{TEXT -1 5 " and " }{TEXT 442 3 "sum" }{TEXT -1 22 " \+ to find the value of " }{XPPEDIT 18 0 "sum((-1)^n/n,n = 1 .. infinity) ;" "6#-%$sumG6$*&),$\"\"\"!\"\"%\"nGF)%\"nGF*/F,;F)%)infinityG" } {TEXT -1 2 " " }{TEXT 441 4 "HINT" }{TEXT -1 136 ". One command will \+ work, another will give an error message and one will run till you hit the stop button and interrupt the computation." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 406 7 "Problem" }{TEXT -1 1 " " }{TEXT 407 1 "3" }{TEXT -1 127 ". The following program generates a 20 x51 matrix M of 0's and 1's. (This is an example of a 1-dimensional c ellular automaton.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 33 "(a) Print out the matrix M using " }{TEXT 408 6 "printf " }{TEXT -1 52 " with no spaces between the 0's and 1's in each row." }}{PARA 0 "" 0 "" {TEXT -1 9 "\n(b) Use " }{TEXT 410 3 "map" }{TEXT -1 207 " to change each 0 in the matrix M to the blank string \" \" a nd, each 1 in the matrix to the string \"X\". [For this it will help \+ to write a procedure which will output \" \" upon input 0 and \"X\" up on input 1.] " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 9 "Then use " }{TEXT 409 6 "printf" }{TEXT -1 11 " with the \+ " }{TEXT 411 2 "%s" }{TEXT -1 92 " format code to print the matrix of \+ blanks and X's with no spaces between them on each row. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "L:=[seq(0,i=1..25),1,seq(0,i=1..25)]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "f:=proc(X)\nlocal i;\n[X[1]+X[2] mod 2, seq(X[i-1]+X [i]+X[i+1] mod 2, i=2..50), X[50]+X[51] mod 2];\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "M:=matrix(20,51,[seq((f@@n)(L),n = \+ 0..19)]):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 444 9 "Problem 4" }{TEXT -1 199 ". Use the following program to generate a set S of 2 x 2 matrices w ith random entries 0 and 1. By initializing the global variable _seed \+ to 1 everyone will obtain exactly the same set of matrices." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 140 "restart:\nwith(linalg):\n_s eed:=1:\ndie:=rand(0..1):\nS:=\{\}:\nfor i from 1 to 100 do\nS:=S unio n \{matrix([[die(),die()],[die(),die()]])\}:\nend do:\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "Execute the command:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "nops(S);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "You should get 100. But there are only " }{XPPEDIT 18 0 " 2^4 = 16;" "6#/*$\"\"#\"\"%\"#;" }{TEXT -1 85 " 2 x 2 matrices with e ntries 0 and 1! If you execute the following command it will " } {TEXT 445 6 "appear" }{TEXT -1 62 " that there are only 16 matrices in S. This is not the case. \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "S; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 9 "\nUse the " }{TEXT 446 5 "equal" }{TEXT -1 238 " command in the linear algebra package to determine how many times each of the 16 2x2 0-1 matrices appears in the set S.\n\nThe following can be used to find the list T of all 2x2 matrices with entries 0 and 1. You may find this useful.\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "L:=[[0,0],[1,0],[0,1],[1,1] ]:\nT:= NULL:\nfor i from 1 to 4 do\n for j from 1 to 4 do\n T:= eval (T), matrix([L[i],L[j]]);\n od;\nod;\nT:=[T]:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 154 "(a) For each i from 1 to 16 find the number c[i] of times that the matrix T[i] appears in t he set S. Print out these values in a column of the form \n\n1, 2" }} {PARA 0 "" 0 "" {TEXT -1 4 "2, 8" }}{PARA 0 "" 0 "" {TEXT -1 4 "3, 4" }}{PARA 0 "" 0 "" {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 5 "16,10" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 74 "[Note tha t the c[i]'s depend on the initial value chosen for the variable " } {TEXT 447 5 "_seed" }{TEXT -1 80 " at the beginning.]\n\n(b) Print out the matrix which occurs most frequently in S." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}} {MARK "16" 0 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 1 2 33 1 1 }