[NBLUG/talk] OT: Probability

Andru Luvisi luvisi at andru.sonoma.edu
Mon Jun 9 21:14:00 PDT 2003


On Mon, 9 Jun 2003, Steve Zimmerman wrote:
> What is the probability that 7 cards chosen randomly from
> a deck of 52 cards will yield a five-card flush (i.e., five cards
> of the same suit)?
>
> I'm interested in the mathematics involved more than the
> final answer, so please show the math.  Thanks.

Divide the number of 5 card flushes by the number of 7 card hands.

5 card flushes (I think):
  Counting combinations separately: 4*((13!/(8!*5!))*(39!/(37!*2!)))
  Counting combinations at end:     4*(13!/8!)*(39!/37!)*(7!/(5!*2!)))/7!

7 card hands: 52!/(45!*7!)

Assuming the above is correct (which it may not be) you can work this out
in Linux using bc, the arbitrary precision "basic calculator", which
makes this almost on topic:

  define choose(a, b) {
    auto i, n, d;
    n = d = 1;
    for(i = 0; i <  b; i++) n *= a - i;
    for(i = 1; i <= b; i++) d *= i;
    return (n/d);
  }

  define pick(a, b) {
    auto i, n;
    n = 1;
    for(i = 0; i <  b; i++) n *= a - i;
    return (n);
  }

  define fact(x) {
    auto i, n;
    n = 1;
    for(i=1; i<=x; i++) n *= i;
    return (n);
  }

  scale=20
  (4*choose(13,5)*choose(39,2))/choose(52,7)
  (4*pick(13,5)*pick(39,2)*choose(7,2))/fact(7)/choose(52,7)




More information about the talk mailing list