{VERSION 5 0 "IBM INTEL LINUX" "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 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 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 8 2 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 0 } 3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {SECT 0 {PARA 3 "" 0 "" {TEXT -1 16 "Pascal Triangle:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "In this e xercise we want to study some properties of Pascal's triangle using Ma ple." }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 31 "Number of odd elements in a row" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 91 "The following Maple program determines for an inputted integer m and \+ for all n from 1 to m " }}{PARA 0 "" 0 "" {TEXT -1 61 "the number of b inomial coefficient (n choose k) which is odd." }}{PARA 0 "" 0 "" {TEXT -1 82 "Try it for the first m=50 integers to get an idea about r egularities in the result" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "rest art;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "m := readstat(`Inpu t an integer:`);" }}}{EXCHG {PARA 0 "Input an integer:" 0 "" {MPLTEXT 1 0 2 "5;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"mG\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for n from 1 to m by 1 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "ulige(n) := 0:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "for i from 0 to n by 1 do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "coef := binomia l(n,i);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "if coef mod 2 = 1 then u lige(n) := ulige(n) + 1;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "print(`The number of odd binomial coefficients for` , n , ` i s`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "print(ulige(n));" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 11 "" 1 "" {TEXT -1 0 "" } {MPLTEXT 1 0 0 "" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%&uligeG6#\"\"\" \"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%%LThe~number~of~odd~binomial~ coefficients~forG\"\"\"%&~~~isG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\" \"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%&uligeG6#\"\"#\"\"!" }} {PARA 11 "" 1 "" {XPPMATH 20 "6%%LThe~number~of~odd~binomial~coefficie nts~forG\"\"#%&~~~isG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>-%&uligeG6#\"\"$\"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%%LThe~number~of~odd~binomial~coefficients~forG\"\" $%&~~~isG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>-%&uligeG6#\"\"%\"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%%LThe~number~of~odd~binomial~coefficients~forG\"\"%%&~~~isG" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%&uligeG6#\"\"&\"\"!" }}{PARA 11 "" 1 "" {XPPMATH 20 "6%%LThe~num ber~of~odd~binomial~coefficients~forG\"\"&%&~~~isG" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#\"\"%" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 15 "Toward s a guess" }}{PARA 0 "" 0 "" {TEXT -1 108 "If you have no particular i dea about the structure of the numbers computed above, then perform th e following" }}{PARA 0 "" 0 "" {TEXT -1 11 "with Maple:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 106 "Given an integer n, write it in its binary notation and calculate the number of 1s in thi s representation." }}{PARA 0 "" 0 "" {TEXT -1 72 "Finally, raise this \+ number to base 2 and compare with the results above." }}{PARA 0 "" 0 " " {TEXT -1 1 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "for j fro m 1 to m do" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "dualrepresentation(j ) := convert(j, base , 2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "numbe rofones[j] := sum(dualrepresentation(j)[s], s=1..nops(dualrepresentati on(j))):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "print(`Computing 2 to t he power of the number of 1s in the dual representation gives `);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "print(2^numberofones[j]);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "print(`and the number of odd coefficients was`);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "print(ulige(j));" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "od;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%3dualrepresentationG6#\"\"\"7#F'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%-numberofonesG6#\"\"\"F'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#% ioComputing~2~to~the~power~of~the~number~of~1s~in~the~dual~representat ion~gives~G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%Gand~the~number~of~odd~coefficients~wasG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-% 3dualrepresentationG6#\"\"#7$\"\"!\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%-numberofonesG6#\"\"#\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#%ioComputing~2~to~the~power~of~the~number~of~1s~in~the~dual~represen tation~gives~G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%Gand~the~number~of~odd~coefficients~wasG" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%3dualrepresentationG6#\"\"$7$\"\"\"F)" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%-numberofonesG6#\"\"$\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%ioComputing~2~to~the~power~of~the~number~of~1s~in~the~ dual~representation~gives~G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%Gand~the~number~of~odd~coefficients ~wasG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%3dualrepresentationG6#\"\"%7%\"\"!F)\"\"\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%-numberofonesG6#\"\"%\"\"\"" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#%ioComputing~2~to~the~power~of~the~number~of~1s~ in~the~dual~representation~gives~G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# \"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%Gand~the~number~of~odd~coeff icients~wasG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>-%3dualrepresentationG6#\"\"&7%\"\"\"\"\"!F)" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%-numberofonesG6#\"\"&\"\"#" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#%ioComputing~2~to~the~power~of~the~num ber~of~1s~in~the~dual~representation~gives~G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%Gand~the~numb er~of~odd~coefficients~wasG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }