{VERSION 2 3 "APPLE_68K_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{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 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE " " 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 24 "Why the Normal Function? " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 417 "The \+ purpose of this laboratory is to look at some probability density func tions for sums of many independent random numbers. In theory this is \+ easy but in practice the kinds of integrals involved are difficult for calculator- and computer-based integration routines to work with. Fo r this reason we define and use some special purpose procedures of our own. Your browser window explains the procedures that we use." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 34 "As an exa mple we work with the PDF" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT -1 31 "Psi(x) = 1/2, if -1 <= x <= 1" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 26 "Evaluate the next cell now" }{TEXT -1 25 ". It defines this pdf. " }{TEXT 257 67 "Thi s is the only cell that you will need to modify for this module." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "psi := x -> 1/2:\na := -1:\nb := 1:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "The next step is to repre sent this initial pdf as a table of values. " }{TEXT 258 27 "Evaluate the next cell now." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 330 "n := 50: # Use 50 samp le points in table.\nh := evalf((b - a)/n): # Interval width for t able.\ntotal := sum(evalf(psi(a + j * h)),j=0..n):\nftable := [seq(eva lf(psi(a + j * h))/total,j=0..n)]:\ngtable := [seq([a + j*h, ftable[j+ 1]],j=0..n)]:\n\nplot(gtable,x=a..b,y=0..max(op(ftable)),xtickmarks=0, ytickmarks=0);\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 35 "The next cell defines a procedure " }{TEXT 259 8 "convolve" }{TEXT -1 54 " that computes the convolution of a pdf wi th itself. " }{TEXT 260 27 " Evaluate the next cell now" }{TEXT -1 1 " ." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "convolve := pdf -> [seq(\n sum(pdf[j+1] * pdf[k - j + 1],j=max(0,k-n)..min(n, k)),k=0..2*n)]:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 92 "The next cell computes th e pdf for the sum of two independent random numbers of this kind. " } {TEXT 261 16 "Evaluate it now." }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 182 "a := a + a:\nb := b + b:\nftable := convolve( ftable):\nn := n + n:\n\ngtable := [seq([a + j*h, ftable[j+1]],j=0..n) ]:\n\nplot(gtable,x=a..b,y=0..max(op(ftable)),xtickmarks=0,ytickmarks= 0);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 154 "The next cell repeats the previous cell and computes and graphs the pdf for the sum of four independent random numbers like ou r original random numbers. " }{TEXT 262 16 "Evaluate it now." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "a := a + a:\nb := b + b:\nftable := convolve(ftable):\nn := n + n:\n\ngtable := [seq([a + j*h, ftable[j+1]],j=0..n)]:\n\nplot(gtable, x=a..b,y=0..max(op(ftable)),xtickmarks=0,ytickmarks=0);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 155 "The next cell repeats the previous cell and computes and graphs the pdf for th e sum of eight independent random numbers like our original random num bers. " }{TEXT 263 16 "Evaluate it now." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 182 "a := a + a:\nb := b + b:\nftable := convolve(ftable):\nn := n + n:\n\ngtable := [seq([a + j*h, ftable[j+1]],j=0..n)]:\n\nplot(gtable,x=a..b,y=0..max(op(ftable) ),xtickmarks=0,ytickmarks=0);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 24 }{VIEWOPTS 1 1 0 1 1 1803 }