{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 "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 "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 "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "# \n# Periode eines \+ Zufallszahlengenerators\n# (einfache Variante ohne Einlauf)\n# " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "m:=100;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "a:=31;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "b:=17;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "s0:=1;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "s:=s0;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 108 "for i from 1 while i < 200 do\n s:=a*s+b mo d m;\n print(i,s);\n if (s = s0) then break end if; \nend do:" } }{PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "i; # Periode des Generators" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "#\n# Bestimmung der Periode des Maple-Generators rand ()\n#" }}{PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "rand();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "r and();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "die := rand(1..6) :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "die();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "die();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "readlib(randomize);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#R6#%\"nG6\"6#%inCopyright~(c)~1995~by~Waterloo~Maple~Inc.~All~rights ~reserved.GF&C$@)/9#\"\"!>%&_seedG-%$absG6#-%&iolibG6#\"#D52\"\"\"F,4- %%typeG6$9$%'posintGYQXwrong~argument,~usage:~randomize()~or~randomize (posint)6\"/-%$modG6$F>\"-*)**********F-C$>F/F9OF>>F/F>F/6#%OReset~the ~seed~for~the~random~number~generatorG6#F/F&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "randomize(1); # Setzt 1 als Startwert des Zufal lszahlengenerators rand()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "_seed; # Zeigt den aktuellen Startwert des Zufallszahlengenerator s rand()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "s1:=rand(); # N eue Zufallszahl mit Startwert 1: s1 = a+b mod m" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 73 "randomize(2); # Setzt 2 als Startwert des Zuf allszahlengenerators rand()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "s2:=rand(); # Neue Zufallszahl mit Startwert 2: s1 = 2*a+b mod m " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "2*s1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "a:=s1; # Da s2 = 2*s1, so ist a=s1 und b =0!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "b:=0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "randomize(3); # Setzt 3 als Startw ert des Zufallszahlengenerators rand()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "s3:=rand(); # Neue Zufallszahl mit Startwert 3: s1 = \+ 3*a mod m" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "m:=3*a-s3;" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "# Kontrolle" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "m;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "a;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "b;" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "s:=1; # Startwert" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "randomize(s); # Setzt s als Startwert des Zufallszahlengenerators rand()" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 136 "for i from 1 while i <= 10 do\n s:=a*s+b mod \+ m;\n s_maple:=rand();\n print(i,s,s_maple);\n if (s = s0) then b reak end if; \nend do:" }}{PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "33 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }