2wbf(program (define VARIABLE (A) {} )  2, VARIABLE, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , A, , 0 ; VARIABLE(A); | (define VARIABLE (C) {} )  2, VARIABLE, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , C, , 0 ; VARIABLE(C); | (define VARIABLE (I) {} )  2, VARIABLE, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , I, , 0 ; VARIABLE(I); | (define VARIABLE (P) {} )  2, VARIABLE, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , P, , 0 ; VARIABLE(P); | (define VARIABLE (EXACTAREA) {} )  2, VARIABLE, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , EXACTAREA, , 0 ; VARIABLE(EXACTAREA); | )make variable(a); make variable(c); make variable(i); make variable(p); make variable(exactarea) h`titleMonte Carlo Area Simulations;W>qV="Arial(V/):8VOnameAnthony D. Berard, Jr. King's College Wilkes-Barre, PA 18711 (570)-208-5900 ext 5496 adberard@kings.eduPvI"ArialN/)<N DnameTo Illustrate the relationship between probability and areatV>="ArialN/)<N nameObjective:5fI"ArialN/)<N platformPlatform:&Pf"ArialN/)<N MathKitMathKit or any programming environment which supports random number generation((F;"ArialN/)<N levelLevel:m{:"ArialN/)<N level2Probability (Elementary or Advanced)u{z;"ArialN/)<N prereqPrerequisites:="ArialN/)<N noneNone19"ArialN/)<N  Number1$"Arial18 HText2 Area# <:"Arial8 HText1 Number%>!"Arial8 HNumber6'6: area**''od*d'"Small Fonts;w=Begin(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (fix 5) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) (polyline (eval {vector[vector[0,1/2,1/2],vector[1/2,1/2,0]]})) (penwidth 2) (make NUMBER {scroll("Number") } ) (make C 0 )  0 , C ; (if {check("Graphics") } THEN (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {and(X`1/2,Y`1/2) } THEN (program (make C {C+ 1 } ) )) (program (pencolor 1) (point (eval {vector[X,Y]}))) (program (select "Number1") (print I )) (make A {C/I } )  0 , A ; (program (select "Area") (print A )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) ) ELSE (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {and(X`1/2,Y`1/2) } THEN (program (make C {C+ 1 } ) (make A {C/I } ) (make P {4*A } ) )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) )) (make I NUMBER )  0 , I ; (program (select "Number1") (print I )) (program (select "Area") (print A )) (penwidth 1) )clear; cleartext in "Number1"; cleartext in "Area"; precision 5; polyline[[0,0,1,1,0],[0,1,1,0,0]]; polyline[[0,1/2,1/2],[1/2,1/2,0]] ; penwidth 2; let number be getscroll("Number"); c:=0; if getcheck("Graphics") then {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if and(x<=1/2,y<=1/2) then {c:=c+1}; Draw point at [x,y]in color blue; print i in "Number1"; a:=c/i; print a in "Area"; i:=i+1}} else {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if and(x<=1/2,y<=1/2) then {c:=c+1; a:=c/i; p:=4*a}; i:=i+1};}; i:=Number; print i in "Number1"; print a in "Area"; penwidth 1 c;Graphics)V=Area$>j"Arial18 H(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) (polyline (eval {vector[vector[0,1/2,1/2],vector[1/2,1/2,0]]})) )clear; cleartext in "Number1"; cleartext in "Area"; polyline[[0,0,1,1,0],[0,1,1,0,0]]; polyline[[0,1/2,1/2],[1/2,1/2,0]]a Number;'< area**''od)h'"Small Fonts;w=Begin(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (program (select "Pi") (cleartext)) (fix 5) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) (define F (X) {sqrt(1- X^2) } )  2, F, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , X, , 0 ; F(X); SQRT(1-X^2) | (program (select 1) (graph F )) (penwidth 2) (make NUMBER {scroll("Number") } ) (make C 0 )  0 , C ; (if {check("Graphics") } THEN (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {Y`F(X) } THEN (program (make C {C+ 1 } ) )) (point (eval {vector[X,Y]})) (program (select "Number1") (print I )) (make A {C/I } )  0 , A ; (program (select "Area") (print A )) (make P {4*A } )  0 , P ; (program (select "Pi") (print P )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) ) ELSE (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {Y`F(X) } THEN (program (make C {C+ 1 } ) (make A {C/I } ) (make P {4*A } ) )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) )) (make I NUMBER )  0 , I ; (program (select "Number1") (print I )) (program (select "Area") (print A )) (program (select "Pi") (print P )) (penwidth 1) )clear; cleartext in "Number1"; cleartext in "Area"; cleartext in "Pi"; precision 5; polyline[[0,0,1,1,0],[0,1,1,0,0]]; make f(x) sqrt(1-x^2); Draw the graph of f in blue; penwidth 2; let number be getscroll("Number"); c:=0; if getcheck("Graphics") then {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if y<=f(x) then {c:=c+1}; Draw point at [x,y]; print i in "Number1"; a:=c/i; print a in "Area"; p:=4*a; print p in "Pi"; i:=i+1}} else {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if y<=f(x) then {c:=c+1; a:=c/i; p:=4*a}; i:=i+1};}; i:=Number; print i in "Number1"; print a in "Area"; print p in "Pi"; penwidth 1 4\VGraphics)eF;Text1 Number(&<"Arial8 HNumber1'"Arial18 HText2 Area&;"Arial8 HArea$ 8"Arial18 HText3 Pi#=W="Arial8 HPi$]"Arial18 H(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (program (select "Pi") (cleartext)) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) (define F (X) {sqrt(1- X^2) } )  2, F, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , X, , 0 ; F(X); SQRT(1-X^2) | (program (select 1) (graph F )) )clear; cleartext in "Number1"; cleartext in "Area"; cleartext in "Pi"; polyline[[0,0,1,1,0],[0,1,1,0,0]]; make f(x) sqrt(1-x^2); Draw the graph of f in blue#Integral)c><"Arial18 HText3 Integral,>^="Arial8 HArea- 9:"Arial18 HText2 Area-N"Arial8 HNumber1/6:"Arial18 HText1 Number/F;"Arial8 Hfunctionx^3F@nI"Arial 8 HNumber;'H area**''od*i'"Small Fonts;w=Begin(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (program (select "Integral") (cleartext)) (fix 5) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) (make F (buildf '(X) {text("function") } ))  2, F, 1, 1, 0, 0, 0, , retval, , 0 ; 0, 0, 0, , X, , 0 ; F(X); TEXT("function") | (program (select 0) (graph F )) (penwidth 2) (make NUMBER {scroll("Number") } ) (make C 0 )  0 , C ; (if {check("Graphics") } THEN (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {Y`F(X) } THEN (program (make C {C+ 1 } ) )) (point (eval {vector[X,Y]})) (program (select "Number1") (print I )) (make A {C/I } )  0 , A ; (program (select "Area") (print A )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) ) ELSE (program (loop (I {1 } ) (WHILE {I`NUMBER } ) (do (program (make X {random()/32767 } ) (make Y {random()/32767 } ) (if {Y`F(X) } THEN (program (make C {C+ 1 } ) (make A {C/I } ) )) (make I {I+ 1 } )  0 , I ; )) (result NIL)) )) (make I NUMBER )  0 , I ; (program (select "Number1") (print I )) (program (select "Area") (print A )) (penwidth 1) (make EXACTAREA 0 )  0 , EXACTAREA ; ((lambda (!x) (set !x !x)) 'X)  3 , X ; (make EXACTAREA {integrate(F(X), 300,vector[0,1]) } )  0 , EXACTAREA ; (program (select "Integral" ) (print EXACTAREA )) )clear; cleartext in "Number1"; cleartext in "Area"; cleartext in "Integral"; precision 5; polyline[[0,0,1,1,0],[0,1,1,0,0]]; make f(x) value text("function"); Draw the graph of f in black; penwidth 2; let number be getscroll("Number"); c:=0; if getcheck("Graphics") then {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if y<=f(x) then {c:=c+1}; Draw point at [x,y]; print i in "Number1"; a:=c/i; print a in "Area"; i:=i+1}} else {do i:=1 while i<=number {x:=random()/32767; y:=random()/32767; if y<=f(x) then {c:=c+1; a:=c/i}; i:=i+1};}; i:=Number; print i in "Number1"; print a in "Area"; penwidth 1; exactarea:=0; make variable x; make exactarea Integrate(f(x), 300,[0,1]); print exactarea in "Integral" HpI<Graphics0tvIFIf(x)f(x)=F@^I"Arial8 H(program (clear) (program (select "Number1") (cleartext)) (program (select "Area") (cleartext)) (program (select "Integral") (cleartext)) (polyline (eval {vector[vector[0,0,1,1,0],vector[0,1,1,0,0]]})) )clear; cleartext in "Number1"; cleartext in "Area"; cleartext in "Integral"; polyline[[0,0,1,1,0],[0,1,1,0,0]]