MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Binomial Distribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71393] Re: [mg71356] Binomial Distribution
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 16 Nov 2006 00:54:06 -0500 (EST)
  • Reply-to: hanlonr at cox.net

Needs["Statistics`"]

X=BinomialDistribution[10,6/10];

F[x_]:=CDF[X,x];

To have an effect, Rationalize must have a Real argument that is "close" to a rational number. Rationalize[x, 0] fill force a Rational from any Real

Rationalize[Pi,0]

Pi

Rationalize[Pi//N,0]

245850922/78256779

Note that F[x] is not Real for a Real argument

F[x]

BetaRegularized[2/5, 10 - Floor[x], Floor[x] + 1]

F[4.]

BetaRegularized[2/5, 6, 5]

Consequently, you must use N

Rationalize[N[F[4]],0]

75692233/455322801


Bob Hanlon

---- Bruce Colletti <vze269bv at verizon.net> wrote: 
> Re Mathematica 5.2 under WinXP.
> 
> Why doesn't the code below return a rational number?  
> 
> X = BinomialDistribution[10, 6/10];
> F[x_] := CDF[X, x];
> Rationalize@F@4
> 
> Thankx.
> 
> Bruce
> 


  • Prev by Date: Re: Assumptions for Trigonometry Inequalities
  • Next by Date: RE: Function defined with If
  • Previous by thread: Re: Binomial Distribution
  • Next by thread: Function defined with If