function [] = chap_3_prob_28() % % Written by: % -- % John L. Weatherwax 2006-08-28 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- format rat % Part (a): % % for p(F): % % the first 19 cards are not aces: firstPart = prod( 48 : -1 : ( 48-19+1 ) ); % the 20th card is an ace: midPart = 4; % the remaining cards can be anything: lastPart = factorial( 52-20 ); num = firstPart * midPart * lastPart ; den = factorial( 52 ); pF = num/den; disp(pF) % for P(EF): % % the first 19 cards are not aces: firstPart = prod( 48 : -1 : ( 48-19+1 ) ); % the 20th card is an ace (but not the ace of spades): midPart = 3; % the 21st card is the ace of spades: midPart2 = 1; % the remaining cards can be anything: lastPart = factorial( 52-21 ); num = firstPart * midPart * midPart2 * lastPart ; den = factorial( 52 ); pEF = num/den; disp(pEF) % the probability we want: % pEF/pF % Part (b): % % P(EF) is now some what different: % % the first 19 cards are not one of the four aces or the two of clubs firstPart = prod( 47 : -1 : ( 47-19+1 ) ); % the 20th card is any ace: midPart = 4; % the 21st card is the two of clubs: midPart2 = 1; % the remaining cards can be anything: lastPart = factorial( 52-21 ); num = firstPart * midPart * midPart2 * lastPart ; den = factorial( 52 ); pEF = num/den; disp(pEF) % using this the probability we want is given by % pEF/pF % the second method: % pA1CA2C = prod( 30:48 ) / prod( 34:52 ) pF = pA1CA2C * ( 4 / 33 ) pEF = (1/32) * (3/33) * pA1CA2C