Needs["Statistics`DiscreteDistributions`"]

(*  binomial_cdf_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the binomial CDF *)
(*    at selected argument values fx(a,p,x), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  02 December 2005 *)
(*  Author:  John Burkardt *)

nvec={2,2,2,2,2,4,4,4,4,10,10,10,10,10,10,10,10}
pvec = {5/100, 5/100, 5/100,5/10,5/10,1/4,1/4,1/4,1/4,5/100,10/100,15/100,20/100,25/100,30/100,40/100,50/100 }
xvec={0,1,2,0,1,0,1,2,3,4,4,4,4,4,4,4,4}
fvec = {}
num = Length[xvec]

Do[{ 
n = nvec[[i]], 
p = pvec[[i]], 
x= xvec[[i]],
dist = BinomialDistribution[n,p], f = N[CDF[dist,x],16],
fvec = Append[fvec,f],
Print["BinomialCDF[",n,",",p,"](",x,")=",f]
}, {i, 1, num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/binomial_cdf_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  binomial_cdf_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  n  p  x  fx"];
Write[fileout,"#"];
Do[{n=nvec[[i]],p=pvec[[i]],x=xvec[[i]];f=fvec[[i]];Write[fileout,N[n,16],"  ",N[p,16],"  ",N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];