       Re: DiscreteUniformDistribution PDF isn't piecewise?

• To: mathgroup at smc.vnet.net
• Subject: [mg107652] Re: DiscreteUniformDistribution PDF isn't piecewise?
• From: "Nasser M. Abbasi" <nma at 12000.org>
• Date: Mon, 22 Feb 2010 03:07:17 -0500 (EST)
• References: <hlqu3v\$go8\$1@smc.vnet.net>

```"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:= PDF[DiscreteUniformDistribution[{1, 6}]]
>
> Out= 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:= RandomInteger[DiscreteUniformDistribution[{1,6}]]
Out= 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

```

• Prev by Date: Re: Manipulate piecewise functions,
• Next by Date: Re: Manipulate piecewise functions,
• Previous by thread: DiscreteUniformDistribution PDF isn't piecewise?
• Next by thread: Re: Re: DiscreteUniformDistribution PDF isn't piecewise?