MathGroup Archive 2010

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

Search the Archive

Re: Re: DiscreteUniformDistribution PDF isn't piecewise?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107683] Re: [mg107652] Re: DiscreteUniformDistribution PDF isn't piecewise?
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Mon, 22 Feb 2010 19:05:04 -0500 (EST)
  • References: <hlqu3v$go8$1@smc.vnet.net> <201002220807.DAA28826@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

A more correct pdf for the example is

Function[x, If[MemberQ[Range[1, 6], x], 1/6, 0]]

An even better answer (if I'm not getting things backward) might be

pdf2[x_] = Sum[DiracDelta[x - n], {n, 1, 6}]

Bobby

On Mon, 22 Feb 2010 02:07:17 -0600, Nasser M. Abbasi <nma at 12000.org> 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.
>
> This dist means the probability of drawing an integer between 1 and 6 by
> random from it is 1/6.
>
> Any random integer drawn this this pdf will have the same chance as any
> other. There is 1/6 chance of getting 1 or 2 or 3 or 4 or 5 or 6. That is
> why it is called uniform?  You can't get a random number from it which is
> not one of those. This is how you defined it. It can only return back  
> one of
> these 6 integers.
>
> Not sure how you called it, this is how I call it:
>
> In[13]:= RandomInteger[DiscreteUniformDistribution[{1,6}]]
> Out[13]= 4
>
> May be there was a problem in how you called it? it will help if you  
> show an
> example of the problem you had. most likely it was a programming error?
>
> fyi. I have a demo at WRI which allows one to try all the discrete
> distributions
>
> http://demonstrations.wolfram.com/Mathematica7sDiscreteDistributions/
>
> --Nasser
>
>
>
>


-- 
DrMajorBob at yahoo.com


  • Prev by Date: Re: Digitizing plots with Mathematica (i.e. extracting data points
  • Next by Date: Re: Loops in Manipulate
  • Previous by thread: Re: DiscreteUniformDistribution PDF isn't piecewise?
  • Next by thread: Re: DiscreteUniformDistribution PDF isn't piecewise?