{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 0 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 }{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 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 20 "Probabilistic Models" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 49 "The cell \+ below defines and executes a procedure " }{TEXT 256 8 "roulette" } {TEXT -1 53 " that simulates 100 \"plays\" of the timid strategy. " }{TEXT 257 14 "Execute it now" }{TEXT -1 189 ". You can use it as is \+ to answer the first question in your browser window -- how likely are \+ you to win using the timid strategy? You will need to modify it to an swer the other questions." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 777 "spinner := rand(1..38):\n\nroulett e := proc()\n local i, wins, losses, wallet, spin;\n \+ wins := 0:\n losses := 0:\n for i from 1 to 100 do\n wallet := 10;\n while ((wallet < 20) and (0 < wallet)) do\n if (spinner() <= 18 ) then\n wallet := wallet + 1;\n \+ else\n wallet := wallet - 1;\n \+ fi;\n od;\n if (wallet = 20) t hen\n wins := wins + 1;\n else\n \+ losses := losses + 1;\n fi;\n od;\n \+ print(`losses = `);\n print(losses);\n print(`w ins = `);\n print(wins);\n end:\n\nroulette(); " }}}}{MARK "0 2 4" 189 }{VIEWOPTS 1 1 0 1 1 1803 }