IDL DEMO The IDL demo is organized around the analysis of the New Jersey Pick-It Lottery Data described in "S, An Interactive Environment for Data Analysis and Graphics" by Richard Becker and John Chambers (Wadsworth, 1984). The New Jersey Pick-It lottery is a numbers game. Each ticket costs 50 cents, and gives the purchaser an opportunity to choose a number between 0 and 999. Half the money bet on any particular day is reserved as the prize; the rest goes to the state government. Each day one number is chosen at random, and all those who selected that number share the prize. The data itself consists of two pieces of information, the winning number and the payoff, for each of 254 drawing between May 1975 and March 1976. It is organized as a 254 x 2 data matrix. Two other similar data sets exist (for the drawing between Nov 1976 and Sept 1977 and between Dec. 1980 and Sept. 1981) for later comparison. The first question to address is whether the lottery is fair (i.e. are the winning number uniformly distributed?). This is investigated by producing a histogram for the winning number. (WIDTH 392 HEIGHT 276 PLOT {(READPLOT)(RIGHTMENU {(READMENU)(ITEMS ((Layout PLOT.SKETCH.CREATE "Create a sketch of the PLOT") (Redraw REDRAWPLOTWINDOW "Redraw plot") (Rescale RESCALEPLOT "Rescale plot axes" (SUBITEMS (X% Axis (RESCALEPLOT (QUOTE X)) "Rescale X axis" (SUBITEMS (Automatic ( RESCALEPLOT (QUOTE X)) "Rescale automatically") (Manual (MANUALRESCALE (QUOTE X)) "Rescale manually")) ) (Y% Axis (RESCALEPLOT (QUOTE Y)) "Rescale Y axis" (SUBITEMS (Automatic (RESCALEPLOT (QUOTE Y)) "Rescale automatically") (Manual (MANUALRESCALE (QUOTE Y)) "Rescale manually"))))) (Extend TOGGLEEXTENDEDAXES "Extend plot axes on/off" (SUBITEMS (X% Axis (TOGGLEEXTENDEDAXES (QUOTE X)) "Extend X axis on/off") (Y% Axis (TOGGLEEXTENDEDAXES (QUOTE Y)) "Extend Y axis on/off"))) (Labels WHICHLABEL "Relabel plot" (SUBITEMS (Title (ASKFORLABEL (QUOTE TOP)) "Title plot") (Left (ASKFORLABEL (QUOTE LEFT)) "Label left of plot") (Bottom (ASKFORLABEL (QUOTE BOTTOM)) "Label bottom of plot") ( Right (ASKFORLABEL (QUOTE RIGHT)) "Label right of plot"))) (Tics TOGGLETICS "Tics on or off" (SUBITEMS (Top (TOGGLETICS (QUOTE TOP)) "Top tics on/off") (Left (TOGGLETICS (QUOTE LEFT)) "Left tics on/off") (Bottom (TOGGLETICS (QUOTE BOTTOM)) "Bottom tics on/off") (Right (TOGGLETICS (QUOTE RIGHT)) "Right tics on/off"))) (Undelete UNDELETEPLOTOBJECT "Undelete last deleted object" (SUBITEMS (Top ( UNDELETEPLOTOBJECT (QUOTE TOP)) "Undelete last deleted object") (Select (UNDELETEPLOTOBJECT (QUOTE SELECT)) "Select object to undelete") (Above (UNDELETEPLOTOBJECT (QUOTE ABOVE)) "Undelete all objects above selected object") (All (UNDELETEPLOTOBJECT (QUOTE ALL)) "Undelete all deleted objects"))) (Fixed% Menu TOGGLEFIXEDMENU "Fix Plot menu") ("Change bins" HISTOGRAM.CHANGEBINS "Change number of bins" (SUBITEMS (Reset (HISTOGRAM.RESET T) "Reset range and bin interval to original value"))) ("Summary" HISTOGRAM.SUMMARY "Attach quantile summary" (SUBITEMS (Long (HISTOGRAM.SUMMARY T) "Long summary") (Short HISTOGRAM.SUMMARY "Short summary"))) ("Display quantiles" HISTOGRAM.DISPLAYQUANTILES "Overlay graph of some quantiles") ("IT _ Batch" HISTOGRAM.GETBATCH "Bind IT to the Batch displayed")) WHENSELECTEDFN PLOT.WHENSELECTEDFN WHENHELDFN DEFAULTMENUHELDFN WHENUNHELDFN CLRPROMPT MENUPOSITION NIL MENUOFFSET NIL MENUFONT NIL TITLE NIL CENTERFLG NIL MENUROWS NIL MENUCOLUMNS NIL ITEMHEIGHT 32767 ITEMWIDTH 32767 MENUBORDERSIZE NIL MENUOUTLINESIZE NIL CHANGEOFFSETFLG NIL)} MIDDLEMENU DEFAULT OTHERMENUS (BINMENU {(READMENU)(ITEMS (("Values" HISTOGRAM.VALUES "Inspect values in bin")) WHENSELECTEDFN PLOT.WHENSELECTEDFN WHENHELDFN DEFAULTMENUHELDFN WHENUNHELDFN CLRPROMPT MENUPOSITION NIL MENUOFFSET NIL MENUFONT NIL TITLE NIL CENTERFLG NIL MENUROWS NIL MENUCOLUMNS NIL ITEMHEIGHT 32767 ITEMWIDTH 32767 MENUBORDERSIZE NIL MENUOUTLINESIZE NIL CHANGEOFFSETFLG NIL)}) LEFTMARGIN {~MARGIN T DEFAULT "Frequency" } TOPMARGIN {~MARGIN NIL DEFAULT "Histogram of Winning numbers" } RIGHTMARGIN {~MARGIN NIL DEFAULT NIL } BOTTOMMARGIN {~MARGIN T DEFAULT "Winning numbers" } PLOTSCALE {~PLOTSCALE {~AXISINTERVAL 0.0 1000.0 } {~AXISINFO NIL HISTOGRAM.TICFN } {~TICINFO 0.0 1000.0 200.0 6 } {~AXISINTERVAL 0.0 17.5 } {~AXISINFO NIL NIL } {~TICINFO 0.0 17.5 2.5 8 } } PLOTOBJECTS ({(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 950.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 14.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "14 Obs. between 950.0 and 1000.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 950.0 HIGHMARK 1000.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 900.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 13.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "13 Obs. between 900.0 and 950.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 900.0 HIGHMARK 950.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 850.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 11.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "11 Obs. between 850.0 and 900.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 850.0 HIGHMARK 900.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 800.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 10.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "10 Obs. between 800.0 and 850.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 800.0 HIGHMARK 850.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 750.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 12.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "12 Obs. between 750.0 and 800.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 750.0 HIGHMARK 800.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 700.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 8.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "8 Obs. between 700.0 and 750.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 700.0 HIGHMARK 750.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 650.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 15.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "15 Obs. between 650.0 and 700.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 650.0 HIGHMARK 700.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 600.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 8.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "8 Obs. between 600.0 and 650.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 600.0 HIGHMARK 650.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 550.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 6.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "6 Obs. between 550.0 and 600.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 550.0 HIGHMARK 600.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 500.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 15.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "15 Obs. between 500.0 and 550.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 500.0 HIGHMARK 550.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 450.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 13.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "13 Obs. between 450.0 and 500.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 450.0 HIGHMARK 500.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 400.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 16.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "16 Obs. between 400.0 and 450.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 400.0 HIGHMARK 450.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 350.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 10.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "10 Obs. between 350.0 and 400.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 350.0 HIGHMARK 400.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 300.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 14.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "14 Obs. between 300.0 and 350.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 300.0 HIGHMARK 350.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 250.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 16.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "16 Obs. between 250.0 and 300.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 250.0 HIGHMARK 300.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 200.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 16.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "16 Obs. between 200.0 and 250.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 200.0 HIGHMARK 250.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 150.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 16.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "16 Obs. between 150.0 and 200.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 150.0 HIGHMARK 200.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 100.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 15.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "15 Obs. between 100.0 and 150.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 100.0 HIGHMARK 150.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 50.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 10.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "10 Obs. between 50.0 and 100.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 50.0 HIGHMARK 100.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 0.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 16.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "16 Obs. between 0.0 and 50.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 0.0 HIGHMARK 50.0 ))} ) PLOTUSERDATA ( N 254 NBINS 24 INTFLG NIL SHADE 4680 BATCH {~IDLARRAY AMOUNT (DRAWING 0) NIL {(ARRAYREAD)(DIMS (254) ELEMENTTYPE SINGLE-FLOAT ELEMENTS (810.0 156.0 140.0 542.0 507.0 972.0 431.0 981.0 865.0 499.0 20.0 123.0 356.0 15.0 11.0 160.0 507.0 779.0 286.0 268.0 698.0 640.0 136.0 854.0 69.0 199.0 413.0 192.0 602.0 987.0 112.0 245.0 174.0 913.0 828.0 539.0 434.0 357.0 178.0 198.0 406.0 79.0 34.0 89.0 257.0 662.0 524.0 809.0 527.0 257.0 8.0 446.0 440.0 781.0 615.0 231.0 580.0 987.0 391.0 267.0 808.0 258.0 479.0 516.0 964.0 742.0 537.0 275.0 112.0 230.0 310.0 335.0 238.0 294.0 854.0 309.0 26.0 960.0 200.0 604.0 841.0 659.0 735.0 105.0 254.0 117.0 751.0 781.0 937.0 20.0 348.0 653.0 410.0 468.0 77.0 921.0 314.0 683.0 0.0 963.0 122.0 18.0 827.0 661.0 918.0 110.0 767.0 761.0 305.0 485.0 8.0 808.0 648.0 508.0 684.0 879.0 67.0 282.0 928.0 733.0 518.0 441.0 661.0 219.0 310.0 771.0 906.0 235.0 396.0 223.0 695.0 499.0 42.0 230.0 623.0 300.0 380.0 646.0 553.0 182.0 158.0 744.0 894.0 689.0 978.0 314.0 337.0 226.0 106.0 299.0 947.0 896.0 863.0 239.0 180.0 764.0 849.0 87.0 975.0 92.0 701.0 402.0 1.0 884.0 750.0 236.0 395.0 999.0 744.0 714.0 253.0 711.0 863.0 496.0 214.0 430.0 107.0 781.0 954.0 941.0 416.0 243.0 480.0 111.0 47.0 691.0 616.0 253.0 477.0 11.0 114.0 133.0 293.0 812.0 197.0 358.0 7.0 996.0 842.0 255.0 374.0 693.0 383.0 99.0 474.0 333.0 467.0 515.0 357.0 694.0 919.0 424.0 274.0 913.0 919.0 245.0 964.0 472.0 935.0 434.0 170.0 300.0 476.0 528.0 403.0 677.0 559.0 187.0 652.0 319.0 582.0 541.0 16.0 981.0 158.0 945.0 72.0 167.0 77.0 185.0 209.0 893.0 346.0 515.0 555.0 858.0 434.0 541.0 411.0 109.0 761.0 767.0 597.0 479.0))} } OBATCH {(ARRAYREAD)(DIMS (254) ELEMENTTYPE T ELEMENTS (98 162 196 110 50 14 189 13 232 101 10 89 76 42 132 184 116 24 236 238 94 41 157 43 159 203 83 148 176 249 105 183 30 68 190 85 100 11 191 22 2 1 140 234 15 237 220 32 38 154 139 239 227 27 194 39 25 78 240 174 123 129 147 69 133 55 127 165 72 153 181 215 31 170 187 84 199 49 44 61 59 19 212 67 117 18 192 73 149 221 135 108 75 124 70 145 96 229 205 71 146 242 90 12 208 37 195 200 136 202 58 166 128 161 224 40 92 248 26 180 211 175 6 219 246 36 52 121 51 206 93 217 204 222 188 253 62 182 109 173 9 131 16 4 113 207 243 63 120 46 48 223 66 35 247 231 3 138 244 226 56 230 252 28 79 54 186 134 21 137 112 228 91 81 103 122 45 225 97 114 143 185 201 209 130 20 160 171 169 119 82 65 141 168 164 86 250 107 155 106 251 125 17 177 53 87 60 111 47 0 193 102 34 80 198 156 74 23 245 172 152 8 115 163 241 142 151 126 213 33 104 214 210 95 118 218 88 179 235 150 178 77 99 64 216 5 158 144 7 233 29 57 197 167))} LETTERVALUES {~LETTERVALUES 254 440.5 127.5 230.0 735.0 64.0 111.5 879.0 32.5 0.0 999.0 } BININTERVAL {~HISTOGRAM.BINS 0.0 1200.0 50.0 24 } MAXFREQ 16 COPYFN COPYHISTOGRAM ) )} ) As you can see the distribution of winning is fairly uniform, which indicates that the lottery is fair. If we were to play would we expect to win on the average? Since each ticket costs 50 cents and there are 1000 numbers, we need an average payoff of 500 dollars to win if we played repeatedly. Again a histogram of the payoffs will help us here. (WIDTH 401 HEIGHT 269 PLOT {(READPLOT)(RIGHTMENU {(READMENU)(ITEMS ((Layout PLOT.SKETCH.CREATE "Create a sketch of the PLOT") (Redraw REDRAWPLOTWINDOW "Redraw plot") (Rescale RESCALEPLOT "Rescale plot axes" (SUBITEMS (X% Axis (RESCALEPLOT (QUOTE X)) "Rescale X axis" (SUBITEMS (Automatic ( RESCALEPLOT (QUOTE X)) "Rescale automatically") (Manual (MANUALRESCALE (QUOTE X)) "Rescale manually")) ) (Y% Axis (RESCALEPLOT (QUOTE Y)) "Rescale Y axis" (SUBITEMS (Automatic (RESCALEPLOT (QUOTE Y)) "Rescale automatically") (Manual (MANUALRESCALE (QUOTE Y)) "Rescale manually"))))) (Extend TOGGLEEXTENDEDAXES "Extend plot axes on/off" (SUBITEMS (X% Axis (TOGGLEEXTENDEDAXES (QUOTE X)) "Extend X axis on/off") (Y% Axis (TOGGLEEXTENDEDAXES (QUOTE Y)) "Extend Y axis on/off"))) (Labels WHICHLABEL "Relabel plot" (SUBITEMS (Title (ASKFORLABEL (QUOTE TOP)) "Title plot") (Left (ASKFORLABEL (QUOTE LEFT)) "Label left of plot") (Bottom (ASKFORLABEL (QUOTE BOTTOM)) "Label bottom of plot") ( Right (ASKFORLABEL (QUOTE RIGHT)) "Label right of plot"))) (Tics TOGGLETICS "Tics on or off" (SUBITEMS (Top (TOGGLETICS (QUOTE TOP)) "Top tics on/off") (Left (TOGGLETICS (QUOTE LEFT)) "Left tics on/off") (Bottom (TOGGLETICS (QUOTE BOTTOM)) "Bottom tics on/off") (Right (TOGGLETICS (QUOTE RIGHT)) "Right tics on/off"))) (Undelete UNDELETEPLOTOBJECT "Undelete last deleted object" (SUBITEMS (Top ( UNDELETEPLOTOBJECT (QUOTE TOP)) "Undelete last deleted object") (Select (UNDELETEPLOTOBJECT (QUOTE SELECT)) "Select object to undelete") (Above (UNDELETEPLOTOBJECT (QUOTE ABOVE)) "Undelete all objects above selected object") (All (UNDELETEPLOTOBJECT (QUOTE ALL)) "Undelete all deleted objects"))) (Fixed% Menu TOGGLEFIXEDMENU "Fix Plot menu") ("Change bins" HISTOGRAM.CHANGEBINS "Change number of bins" (SUBITEMS (Reset (HISTOGRAM.RESET T) "Reset range and bin interval to original value"))) ("Summary" HISTOGRAM.SUMMARY "Attach quantile summary" (SUBITEMS (Long (HISTOGRAM.SUMMARY T) "Long summary") (Short HISTOGRAM.SUMMARY "Short summary"))) ("Display quantiles" HISTOGRAM.DISPLAYQUANTILES "Overlay graph of some quantiles") ("IT _ Batch" HISTOGRAM.GETBATCH "Bind IT to the Batch displayed")) WHENSELECTEDFN PLOT.WHENSELECTEDFN WHENHELDFN DEFAULTMENUHELDFN WHENUNHELDFN CLRPROMPT MENUPOSITION NIL MENUOFFSET NIL MENUFONT NIL TITLE NIL CENTERFLG NIL MENUROWS NIL MENUCOLUMNS NIL ITEMHEIGHT 32767 ITEMWIDTH 32767 MENUBORDERSIZE NIL MENUOUTLINESIZE NIL CHANGEOFFSETFLG NIL)} MIDDLEMENU DEFAULT OTHERMENUS (BINMENU {(READMENU)(ITEMS (("Values" HISTOGRAM.VALUES "Inspect values in bin")) WHENSELECTEDFN PLOT.WHENSELECTEDFN WHENHELDFN DEFAULTMENUHELDFN WHENUNHELDFN CLRPROMPT MENUPOSITION NIL MENUOFFSET NIL MENUFONT NIL TITLE NIL CENTERFLG NIL MENUROWS NIL MENUCOLUMNS NIL ITEMHEIGHT 32767 ITEMWIDTH 32767 MENUBORDERSIZE NIL MENUOUTLINESIZE NIL CHANGEOFFSETFLG NIL)}) LEFTMARGIN {~MARGIN T DEFAULT "Frequency" } TOPMARGIN {~MARGIN NIL DEFAULT "Histogram of Payoffs" } RIGHTMARGIN {~MARGIN NIL DEFAULT NIL } BOTTOMMARGIN {~MARGIN T DEFAULT Payoffs } PLOTSCALE {~PLOTSCALE {~AXISINTERVAL 0.0 900.0 } {~AXISINFO NIL HISTOGRAM.TICFN } {~TICINFO 0.0 900.0 100.0 10 } {~AXISINTERVAL 0.0 45.0 } {~AXISINFO NIL NIL } {~TICINFO 0.0 45.0 15.0 4 } } PLOTOBJECTS ({(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 850.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 1.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "1 Obs. between 850.0 and 900.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 850.0 HIGHMARK 900.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 750.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 1.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "1 Obs. between 750.0 and 800.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 750.0 HIGHMARK 800.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 650.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 1.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "1 Obs. between 650.0 and 700.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 650.0 HIGHMARK 700.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 600.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 2.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "2 Obs. between 600.0 and 650.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 600.0 HIGHMARK 650.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 550.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 4.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "4 Obs. between 550.0 and 600.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 550.0 HIGHMARK 600.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 500.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 11.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "11 Obs. between 500.0 and 550.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 500.0 HIGHMARK 550.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 450.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 10.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "10 Obs. between 450.0 and 500.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 450.0 HIGHMARK 500.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 400.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 11.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "11 Obs. between 400.0 and 450.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 400.0 HIGHMARK 450.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 350.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 30.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "30 Obs. between 350.0 and 400.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 350.0 HIGHMARK 400.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 300.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 32.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "32 Obs. between 300.0 and 350.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 300.0 HIGHMARK 350.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 250.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 40.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "40 Obs. between 250.0 and 300.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 250.0 HIGHMARK 300.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 200.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 44.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "44 Obs. between 200.0 and 250.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 200.0 HIGHMARK 250.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 150.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 36.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "36 Obs. between 150.0 and 200.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 150.0 HIGHMARK 200.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 100.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 29.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "29 Obs. between 100.0 and 150.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 100.0 HIGHMARK 150.0 ))} {(READPLOTOBJECT)( OBJECTSUBTYPE FILLEDRECTANGLE OBJECTDATA ( OBJECTLEFT 50.0 OBJECTBOTTOM 0.0 OBJECTWIDTH 50.0 OBJECTHEIGHT 2.0 BORDERWIDTH 1 TEXTURE 4680 ) OBJECTMENU BINMENU OBJECTLABEL "2 Obs. between 50.0 and 100.0" OBJECTUSERDATA (FROMHISTOGRAM? T LOWMARK 50.0 HIGHMARK 100.0 ))} ) PLOTUSERDATA ( N 254 NBINS 24 INTFLG NIL SHADE 4680 BATCH {~IDLARRAY AMOUNT (DRAWING 0) NIL {(ARRAYREAD)(DIMS (254) ELEMENTTYPE SINGLE-FLOAT ELEMENTS (190.0 120.5 285.5 184.0 384.5 324.5 114.0 506.5 290.0 869.5 668.5 83.0 188.0 449.0 289.5 212.0 466.0 548.5 260.0 300.5 556.5 371.5 112.5 254.5 368.0 510.0 102.0 206.5 261.5 361.0 167.5 187.0 146.5 205.0 348.5 283.5 447.0 102.5 219.0 292.5 343.0 332.5 532.5 445.5 127.0 557.5 203.5 373.5 142.0 230.5 482.5 512.5 330.0 273.0 171.0 178.0 463.5 476.0 290.0 176.0 195.0 159.5 296.0 177.5 406.0 182.0 164.5 137.0 191.0 298.0 110.0 353.0 192.5 308.5 287.0 203.5 377.5 211.5 342.0 259.0 231.0 348.0 159.0 130.5 176.0 128.5 159.0 290.0 335.0 514.0 191.0 304.5 167.0 257.0 640.0 142.0 146.0 356.0 96.0 295.0 237.0 312.5 215.0 442.5 127.0 127.0 756.0 228.5 132.0 256.0 374.5 262.5 286.5 264.0 380.5 357.5 478.5 511.5 218.0 353.0 162.5 184.0 548.0 166.5 147.5 240.0 386.0 130.5 287.5 230.0 480.5 247.5 380.0 238.5 237.5 214.5 394.5 416.5 392.5 244.5 202.0 371.5 553.0 293.5 295.0 178.0 334.5 226.0 194.0 388.5 353.0 404.0 348.0 163.5 216.5 283.0 388.5 567.5 250.5 478.0 267.5 326.5 369.0 512.5 341.0 188.5 386.0 239.0 480.5 105.0 227.0 130.5 384.5 294.5 154.0 324.0 116.0 229.0 301.5 334.0 143.5 212.0 448.0 126.5 417.5 276.5 303.0 211.0 373.0 209.5 207.5 195.0 317.0 170.5 230.0 143.0 361.0 452.0 260.5 308.5 206.0 256.5 291.0 421.5 295.5 119.5 268.5 221.0 151.5 314.5 313.5 323.5 204.0 241.0 637.0 214.0 348.0 191.5 384.0 220.0 285.5 335.0 251.5 131.5 328.0 392.0 509.0 235.5 249.5 129.5 303.0 201.5 365.0 346.5 210.5 334.0 376.5 215.5 312.0 239.5 221.0 388.0 154.5 268.5 127.0 537.5 427.5 272.0 197.0 167.5 292.0 170.0 486.5 262.0))} } OBATCH {(ARRAYREAD)(DIMS (254) ELEMENTTYPE T ELEMENTS (11 98 26 37 169 70 22 6 176 205 1 183 44 105 104 244 85 229 127 171 83 223 108 67 95 48 195 180 96 32 124 208 174 242 82 86 61 120 153 66 123 92 249 30 251 193 54 59 84 63 145 55 65 121 3 31 12 165 0 68 90 217 72 148 60 191 248 231 140 46 75 212 33 200 27 190 189 234 187 77 15 181 215 135 102 237 154 118 38 219 240 207 147 170 107 177 129 194 49 80 227 100 134 133 167 239 125 213 139 131 228 158 222 23 109 201 93 79 18 198 28 253 111 113 160 243 206 247 53 185 155 35 220 2 112 74 128 14 8 87 58 202 250 39 143 173 144 99 204 62 69 19 178 230 186 91 73 199 238 101 210 209 192 211 175 5 161 224 52 41 179 235 146 88 221 164 78 40 233 152 216 81 34 71 119 150 97 115 29 196 232 24 162 21 141 188 47 110 236 76 132 114 218 172 4 166 126 241 149 156 225 138 136 151 64 137 184 203 246 103 43 36 182 13 197 56 16 57 159 116 130 168 50 252 7 226 25 117 51 163 89 42 245 122 17 142 20 45 157 214 94 10 106 9))} LETTERVALUES {~LETTERVALUES 254 270.25 127.5 194.0 365.0 64.0 152.75 448.0 32.5 83.0 869.5 } BININTERVAL {~HISTOGRAM.BINS 0.0 1200.0 50.0 24 } MAXFREQ 44 COPYFN COPYHISTOGRAM ) )} ) The distribution is skew to the right with a few payoffs much greater than $500. We would also like to know what winning numbers were associated with both the big and the small payoffs. This may be investigate with a scatterplot of payoff vs winning number. <> Notice that the outliers all have in common a repeated digit in their winning number. This is readily explained when one discovers that there is a betting option (called a combination bet) in which the player wins if the digits of his chosen number turn up in ANY order (of course he is paid 1/6 th less). However this option demands that no digit be repeated. This is a popular option, hence the prize for a winning number with repeated digits tends to be split among fewer people. Also, winning numbers with leading zeros tend to have high payoffs. O.K., so we are armed and ready to go! Choose a number with repeated digits or one with a leading zero and watch the money roll in. Unfortunately, we are not the only ones who analyze betting records. We have data available for two subsequent time periods. We can compare the overall distribution of payoff for the three time periods via a boxplot display. <> Thus, we find that others have also discovered the secret of maximizing payoff and we are faced with the conclusion that on the average we will not become rich playing the Pick-It lottery. .¤<7<ø<x´h HELVETICA HELVETICA ?1(DEFAULTFONT 1 (GACHA 10) (GACHA 8) (TERMINAL 8)) ÙgL».ó PLIO.GETFNiö)> PLIO.GETFNS²(…â ¾ciPzº