[R] expand.grid game

Rolf Turner r.turner at auckland.ac.nz
Tue Jan 12 21:52:55 CET 2010


On 13/01/2010, at 9:19 AM, Greg Snow wrote:

> How trivial is probably subjective, I don't think it is much above  
> trivial.  I would not have been surprised to see this question on  
> an exam in my undergraduate (300 or junior level) probability  
> course (the hard part was remembering the details from that class  
> from over 20 years ago).  My favorite test question of all time  
> came from that course: "You have a deck of poker cards with the 3's  
> removed (and jokers), you deal yourself 5 cards at random, what is  
> the probability of getting a straight (not including straight  
> flushes)?"
>
> This problem is simpler.  Just think of the 8 places in the number  
> as urns, and the 17 1's as balls to be put into the urns.  One ball  
> has to go in the first urn, so you have 16 left, there are choose(16 
> +8-1,8-1) ways to distribute 16 undistinguishable balls among 8  
> distinguishable urns. But that includes some solutions with more  
> than 9 balls in an urn which violates the digits restriction, so  
> subtract off the illegal counts.  If we place 10 balls in the first  
> urn, then we have 7 remaining balls to distribute between the 8  
> urns or choose( 7+8-1, 7), If we place 1 ball in the first urn and  
> 10 balls in one of the 7 other urns (7*), then there are choose( 6 
> +8-1, 7 ) ways to distribute the remaining 6 balls in the 8 urns.   
> Not too complicated once you remember (or look up) the formula for  
> urns and balls.

Sorry to be a thicko --- but doesn't the foregoing solution *leave  
in* the possibility
of putting all 17 balls in the first urn?  Or 3 balls in the first  
urn, 12 in the second,
and the remaining 2 in any of the other six urns?  Etc.  I.e. don't  
more terms have to
be subtracted?

	cheers,

		Rolf Turner

######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}



More information about the R-help mailing list