# Adding two random variables (probability distributions)

Let's consider two balanced dice. I am modelling each of them using

d1 = ProbabilityDistribution[1/6, {x, 1, 6, 1}]
d2 = ProbabilityDistribution[1/6, {x, 1, 6, 1}]


Call $x$ the result of the first dice and $y$ the result of the second dice after they are thrown, let $z=2x+y$. How can I make a probability distribution corresponding to $z$ using $d_1$ and $d_2$ ? I tried adding them

d3=2*d1+d2


but this didn't work.

• I think you want TransformedDistribution. – Eric Brown Nov 26 '15 at 18:57

tf = TransformedDistribution[

• Just as a tiny comment: it would be better to first evaluate: ee = PDF[tf, x], and then DiscretePlot[ee {x, 2, 12}] . By contrast, DiscretePlot[PDF[tf, x], {x, 2, 12}] might take about 100 times longer to plot, because it tells Mma to calculate PDF[t,x] at each value of x (rather than just solving it once). – wolfies Nov 28 '15 at 17:37