MathGroup Archive 2010

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

Search the Archive

Re: DiscreteUniformDistribution PDF isn't piecewise?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107696] Re: DiscreteUniformDistribution PDF isn't piecewise?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Tue, 23 Feb 2010 08:03:50 -0500 (EST)

On 2/22/10 at 3:07 AM, nma at 12000.org (Nasser M. Abbasi) wrote:

>"richard.wesley.todd" <richard.wesley.todd at gmail.com> wrote in
>message news:hlqu3v$go8$1 at smc.vnet.net...
>>A PDF for a discrete uniform distribution, say for a die roll...

>>In[101]:= PDF[DiscreteUniformDistribution[{1, 6}]]

>>Out[101]= 1/6 &

>>... gives 1/6 for all inputs, _not_ just between 1 and 6. 
>>Shouldn't it be defined piecewise?  This is from Mathematica
>>7.0.1.0 on Windows.   The CDF is correct.

>Not sure what you mean as you showed no example of the problem.

I believe what the original poster was doing is something like

In[5]:= f = PDF[DiscreteUniformDistribution[{1, 6}]];
f[10]

Out[6]= 1/6

Which is clearly the wrong result for 10. But, if f is defined as:

In[7]:= Clear[f];
f = PDF[DiscreteUniformDistribution[{1, 6}], #] &;
f[10]

Out[9]= 0

the correct answer is obtained



  • Prev by Date: Re: DiscreteUniformDistribution PDF isn't piecewise?
  • Next by Date: Re: ? about MatrixPlot used with ListPlot
  • Previous by thread: Re: DiscreteUniformDistribution PDF isn't piecewise?
  • Next by thread: Manipulate piecewise functions,