The execution of the command

r = PDF[TransformedDistribution[x*y, {x \[Distributed] UniformDistribution[{0, 1}], 
y \[Distributed] DiscreteUniformDistribution[{0, 1}]}], t]

$$\begin{cases} \frac{1}{2} & 0<t<1 \\ 0 & t>1\lor t<0 \\ \text{Indeterminate} & \text{True} \end{cases} $$

brings an incorrect result in view of

Integrate[r, {t, -Infinity, Infinity}]


whereas I was learned this integral must equal one. This implies the discordance between

CentralMoment[TransformedDistribution[x*y, {x \[Distributed] UniformDistribution[{0, 1}], 
y \[Distributed] DiscreteUniformDistribution[{0, 1}]}], 2]



Integrate[(t - 1/4)^2*r, {t, -Infinity, Infinity}]


In the above

Mean[TransformedDistribution[x*y, {x \[Distributed] UniformDistribution[{0, 1}], 
y\[Distributed] DiscreteUniformDistribution[{0, 1}]}]]


and the the same definitions from Encyclopedia of Mathematics and Wiki are used.

I am sure that the PDF r does not exist because

CDF[TransformedDistribution[x*y, {x \[Distributed] UniformDistribution[{0, 1}], 
y \[Distributed] DiscreteUniformDistribution[{0, 1}]}], t]

$$\begin{cases} \frac{1}{2} & t=0 \\ 1 & t\geq 1 \\ \frac{t+1}{2} & 0<t<1 \end{cases} $$

is not an absolutely continuous function. Am I not right?

  • $\begingroup$ It appears that Mathematica does not always play well when mixing continuous and discrete distributions (which is what you have). Notice that the initial pdf doesn't include the probability mass at zero (i.e., $t=0$ is not included). For example, the documentation for MixtureDistribution explicitly states that the distribution mixtures must be all continuous or all discrete. $\endgroup$
    – JimB
    Nov 10 '21 at 15:14
  • $\begingroup$ @JimB: Thank you for your response. I don't use MixtureDistribution. The documentation to TransformedDistribution does not states that the transformed distributions must be all [absolutely] continuous or all discrete. Also PDF[TransformedDistribution[x*y, {x \[Distributed] UniformDistribution[{0, 1}], y \[Distributed] DiscreteUniformDistribution[{2, 3}]}], t] is OK. $\endgroup$
    – user64494
    Nov 10 '21 at 15:45
  • $\begingroup$ BTW, the notion of PDF for a discrete distribution is not standard, e.g. Encyclopedia of Mathematics and Harald Cramér in Mathematical Methods of Statistics do not use it (Harald Cramér uses the notion "probability distribution".). $\endgroup$
    – user64494
    Nov 10 '21 at 16:17
  • 2
    $\begingroup$ I’m voting to close this question because it's essentially a bug report that should be directed to WRI. Tacking on "Am I right?" at the end doesn't really make it a question suited for Stack Exchange. $\endgroup$
    – chuy
    Nov 10 '21 at 20:00
  • 1
    $\begingroup$ @chuy: Disagree. This is a normal question. Maybe, something is not taken into account by me. Maybe, there is a workaround. $\endgroup$
    – user64494
    Nov 11 '21 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.