**TI89**mainRnegbinomi¥Z() Prgm ClrIO Disp "probability" Input p Disp "number of occurrences" Input r Disp "lower bound" Input j Disp "upper bound" Input k sum(seq(nCr(m-1,r-1)*p^r*(1-p)^(m-r),m,j,k))c Disp "complete distribution?" Input z If z=1 Then 2*int(r/p)l NewData dist,seq(i,i,r,l),seq(round(nCr(m-1,r-1)*p^r*(1-p)^(m-r)),m,r,l) NewData dist,dist[1],dist[2],cumSum(dist[2]) EndIf ClrIO Output 1,1,"prob" Output 1,50,round(c) Output 16,1,"mean" Output 16,50,round(r/p) Output 31,1,"st.dev" Output 31,50,round(¨(r*(1-p))/p) EndPrgm äåÜÅ¥