\begin{Schunk}
\begin{Sinput}
 drawBinom <- function (S, p){
    x<- seq(0,200)
    xprob <- dnbinom(x,size=S,prob=p)
    mytitle <- paste("x",S,p)
    plot(x, xprob,type="s",main=mytitle,xlab=paste("number of failures before ",S,"successes"))
  }
 par(mfcol=c(3,2))
 sizes <- c(20,40,60)
 pvals <- c(0.33,0.67)
 for (i in 1:2){
     for (j in 1:3){
       drawBinom (sizes[j], pvals[i] )
    }
  }
\end{Sinput}
\end{Schunk}
