**TI89**mainRchisqdisº¥Z`() Prgm ClrIO Disp "1 = left prob","2 = right prob","3 = middle prob" Input t ClrIO Disp "degrees of freedom" Input n If t=3 Then Disp "lower bound" Input j Disp "upper bound" Input k s\Chi2CdfF(j,k,n)b Else Disp "bound" Input k s\Chi2CdfF(0,k,n)b EndIf Disp "graph?" Input z If z=1 Then PlotsOff FnOff If int (n/2)=n/2 Then .5^(n/2)/(n/2-1)!c Else 2^((n-2)/2)*((n-1)/2)!/(n-1)!/¨(Œ)c EndIf Define y1(x)=c*x^(n/2-1)*–^(­x/2) 0xmin max(3*n,k)xmax 3*n/10xscl 0ymin If nž3 Then y1(n-2)ymax Else 2ymax EndIf .1yscl If t=3 Then Shade 0,y1(x),j,k Else If t=1 Then Shade 0,y1(x),0,k Else Shade 0,y1(x),k,xmax EndIf EndIf EndIf ClrIO If t=3 Then Disp "probability =",b Else If t=1 Then Disp "left tail prob =",b Output 32,1,"(right tail)" Output 44,1,1-b Else Disp "right tail prob =",1-b Output 32,1,"(left tail)" Output 44,1,b EndIf EndIf EndPrgmäåÜ3