MATLAB: The probability of the sum of three dice

: Pr{Di = 1} , {Di = 2} , {Di = 3} , {Di = 4} , {Di = 5} , {Di = 6}
D1 : 1/6 , 1/6 , 1/6 , 1/6 , 1/6 , 1/6
D2 : 1/12 , 1/12 , 2/12 , 2/12 , 3/12 , 3/12
D3 : 4/12 , 3/12 , 2/12 , 1/12 , 1/12 , 1/12
D = D1 + D2 + D3, when each dice is rolled once.
How Can Find it ?
I need to compute fD = fD1 ∗ fD2 ∗ fD3 with conv function
Think this dice is loaded

Best Answer

So did you actually try to use the conv() function? Like this:
D1 = [1/6 , 1/6 , 1/6 , 1/6 , 1/6 , 1/6 ]
D2 = [1/12 , 1/12 , 2/12 , 2/12 , 3/12 , 3/12]
D3 = [4/12 , 3/12 , 2/12 , 1/12 , 1/12 , 1/12]
d1d2 = conv(D1, D2, 'full')
d = conv(d1d2, D3, 'full')
plot(d, 'b.-', 'LineWidth', 2, 'MarkerSize', 25);
grid on;
xlabel('Sum of all 3 dice sides', 'FontSize', 15);
ylabel('Probability', 'FontSize', 15);
title('Probability of Sums', 'FontSize', 15);