<< Chapter < Page Chapter >> Page >
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.

M-procedures for a pair of simple random variables

We examine, first, calculations on a pair of simple random variables X , Y , considered jointly. These are, in effect, two components of a random vector W = ( X , Y ) , which maps from the basic space Ω to the plane. The induced distribution is on the ( t , u ) -plane. Values on the horizontal axis ( t -axis) correspond to values of the first coordinate random variable X and values on the vertical axis ( u -axis) correspond to values of Y . We extend the computational strategy used for a single random variable.

First, let us review the one-variable strategy. In this case, data consist of values t i and corresponding probabilities P ( X = t i ) arranged in matrices

X = [ t 1 , t 2 , , t n ] and P X = [ P ( X = t 1 ) , P ( X = t 2 ) , , P ( X = t n ) ]

To perform calculations on Z = g ( X ) , we we use array operations on X to form a matrix

G = [ g ( t 1 ) g ( t 2 ) g ( t n ) ]

which has g ( t i ) in a position corresponding to P ( X = t i ) in matrix P X .

Basic problem . Determine P ( g ( X ) M ) , where M is some prescribed set of values.

  • Use relational operations to determine the positions for which g ( t i ) M . These will be in a zero-one matrix N , with ones in the desired positions.
  • Select the P ( X = t i ) in the corresponding positions and sum. This is accomplished by one of the MATLAB operations to determine the inner product of N and P X

We extend these techniques and strategies to a pair of simple random variables, considered jointly.

  1. The data for a pair { X , Y } of random variables are the values of X and Y , which we may put in row matrices
    X = [ t 1 t 2 t n ] and Y = [ u 1 u 2 u m ]
    and the joint probabilities P ( X = t i , Y = u j ) in a matrix P . We usually represent the distribution graphically by putting probability mass P ( X = t i , Y = u j ) at the point ( t i , u j ) on the plane. This joint probability may is represented by the matrix P with elements arranged corresponding to the mass points on the plane. Thus
    P has element P ( X = t i , Y = u j ) at the ( t i , u j ) position
  2. To perform calculations, we form computational matrices t and u such that — t has element t i at each ( t i , u j ) position (i.e., at each point on the i th column from the left) — u has element u j at each ( t i , u j ) position (i.e., at each point on the j th row from the bottom) MATLAB array and logical operations on t , u , P perform the specified operations on t i , u j , and P ( X = t i , Y = u j ) at each ( t i , u j ) position, in a manner analogous to the operations in the single-variable case.
  3. Formation of the t and u matrices is achieved by a basic setup m-procedure called jcalc . The data for this procedure are in three matrices: X = [ t 1 , t 2 , , t n ] is the set of values for random variable X Y = [ u 1 , u 2 , , u m ] is the set of values for random variable Y , and P = [ p i j ] , where p i j = P ( X = t i , Y = u j ) . We arrange the joint probabilities as on the plane, with X -values increasing to the right and Y -values increasing upward. This is different from the usual arrangement in a matrix, in which values of the second variable increase downward. The m-procedure takes care of thisinversion. The m-procedure forms the matrices t and u , utilizing the MATLAB function meshgrid , and computes the marginal distributions for X and Y . In the following example, we display the various steps utilized in the setup procedure.Ordinarily, these intermediate steps would not be displayed.

    Setup and basic calculations

    >>jdemo4 % Call for data in file jdemo4.m>>jcalc % Call for setup procedure Enter JOINT PROBABILITIES (as on the plane) PEnter row matrix of VALUES of X X Enter row matrix of VALUES of Y YUse 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.01800.0372 0.0558 0.0837 0.0589 0.0744 0.0516 0.0774 0.1161 0.0817 0.10320.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 (increasing1 1 1 1 1 % upward) for each value of X 0 0 0 0 0-2 -2 -2 -2 -2 Suppose we wish to determine the probability P ( X 2 - 3 Y 1 ) . Using array operations on t and u , we obtain the matrix G = [ g ( t i , u j ) ] . >>G = t.^2 - 3*u % Formation of G = [g(t_i,u_j)] matrixG = 3 -6 -5 3 19 6 -3 -2 6 229 0 1 9 25 15 6 7 15 31>>M = G>= 1 % Positions where G>= 1 M = 1 0 0 1 11 0 0 1 1 1 0 1 1 11 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.07440.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)

    Got questions? Get instant answers now!
  4. In Example 3 from "Random Vectors and Joint Distributions" we note that the joint distribution function F X Y is constant over any grid cell, including the left-hand and lower boundaries, at the value taken on at the lower left-hand corner of the cell. These lower left-handcorner values may be obtained systematically from the joint probability matrix P by a two step operation.
    • Take cumulative sums upward of the columns of P .
    • Take cumulative sums of the rows of the resultant matrix.
    This can be done with the MATLAB function cumsum, which takes column cumulative sums downward. By flipping the matrix and transposing, we can achieve the desiredresults.

    Calculation of F X Y Values for Example 3 From "random vectors and joint distributions"

    >>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.10000 0 0.1000>>FXY = cumsum(FXY')' % Cumulative row sums FXY =0.3000 0.9000 1.0000 0 0.6000 0.70000 0 0.1000
    Got questions? Get instant answers now!
    A graph creating a 2x2 grid with three points indicated by black dots. the upper most of these dots is present on the y axis and is labeled 3/10 the next highest point is in the center of the grid and is labeled 6/10 and finally the lowest point is on the far bottom right of the grid on the x-axis and is labeled 1/10. A graph creating a 2x2 grid with three points indicated by black dots. the upper most of these dots is present on the y axis and is labeled 3/10 the next highest point is in the center of the grid and is labeled 6/10 and finally the lowest point is on the far bottom right of the grid on the x-axis and is labeled 1/10.
    The joint distribution for Example 3 in "Random Vectors and Joint Distributions'.
    Comparison with Example 3 from "Random Vectors and Joint Distributions" shows agreement with values obtained by hand.
    The two step procedure has been incorprated into an m-procedure jddbn . As an example, return to the distribution in Example [link]

    Joint distribution function for [link]

    >>jddbn Enter joint probability matrix (as on the plane) PTo view joint distribution function, call for FXY>>disp(FXY) 0.1512 0.3312 0.6012 0.7912 1.00000.1152 0.2754 0.5157 0.6848 0.8756 0.0780 0.1824 0.3390 0.4492 0.56560.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".

    Got questions? Get instant answers now!
  5. As in the case of canonic for a single random variable, it is often useful to have a function version of the procedure jcalc to provide the freedom to name theoutputs conveniently. function [x,y,t,u,px,py,p] = jcalcf(X,Y,P) The quantities x , y , t , u , p x , p y , and p may be given any desired names.

Questions & Answers

A golfer on a fairway is 70 m away from the green, which sits below the level of the fairway by 20 m. If the golfer hits the ball at an angle of 40° with an initial speed of 20 m/s, how close to the green does she come?
Aislinn Reply
cm
tijani
what is titration
John Reply
what is physics
Siyaka Reply
A mouse of mass 200 g falls 100 m down a vertical mine shaft and lands at the bottom with a speed of 8.0 m/s. During its fall, how much work is done on the mouse by air resistance
Jude Reply
Can you compute that for me. Ty
Jude
what is the dimension formula of energy?
David Reply
what is viscosity?
David
what is inorganic
emma Reply
what is chemistry
Youesf Reply
what is inorganic
emma
Chemistry is a branch of science that deals with the study of matter,it composition,it structure and the changes it undergoes
Adjei
please, I'm a physics student and I need help in physics
Adjanou
chemistry could also be understood like the sexual attraction/repulsion of the male and female elements. the reaction varies depending on the energy differences of each given gender. + masculine -female.
Pedro
A ball is thrown straight up.it passes a 2.0m high window 7.50 m off the ground on it path up and takes 1.30 s to go past the window.what was the ball initial velocity
Krampah Reply
2. A sled plus passenger with total mass 50 kg is pulled 20 m across the snow (0.20) at constant velocity by a force directed 25° above the horizontal. Calculate (a) the work of the applied force, (b) the work of friction, and (c) the total work.
Sahid Reply
you have been hired as an espert witness in a court case involving an automobile accident. the accident involved car A of mass 1500kg which crashed into stationary car B of mass 1100kg. the driver of car A applied his brakes 15 m before he skidded and crashed into car B. after the collision, car A s
Samuel Reply
can someone explain to me, an ignorant high school student, why the trend of the graph doesn't follow the fact that the higher frequency a sound wave is, the more power it is, hence, making me think the phons output would follow this general trend?
Joseph Reply
Nevermind i just realied that the graph is the phons output for a person with normal hearing and not just the phons output of the sound waves power, I should read the entire thing next time
Joseph
Follow up question, does anyone know where I can find a graph that accuretly depicts the actual relative "power" output of sound over its frequency instead of just humans hearing
Joseph
"Generation of electrical energy from sound energy | IEEE Conference Publication | IEEE Xplore" ***ieeexplore.ieee.org/document/7150687?reload=true
Ryan
what's motion
Maurice Reply
what are the types of wave
Maurice
answer
Magreth
progressive wave
Magreth
hello friend how are you
Muhammad Reply
fine, how about you?
Mohammed
hi
Mujahid
A string is 3.00 m long with a mass of 5.00 g. The string is held taut with a tension of 500.00 N applied to the string. A pulse is sent down the string. How long does it take the pulse to travel the 3.00 m of the string?
yasuo Reply
Who can show me the full solution in this problem?
Reofrir Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask