Summary: The systematic formulation in the previous module Minterms shows that each Boolean combination, as a union of minterms, can be designated by a vector of zero-one coefficients. A coefficient one in the ith position (numbering from zero) indicates the inclusion of minterm Mi in the union. We formulate this pattern carefully below and show how MATLAB logical operations may be utilized in problem setup and solution.
Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.
We examine, first, calculations on a pair of simple random variables
First, let us review the one-variable strategy. In this case, data consist of values ti
and corresponding probabilities
To perform calculations on
which has
Basic problem. Determine
We extend these techniques and strategies to a pair of simple random variables, considered jointly.
>> jdemo4 % Call for data in file jdemo4.m
>> jcalc % Call for setup procedure
Enter JOINT PROBABILITIES (as on the plane) P
Enter row matrix of VALUES of X X
Enter row matrix of VALUES of Y Y
Use array operations on matrices X, Y, PX, PY, t, u, and P
>> disp(P) % Optional call for display of P
0.0360 0.0198 0.0297 0.0209 0.0180
0.0372 0.0558 0.0837 0.0589 0.0744
0.0516 0.0774 0.1161 0.0817 0.1032
0.0264 0.0270 0.0405 0.0285 0.0132
>> PX % Optional call for display of PX
PX = 0.1512 0.1800 0.2700 0.1900 0.2088
>> PY % Optional call for display of PY
PY = 0.1356 0.4300 0.3100 0.1244
- - - - - - - - - - % Steps performed by jcalc
>> PX = sum(P) % Calculation of PX as performed by jcalc
PX = 0.1512 0.1800 0.2700 0.1900 0.2088
>> PY = fliplr(sum(P')) % Calculation of PY (note reversal)
PY = 0.1356 0.4300 0.3100 0.1244
>> [t,u] = meshgrid(X,fliplr(Y)); % Formation of t, u matrices (note reversal)
>> disp(t) % Display of calculating matrix t
-3 0 1 3 5 % A row of X-values for each value of Y
-3 0 1 3 5
-3 0 1 3 5
-3 0 1 3 5
>> disp(u) % Display of calculating matrix u
2 2 2 2 2 % A column of Y-values (increasing
1 1 1 1 1 % upward) for each value of X
0 0 0 0 0
-2 -2 -2 -2 -2
>> G = t.^2 - 3*u % Formation of G = [g(t_i,u_j)] matrix
G = 3 -6 -5 3 19
6 -3 -2 6 22
9 0 1 9 25
15 6 7 15 31
>> M = G >= 1 % Positions where G >= 1
M = 1 0 0 1 1
1 0 0 1 1
1 0 1 1 1
1 1 1 1 1
>> pM = M.*P % Selection of probabilities
pM =
0.0360 0 0 0.0209 0.0180
0.0372 0 0 0.0589 0.0744
0.0516 0 0.1161 0.0817 0.1032
0.0264 0.0270 0.0405 0.0285 0.0132
>> PM = total(pM) % Total of selected probabilities
PM = 0.7336 % P(g(X,Y) >= 1)
>> P = 0.1*[3 0 0; 0 6 0; 0 0 1];
>> FXY = flipud(cumsum(flipud(P))) % Cumulative column sums upward
FXY =
0.3000 0.6000 0.1000
0 0.6000 0.1000
0 0 0.1000
>> FXY = cumsum(FXY')' % Cumulative row sums
FXY =
0.3000 0.9000 1.0000
0 0.6000 0.7000
0 0 0.1000
![]() |
>> jddbn
Enter joint probability matrix (as on the plane) P
To view joint distribution function, call for FXY
>> disp(FXY)
0.1512 0.3312 0.6012 0.7912 1.0000
0.1152 0.2754 0.5157 0.6848 0.8756
0.0780 0.1824 0.3390 0.4492 0.5656
0.0264 0.0534 0.0939 0.1224 0.1356
These values may be put on a grid, in the same manner as in Figure 2 for Example 3 in "Random Vectors and Joint Distributions".
[x,y,t,u,px,py,p] = jcalcf(X,Y,P)
The quantities In the single-variable case, the condition that there are no point mass concentrations on the line ensures the existence of a probability density function, useful in probability calculations. A similar situation exists for a joint distribution for two (or more) variables. For any joint mapping to the plane which assigns zero probability to each set with zero area (discrete points, line or curve segments, and countable unions of these) there is a density function.
Definition
If the joint probability distribution for the pair
We have three properties analogous to those for the single-variable case:
At every continuity point for
Now
A similar expression holds for
Marginal densities. Thus, to obtain the marginal density for the first variable, integrate out the second variable in the joint density, and similarly for the marginal for the second variable.
Let
![]() |
The pair
SOLUTION
Examination of the figure shows that we have different limits for the integral with respect
to u for
We may combine these into a single expression in a manner used extensively in subsequent
treatments. Suppose
![]() |
For a pair
As in the one-variable case, if the increments are small enough,
The m-procedure tuappr calls for endpoints of intervals which include the
ranges of X and Y and for the numbers of subintervals on each. It then
prompts for an expression for
Determine
>> tuappr
Enter matrix [a b] of X-range endpoints [0 1]
Enter matrix [c d] of Y-range endpoints [0 1]
Enter number of X approximation points 200
Enter number of Y approximation points 200
Enter expression for joint density 3*(u <= t.^2)
Use array operations on X, Y, PX, PY, t, u, and P
>> M = (t <= 0.8)&(u > 0.1);
>> p = total(M.*P) % Evaluation of the integral with
p = 0.3355 % Maple gives 0.3352455531
The discrete approximation may be used to obtain approximate plots of marginal distribution and density functions.
![]() |
>> tuappr
Enter matrix [a b] of X-range endpoints [-1 1]
Enter matrix [c d] of Y-range endpoints [0 1]
Enter number of X approximation points 400
Enter number of Y approximation points 200
Enter expression for joint density 3*u.*(u<=min(1+t,1-t))
Use array operations on X, Y, PX, PY, t, u, and P
>> fx = PX/dx; % Density for X (see Figure 4)
% Theoretical (3/2)(1 - |t|)^2
>> fy = PY/dy; % Density for Y
>> FX = cumsum(PX); % Distribution function for X (Figure 4)
>> FY = cumsum(PY); % Distribution function for Y
>> plot(X,fx,X,FX) % Plotting details omitted
These approximation techniques useful in dealing with functions of random variables, expectations, and conditional expectation and regression.