All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
All Four Suits (Posted on 2006-06-06) Difficulty: 3 of 5
If you keep drawing cards from a shuffled deck, what is the expected number of draws to complete at least one card from each suit?

The expected value is the average number of draws that it would take if you repeated the experiment many times.

See The Solution Submitted by Charlie    
Rating: 4.2500 (4 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: End... | Comment 5 of 8 |
(In reply to End... by Eric)

Going along with the "brute force throw CPU cycles at it" and using quite a few more Monte Carlo runs (1M), I get 7.6757

*** MATLAB code ****

data = zeros(1,52);
nmax = 1000000;
for i=1:nmax,
deckstate = [13 13 13 13];
j = 0;
while max(deckstate-[12 12 12 12]) > 0,
j = j+1;
r = randperm(sum(deckstate));
cds = cumsum(deckstate);
if r(1) <= cds(1) && deckstate(1) > 0,
suit = 1;
elseif r(1) <= cds(2) && deckstate(2) > 0,
suit = 2;
elseif r(1) <= cds(3) && deckstate(3) > 0,
suit = 3;
else
suit = 4;
end
deckstate(suit) = deckstate(suit)-1;
end
data(j) = data(j)+1;
end
E = 0;
for i=1:52,
E = E+ i*data(i)/nmax;
end

  Posted by Bob Smith on 2006-06-07 08:36:20
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information