<< Chapter < Page | Chapter >> Page > |
Two cards are selected at random, without replacement, from a standard deck. Let X be the number of aces and Y be the number of spades. Under the usual assumptions, determine the joint distribution and the marginals.
Let X be the number of aces and Y be the number of spades. Define the events , A i , S i , and N i , , of drawing ace of spades, other ace, spade (other than the ace), and neither on the i selection. Let .
% type
npr08_01 % file
npr08_01.m % Solution for
[link] X = 0:2;
Y = 0:2;Pn = [132 24 0; 864 144 6; 1260 216 6];P = Pn/(52*51);
disp('Data in Pn, P, X, Y')npr08_01 % Call for mfileData in Pn, P, X, Y % Result
PX = sum(P)PX = 0.8507 0.1448 0.0045
PY = fliplr(sum(P'))PY = 0.5588 0.3824 0.0588
Two positions for campus jobs are open. Two sophomores, three juniors, and three seniors apply. It is decided to select two at random (each possible pairequally likely). Let X be the number of sophomores and Y be the number of juniors who are selected. Determine the joint distribution for the pair and from this determine the marginals for each.
Let be the events of selecting a sophomore, junior, or senior, respectively, on the i th trial. Let X be the number of sophomores and Y be the number of juniors selected.
Set
% file
npr08_02.m % Solution for
[link] X = 0:2;
Y = 0:2;Pn = [6 0 0; 18 12 0; 6 12 2];P = Pn/56;
disp('Data are in X, Y,Pn, P')
npr08_02 Data are in X, Y,Pn, P
PX = sum(P)PX = 0.5357 0.4286 0.0357
PY = fliplr(sum(P'))PY = 0.3571 0.5357 0.1071
A die is rolled. Let X be the number that turns up. A coin is flipped X times. Let Y be the number of heads that turn up. Determine the joint distribution for the pair . Assume for and for each k , has the binomial distribution. Arrange the joint matrix as on the plane, with values of Y increasing upward. Determine the marginal distribution for Y . (For a MATLAB based way to determine the joint distribution see Example 7 from "Conditional Expectation, Regression")
.
% file
npr08_03.m % Solution for
[link] X = 1:6;
Y = 0:6;P0 = zeros(6,7); % Initialize
for i = 1:6 % Calculate rows of Y probabilitiesP0(i,1:i+1) = (1/6)*ibinom(i,1/2,0:i);
endP = rot90(P0); % Rotate to orient as on the plane
PY = fliplr(sum(P')); % Reverse to put in normal orderdisp('Answers are in X, Y, P, PY')
npr08_03 % Call for solution m-file
Answers are in X, Y, P, PYdisp(P)
0 0 0 0 0 0.00260 0 0 0 0.0052 0.0156
0 0 0 0.0104 0.0260 0.03910 0 0.0208 0.0417 0.0521 0.0521
0 0.0417 0.0625 0.0625 0.0521 0.03910.0833 0.0833 0.0625 0.0417 0.0260 0.0156
0.0833 0.0417 0.0208 0.0104 0.0052 0.0026disp(PY)
0.1641 0.3125 0.2578 0.1667 0.0755 0.0208 0.0026
Notification Switch
Would you like to follow the 'Applied probability' conversation and receive update notifications?