% LMex020707_4th.m
% Example 2.7.7 Poker hands p 119-121 in
% Larsen & Marx (2006) Introduction to Mathematical Statistics, 4th edition
% Writtten by Eugene Gallagher, Eugene.Gallagher@umb.edu
% http://alpha.es.umb.edu/faculty/edg/files/edgwebp.html
% Written 1/16/2011 & last revised 1/16/2011
% Probability of different hands
% There are nchoosek(52,5) possible hands.
% Full house. nchoosek(13,1) ways to choose denomination and nchoosek(4,3)
% ways of choosing the suit. There are nchoosek(12,1) ways of choosing a
% pair rom the denominations remaininng (after the denomination of the
% 3-of-a-kind has been selected. There are nchoosek(4,2) ways of choosing
% the suit of the pair.
Pfullhouse=13*nchoosek(4,3)*12*nchoosek(4,2)/nchoosek(52,5)
% one pair
P1pair= 13*nchoosek(4,2)*nchoosek(12,3)*4*4*4/nchoosek(52,5)
% straight; 5 consecutive numbers, but not all in the same suit
Pstraight=(10*4^5-40)/nchoosek(52,5)
% Two pairs, not correct
P2pairs=...
nchoosek(13,2)* nchoosek(4,2) *12*nchoosek(4,2)* nchoosek(11,1)*4/nchoosek(52,5)
P3ofakind=...
13*nchoosek(4,3)*nchoosek(12,2)*4*4/nchoosek(52,5)