{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 "" -1 257 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 259 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE " " -1 260 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "Courier" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 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 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 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 } {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 }{PSTYLE "Normal" -1 258 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 257 "" 0 "" {TEXT -1 203 "The Birthday Problem: w ith a certain number of people, what's the probability that two will h ave the same birthday? What's the least number of people needed so th at this probability is greater than 50%?" }{MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 256 "" 0 "" {TEXT -1 26 "Procedure: Run two loops, " } {TEXT 257 1 "i" }{TEXT -1 5 " and " }{TEXT 258 1 "j" }{TEXT -1 8 ". L oop " }{TEXT 260 1 "i" }{TEXT -1 52 " runs while the probability is le ss than 0.5. Loop " }{TEXT 259 1 "j" }{TEXT -1 11 " processes " } {TEXT 261 1 "i" }{TEXT -1 75 " people and returns the probability of t wo people having the same birthday." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "x := 0:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 128 "for i from 0 while x < 0.50 do\n x := 1:\n for j from 0 to i do\n x := evalf(x * (365 -j)/365):\n end do:\n x := 1 - x:\nend do:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print (j):" }}}{EXCHG {PARA 258 "" 0 "" {TEXT -1 90 " What about 75%? 90%? Simply change the 0.5 above to reflect differen t set probabilities." }{MPLTEXT 1 0 0 "" }}}}{MARK "1 2 0" 128 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }