{VERSION 5 0 "IBM INTEL NT" "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 "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 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 "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 " " 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 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 }{PSTYLE "T itle" 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 "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 } } {SECT 0 {PARA 18 "" 0 "" {TEXT -1 10 "Partitions" }}{PARA 19 "" 0 "" {TEXT -1 17 "Jeremy R. Johnson" }}{PARA 0 "" 0 "" {TEXT -1 99 "Let n b e a non-negative integer. An integer partition of n is a sequence of \+ non-negative integers " }{XPPEDIT 18 0 "n[1]" "6#&%\"nG6#\"\"\"" } {TEXT -1 5 ",...," }{XPPEDIT 18 0 "n[k]" "6#&%\"nG6#%\"kG" }{TEXT -1 11 " such that " }{XPPEDIT 18 0 "Sum(n[i],i=1..k) = n" "6#/-%$SumG6$&% \"nG6#%\"iG/F*;\"\"\"%\"kGF(" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 110 "We do not distinguish between partitions that are obtained by \+ rearranging elements. Therefore, we assume that" }}{PARA 0 "" 0 "" {XPPEDIT 18 0 "n[1]" "6#&%\"nG6#\"\"\"" }{TEXT -1 4 " >= " }{XPPEDIT 18 0 "n[2]" "6#&%\"nG6#\"\"#" }{TEXT -1 11 " >= ... >= " }{XPPEDIT 18 0 "n[k]" "6#&%\"nG6#%\"kG" }{TEXT -1 65 ". Except when n = 0, we do n ot allow 0 to appear in a partition." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 33 "The 7 integer partitions of 5 are" }} {PARA 0 "" 0 "" {TEXT -1 3 "[5]" }}{PARA 0 "" 0 "" {TEXT -1 5 "[4,1]" }}{PARA 0 "" 0 "" {TEXT -1 5 "[3,2]" }}{PARA 0 "" 0 "" {TEXT -1 7 "[3, 1,1]" }}{PARA 0 "" 0 "" {TEXT -1 7 "[2,2,1]" }}{PARA 0 "" 0 "" {TEXT -1 9 "[2,1,1,1]" }}{PARA 0 "" 0 "" {TEXT -1 11 "[1,1,1,1,1]" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 193 "Partitions can be ordered lexicographically as in the previous example. Using this \+ ordering, we can speak of the next partition simply as the partition t hat comes next in lexicographic order. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 411 "In this worksheet, we derive a recu rsive function to generate all partitions of a given size. This recur sive program can be easily modified to obtain a procedure that counts \+ the number of partitions without generatating them. Finally we writ e a function to generate the next partition. The next function can be used to generate all partitions of a given size. Partitions are repr esented using Maple lists." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 302 "It is easy to see that all of the partitions of \+ (n-1) are contained in the partitions of n. For example, see the part itions of 7 in the introduction and select from them all partitions en ding with 1. These are the partitions of 6. However, it is not clear how to generate the remaining partitions. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 165 "One possible approach would be to generate all partitions of size 1,2,...,n-1, and for each partitio n of size k, add n-k. After generating all such partitions, they" }} {PARA 0 "" 0 "" {TEXT -1 157 "can be combined. Surely this generates \+ all partitions, however, there are many duplicates. If we generate a \+ set of partitions by taking the union of all of" }}{PARA 0 "" 0 "" {TEXT -1 84 "these partitions, duplicates are removed. Here is a Mapl e procedure that does this." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 607 "# Generate all integer partitions \+ of n.\n# Input a positive integer n.\n# Output a set of all partitions of n. Note that the partitions are not generated in lex. order.\ngen part := proc(n) option remember;\n local P,P1,i;\n if (n = 1) then R ETURN(\{[1]\}); fi;\n P := \{[n]\};\n for i from 1 to n-1 do\n P1 := genpart(i);\n P1 := map(p->sort([op(p),n-i]),P1); # Note that \+ map can be applied to sets.\n P := P union P1; \+ # Also note that it is necessary to sort the parition\n od; \+ # otherwise the same parition may be generat ed twice.\n RETURN(P);\nend;\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%( genpartGf*6#%\"nG6%%\"PG%#P1G%\"iG6#%)rememberG6\"C&@$/9$\"\"\"-%'RETU RNG6#<#7#F3>8$<#7#F2?(8&F3F3,&F2F3F3!\"\"%%trueGC%>8%-F$6#F>>FD-%$mapG 6$f*6#%\"pGF.6$%)operatorG%&arrowGF.-%%sortG6#7$-%#opG6#F2,&T$F3T%F@F. F.6&F'F2F+F>FD>F:-%&unionG6$F:FD-F56#F:F.F.F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(3);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #<%7#\"\"$7$\"\"\"\"\"#7%F'F'F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(7);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#<17#\"\"(7$\" \"\"\"\"'7$\"\"#\"\"&7%F'F'F+7$\"\"$\"\"%7%F'F*F/7&F'F'F'F/7%F'F.F.7%F *F*F.7&F'F'F*F.7'F'F'F'F'F.7'F'F'F'F*F*7&F'F*F*F*7(F'F'F'F'F'F*7)F'F'F 'F'F'F'F'" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 293 "The problem with this approach is that unnecessary work is don e since the same partition can be generated more than once and must th en be removed with the union operation. Also it is necessary to sort \+ individual partitions to obtain the canonical representation described in the introduction." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 444 "In order to obtain a clean recursive definitions of p artitions, we generalize the notion of partitions to partitions whose \+ elements are less than or equal to k. Let P(n,k) be the set of partit ions of n whose elements are not greater than k. Clearly the partitio ns of n are equal to P(n,n). The benefit of introducing the extra par ameter k, is that it is easy to obtain a recursive construction of P(n ,k) in general and P(n,n) in particular." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 392 "The recursive definition is based on the following idea: An partition of P(n,k) either has atleast one element equal to k or all of its elements are less than k. Therefore , P(n,k) = \{ [p,k] for p in P(n-k,min(k,n-k)) union P(n,k-1)\}. The notation [p,k] means obtain a partition of n from a partition of n-k \+ be adding k. The following Maple procedure implements this recursive \+ definition." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 441 "# Generate all of the integer partitions of n usin g elements no\n# larger than k.\n# Inputs: n,k non-negitive integers. n >= k.\n# Output: A list of all partitions of n using elements <= k .\ngenpartmax := proc(n,k) option remember;\n local i;\n if (k = 1) \+ then RETURN([[seq(1,i=1..n)]]); fi;\n if (n = 0) then RETURN([[]]); f i;\n RETURN([op( map(p -> [op(p),k],genpartmax(n-k,min(k,n-k))) ), \n op(genpartmax(n,k-1))\n ]);\nend;\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%+genpartmaxGf*6$%\"nG%\"kG6#%\"iG6#%)rememberG6 \"C%@$/9%\"\"\"-%'RETURNG6#7#7#-%$seqG6$F2/8$;F29$@$/F>\"\"!-F46#7#7\" -F46#7$-%#opG6#-%$mapG6$f*6#%\"pGF-6$%)operatorG%&arrowGF-7$-FJ6#F>T$F -F-6$F(F1-F$6$,&F>F2F1!\"\"-%$minG6$F1Ffn-FJ6#-F$6$F>,&F1F2F2FgnF-F-F- " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 139 "Thi s procedure can be used to generate all partitions of n using the obse rvation that P(n), the set of partitions of n is equal to P(n,n)." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "\n# a procedure to generate the integer partitions of n.\ngenpart \+ := proc(n)\n genpartmax(n,n);\nend;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%(genpartGf*6#%\"nG6\"F(F(-%+genpartmaxG6$9$F,F(F(F(" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(3);\n" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7%7#\"\"$7$\"\"\"\"\"#7%F'F'F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(4);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7'7#\"\"%7$\"\"\"\"\"$7$\"\"#F*7%F'F'F*7&F'F'F'F'" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(5);\n" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7)7#\"\"&7$\"\"\"\"\"%7$\"\"#\"\"$7%F'F'F+7%F'F* F*7&F'F'F'F*7'F'F'F'F'F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(6);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7-7#\"\"'7$\"\"\"\" \"&7$\"\"#\"\"%7%F'F'F+7$\"\"$F.7%F'F*F.7&F'F'F'F.7%F*F*F*7&F'F'F*F*7' F'F'F'F'F*7(F'F'F'F'F'F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "genpart(7);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#717#\"\"(7$\"\"\"\" \"'7$\"\"#\"\"&7%F'F'F+7$\"\"$\"\"%7%F'F*F/7&F'F'F'F/7%F'F.F.7%F*F*F.7 &F'F'F*F.7'F'F'F'F'F.7&F'F*F*F*7'F'F'F'F*F*7(F'F'F'F'F'F*7)F'F'F'F'F'F 'F'" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 101 " The number of partitions of a given size can be obtained by generating all partitions and using nops." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "for i from 1 to 7 do\n nops(genpart(i));\nod;\n" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"# " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"(" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"#6" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#\"#:" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 186 "This is an inefficient way to count partitions. It is unnecessar y to generate partitions in order to count them. The same logic can b e used to count partitions without generating them." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "# a funct ion to compute the number of integer partitions of n.\nnumpart := proc (n)\n numpartmax(n,n);\nend;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%( numpartGf*6#%\"nG6\"F(F(-%+numpartmaxG6$9$F,F(F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 253 "# Compute the number of integer partitions of n using elements no\n# larger than k.\nnumpartmax := proc(n,k) opt ion remember;\n if (k = 1) then RETURN(1); fi;\n if (n = 0) then RET URN(1); fi;\n RETURN(numpartmax(n-k,min(k,n-k)) + numpartmax(n,k-1)); \nend;\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%+numpartmaxGf*6$%\"nG%\" kG6\"6#%)rememberGF)C%@$/9%\"\"\"-%'RETURNG6#F0@$/9$\"\"!F1-F26#,&-F$6 $,&F6F0F/!\"\"-%$minG6$F/F=F0-F$6$F6,&F/F0F0F>F0F)F)F)" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Maple has a functio n to count partitions in its combinat package. We load this package a nd compare results." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(combinat):\n" }}{PARA 7 "" 1 "" {TEXT -1 67 "Warning, the protected name Chi has been redefined and unprotec ted\n" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "for i from 1 to 20 do\n print(i,numpart(i),combinat[ numbpart](i));\nod;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"\"F#F#" } }{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"#F#F#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"$F#F#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"%\"\"& F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"&\"\"(F$" }}{PARA 11 "" 1 " " {XPPMATH 20 "6%\"\"'\"#6F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"( \"#:F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\")\"#AF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"\"*\"#IF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"# 5\"#UF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#6\"#cF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#7\"#xF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#8 \"$,\"F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#9\"$N\"F$" }}{PARA 11 " " 1 "" {XPPMATH 20 "6%\"#:\"$w\"F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6% \"#;\"$J#F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#<\"$(HF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#=\"$&QF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#>\"$!\\F$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%\"#?\"$F'F$" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 204 "An alter native approach to generating partitions is to create a \"next\" funct ion that given a partition of n, generates the next partition in lexic ographic order. The functions lpart and nextpart do this." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 232 "# C ompute the largest partition of n with elements no larger than k.\nlpa rt := proc(n,k)\n local P,np,kp;\n P := []; np := n;\n while (np < > 0) do\n kp := min(k,np);\n P := [op(P),kp];\n np := np - kp ;\n od;\n RETURN(P);\nend;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&l partGf*6$%\"nG%\"kG6%%\"PG%#npG%#kpG6\"F-C&>8$7\">8%9$?(F-\"\"\"F6F-0F 3\"\"!C%>8&-%$minG6$9%F3>F07$-%#opG6#F0F;>F3,&F3F6F;!\"\"-%'RETURNGFDF -F-F-" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lpart(5,1);\n" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#7'\"\"\"F$F$F$F$" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lpart(5,2);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%\"\"#F$\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lp art(5,3);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$\"\"$\"\"#" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lpart(5,4);\n" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#7$\"\"%\"\"\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "lpart(5,5);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#\" \"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 333 "# Compute the next \+ partition.\n# Inputs: an integer n and a partition, P, of n.\nnextpar t := proc(n,P)\n local Pp,t,s,k,i;\n if (P = [seq(1,i=1..n)]) then \+ \n RETURN([n]);\n fi;\n t := nops(P); s := 0; \n while (P[t] ! = 1) do\n s := s+1; t := t - 1;\n od;\n s := s + P[t]; k := P[t ]-1;\n [op(P[1..(t-1)]),op(lpart(s,k))];\nend;\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%)nextpartGf*6$%\"nG%\"PG6'%#PpG%\"tG%\"sG%\"kG%\"iG6 \"F/C)@$/9%7#-%$seqG6$\"\"\"/8(;F89$-%'RETURNG6#7#F<>8%-%%nopsG6#F3>8& \"\"!?(F/F8F8F//-%*factorialG6#&F36#FBF8C$>FG,&FGF8F8F8>FB,&FBF8F8!\" \">FG,&FGF8FNF8>8',&FNF8F8FU7$-%#opG6#&F36#;F8FT-Fgn6#-%&lpartG6$FGFYF /F/F/" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "n := 5; P := [n]; \n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"nG\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"PG7#\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "for i from 1 to numpart(n) do\n print(P):\n P := nextpart(n,P) :\nod:\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7#\"\"&" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#7$\"\"%\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7$\" \"$\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%\"\"$\"\"\"F%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%\"\"#F$\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7&\"\"#\"\"\"F%F%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7' \"\"\"F$F$F$F$" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 110 "Finally, we empirically investigate the growth rate of t he function p(n) = the number of partitions of size n." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "p:=seq( numbpart(n),n=1..20);\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"pG66\" \"\"\"\"#\"\"$\"\"&\"\"(\"#6\"#:\"#A\"#I\"#U\"#c\"#x\"$,\"\"$N\"\"$w\" \"$J#\"$(H\"$&Q\"$!\\\"$F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 137 "points := proc(start,step,len,data)\n local i,ind;\n ind := [se q(start+i*step,i=0..(len-1))];\n RETURN(zip((x,y)->[x,y],ind,data)); \nend;\n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'pointsGf*6&%&startG%%st epG%$lenG%%dataG6$%\"iG%$indG6\"F.C$>8%7#-%$seqG6$,&9$\"\"\"*&8$F89%F8 F8/F:;\"\"!,&9&F8F8!\"\"-%'RETURNG6#-%$zipG6%f*6$%\"xG%\"yGF.6$%)opera torG%&arrowGF.7$F7F;F.F.F.F19'F.F.F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "pxy := points(1,1,nops([p]),[p]);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$pxyG767$\"\"\"F'7$\"\"#F)7$\"\"$F+7$\"\"%\"\"&7$F .\"\"(7$\"\"'\"#67$F0\"#:7$\"\")\"#A7$\"\"*\"#I7$\"#5\"#U7$F3\"#c7$\"# 7\"#x7$\"#8\"$,\"7$\"#9\"$N\"7$F5\"$w\"7$\"#;\"$J#7$\"#<\"$(H7$\"#=\"$ &Q7$\"#>\"$!\\7$\"#?\"$F'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name cha ngecoords has been redefined\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "pointplot(pxy);\n" }}{PARA 13 "" 1 "" {GLPLOT2D 496 496 496 {PLOTDATA 2 "6#-%'POINTSG667$$\"\"\"\"\"!F'7$$\"\"#F)F+7$$\"\"$F)F.7$$ \"\"%F)$\"\"&F)7$F3$\"\"(F)7$$\"\"'F)$\"#6F)7$F6$\"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{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "pointplot(lpxy); \n" }}{PARA 13 "" 1 "" {GLPLOT2D 496 496 496 {PLOTDATA 2 "6#-%'POINTSG 667$$\"\"\"\"\"!$F)F)7$$\"\"#F)$\"+1=ZJp!#57$$\"\"$F)$\"+*G7')4\"!\"*7 $$\"\"%F)$\"+7zV4;F67$$\"\"&F)$\"+\\,\"f%>F67$$\"\"'F)$\"+t_*yR#F67$$ \"\"(F)$\"+,-03FF67$$\"\")F)$\"+`C/\"4$F67$$\"\"*F)$\"+#Q(>,MF67$$\"#5 F)$\"+='pwt$F67$$\"#6F)$\"+\"p^`-%F67$$\"#7F)$\"+Aa!QM%F67$$\"#8F)$\"+ <07:YF67$$\"#9F)$\"+yZF0\\F67$$\"#:F)$\"+&*R[q^F67$$\"#;F)$\"+6xTUaF67 $$\"#F)$\"+\"R0W>'F67$$\"#?F )$\"+Tl%4W'F6" 1 2 0 1 10 0 2 9 1 4 2 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 "Clearly p(n) is growing faster than quadratic. We can double c heck this by computing p(n)/n^2." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "seq(evalf(numbpart(n)/n^2),n =1..50);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6T$\"\"\"\"\"!$\"+++++]!#5 $\"+LLLLLF($\"++++DJF($\"+++++GF($\"+cbbbIF($\"+!\\C71$F($\"+++]PMF($ \"+/Pq.PF($\"+++++UF($\"+u\"*4GYF($\"+AAAZ`F($\"+h8LwfF($\"+-^v()oF($ \"+AAAAyF($\"++vVB!*F($\"+h;oF5!\"*$\"+0;F)=\"FG$\"+?2Md8FG$\"+++]n:FG $\"+n$=fz\"FG$\"+MzCq?FG$\"+c2SsBFG$\"++]PMFFG$\"+++!G8$FG$\"+'H]Ng$FG $\"+fP%*GTFG$\"+RpMUZFG$\"+J=1GaFG$\"+nmmEiFG$\"+9qm>rFG$\"+7.K`\")FG$ \"+(e\\SJ*FG$\"+$*)y[1\"!\")$\"+w(Q\\@\"Fdo$\"+)>9rQ\"Fdo$\"+8n\\!e\"F do$\"+)z#f,=Fdo$\"+eeH]?Fdo$\"++]iLBFdo$\"+F8<_EFdo$\"+$4*R9IFdo$\"+** GO@MFdo$\"+)>1I)QFdo$\"+7!z;S%Fdo$\"+FLc))\\Fdo$\"+?G`ZcFdo$\"+#Hd?R'F do$\"+,q>FsFdo$\"+++/p\")Fdo" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 81 "In fact p(n) is growing facter than quadr atic. Let's try a few more comparisons." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "seq(evalf(numbpart(n) /n^3),n=1..50);\n" }}{PARA 12 "" 1 "" {XPPMATH 20 "6T$\"\"\"\"\"!$\"++ +++D!#5$\"+66666F($\"+++]7y!#6$\"+++++cF-$\"+$f#f#4&F-$\"+Vy&=gX%F-$\"+qz<(f%F-$\"+t ]#)>\\F-$\"+:[\"[@&F-$\"+Q%['RcF-$\"+Ti=XgF-$\"+;*3:g'F-$\"+F&)*Q9(F-$ \"+++]PyF-$\"+DA*>b)F-$\"+\")y@5%*F-$\"+!fy9.\"F($\"+8$F($\"+WODrMF($\"+$*\\4`QF($\"+QF hrUF($\"+yO.TZF($\"+n)orD&F($\"++D1MeF($\"+`0rokF($\"+)pSr<(F($\"+/zlc zF($\"+(39]#))F($\"+;*3:y*F($\"+)GqW3\"!\"*$\"+GFg,7F\\q$\"+-'y;L\"F\\ q$\"+k\"Q\\Z\"F\\q$\"++!3Qj\"F\\q" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "seq(evalf(numbpart(n)/n^5),n=1..50);\n" }}{PARA 12 " " 1 "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