Joint PMF​
​
A stock market trader buys 100 shares of stock A and 200 shares of stock B. Let X and Y be the price changes of A and B respectively over a certain time period and assume that the joint PMF of X and Y is uniform over the set of integers x and y satisfying
​
-2≤ x ≤4 and -1 ≤ y-x ≤ 1
​
a. Find the marginal PMF and the means of X and Y
b. Find the mean of the Trader's profit.

Method Employed

Probability[x+y==n,{x,y}ProductDistribution[DiscreteUniformDistribution[{-2,4}],DiscreteUniformDistribution[{-3,5}]]]
Out[]=
1
63
n-5||n9
2
63
n-4||n8
1
21
n-3||n7
4
63
n-2||n6
5
63
n-1||n5
2
21
n0||n4
1
9
n1||n2||n3
0
True
Probability[x+y==n,{x,y}ProductDistribution[DiscreteUniformDistribution[{-2,4}],DiscreteUniformDistribution[{-3,5}]]];​​DiscretePlot[%,{n,-5,9},ExtentSize1/3]
Out[]=
-4
-2
0
2
4
6
8
0.02
0.04
0.06
0.08
0.10

Examples referred to in Wolfram Documentation

Two six-sided dice are thrown independently of each other. Find the density of the sum:
Probability[x+y==n,{x,y}ProductDistribution[{DiscreteUniformDistribution[{1,6}],2}]]
Out[]=
1
36
n2||n12
1
18
n3||n11
1
12
n4||n10
1
9
n5||n9
5
36
n6||n8
1
6
n7
0
True
The waiting times for buying tickets and for buying popcorn at a movie theater are independent and they both follow the exponential distribution. The average waiting time for buying a ticket is 10 minutes and the average waiting time for buying popcorn is 5 minutes. Find the probability that a moviegoer waits for a total of less than 25 minutes before taking his or her seat:
​
=ProductDistribution[ExponentialDistribution[1/Quantity[10,"Minutes"]],ExponentialDistribution[1/Quantity[5,"Minutes"]]]
Out[]=
QuantityDistributionProductDistributionExponentialDistribution
1
10
,ExponentialDistribution
1
5
,
min

NProbability[x+y<Quantity[25,"Minutes"],{x,y}]
Out[]=
0.842568