# Expectation problem using empirical distribution

I am having trouble with this Mathematica command:

 Probability[ x + y + z > 14, {x, y, z} \[Distributed]
ProductDistribution[{DiscreteUniformDistribution[{1, 6}], 3}]]


outputs 5 / 54. What I would like to do is use the EmpiricalDistribution sort of like this:

 Probability[x + y + z > 14, {x, y, z} \[Distributed]
ProductDistribution[{EmpiricalDistribution[{1, 2, 3, 4, 5, 6}], 3}]]


of course, that does not work and just spits out the command. How can I get the Empirical Distribution to work like that?

• Does this do what you want? Probability[ x + y + z > 14, {x, y, z} \[Distributed] EmpiricalDistribution[{1, 2, 3, 4, 5, 6}] // Thread] – Rojo Jan 15 '14 at 18:38
• Hi Rojo; Yes, that seems to work fine. Thanks. – bobbym Jan 15 '14 at 18:41

This is a possibility

Probability[
x + y + z > 14,
{x, y, z} \[Distributed]
EmpiricalDistribution[{1, 2, 3, 4, 5, 6}] // Thread
]

• that's very interesting. I don't understand what the Thread is doing. Threading the EmpiricalDistribution gives: {DataDistribution["Empirical", {1/6, 1/6, 1/6, 1/6, 1/6, 1/6}, 1, 6], DataDistribution["Empirical", {1, 2, 3, 4, 5, 6}, 1, 6], DataDistribution["Empirical", False, 1, 6]}. Only the middle one of these seems to make sense. – bill s Jan 15 '14 at 20:22
• @bills, the EmpiricalDistribution by itself evaluates to the DataDistribution. Here I am not threading the EmpiricalDistribution but the whole Distributed[{x,y,z},Emp...] (check the precedences). So, just like f[{a, b, c}, 2] // Thread gives {f[a, 2], f[b,2], f[c,2]}, this is equivalent to {Distributed[x, Emp[...]], Distributed[y, Emp[...]], Distributed[z, Emp[...]]} – Rojo Jan 15 '14 at 20:37
• I get it now! This is saying that x, y, and z are each distributed like the EmpiricalDistribution. The Thread` is over the two lines of code, not just over the third line. Thanks for clarifying! – bill s Jan 15 '14 at 21:45
• @bills no problem :) – Rojo Jan 15 '14 at 21:46
• @ bill s; Thanks for asking what I was thinking too. – bobbym Jan 16 '14 at 9:44