% LMex020621_4th.m
% Example 2.6.21 p 109 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/15/2011 & last revised 1/16/2011
% Mitch wants to tell 4 jokes at the start of his act and he needs 120
% different combinations of jokes. How many different jokes are needed so
% that he will have at least 120 different opening monologues?
% an application of a while loop and combination function
i=4;joke=0;
display('Table 2.6.3')
display('     n   jokes')
while joke<=120
    joke=nchoosek(i,4);
    disp([i joke]);
    i=i+1;
end