Code for Passive Applet


(setf pop '(2 4 6 8))

(setf h1 (histogram pop))
(send h1 :num-bins 7)
(send h1 :range 0 2 8)
(send h1 :x-axis t nil 4)
(send h1 :title "Population Distribution")
(send h1 :location 1 20)

(setf sample2 (combine (+ 2 pop) (+ 4 pop) (+ 6 pop) (+ 8 pop)))
(setf mean2 (/ sample2 2))
(setf h2 (histogram mean2))
(send h2 :num-bins 7)
(send h2 :x-axis t nil 7)
(send h2 :title "Sample Means, N=2")
(send h2 :location 270 20)

(setf sample3 
      (combine (+ 2 sample2) (+ 4 sample2) (+ 6 sample2) (+ 8 sample2)))
(setf mean3 (/ sample3 3))
(setf h3 (histogram mean3))
(send h3 :num-bins 10)
(send h3 :x-axis t nil 7)
(send h3 :title "Sample Means, N=3")
(send h3 :location 1 170)

(setf sample4 
      (combine (+ 2 sample3) (+ 4 sample3) (+ 6 sample3) (+ 8 sample3)))
(setf mean4 (/ sample4 4))
(setf h4 (histogram mean4))
(send h4 :num-bins 13)
(send h4 :x-axis t nil 7)
(send h4 :title "Sample Means, N=4")
(send h4 :location 270 170)

(setf sample5 
      (combine (+ 2 sample4) (+ 4 sample4) (+ 6 sample4) (+ 8 sample4)))
(setf mean5 (/ sample5 5))
(setf h5 (histogram mean5))
(send h5 :num-bins 16)
(send h5 :x-axis t nil 7)
(send h5 :title "Sample Means, N=5")
(send h5 :location 1 320)

(setf sample6 
      (combine (+ 2 sample5) (+ 4 sample5) (+ 6 sample5) (+ 8 sample5)))
(setf mean6 (/ sample6 6))
(setf h6 (histogram mean6))
(send h6 :num-bins 19)
(send h6 :x-axis t nil 7)
(send h6 :title "Sample Means, N=6")
(send h6 :location 270 320)