[thechat] Programming Problem

Luther, Ron Ron.Luther at compaq.com
Fri Nov 9 11:30:30 CST 2001


Hi Rudy,

I dunno ... as a "math" guy ... I think there may be a smaller number of
'cases' it could be broken into based on the number of face cards ... or
on the number of face card and/or aces.

Either way .. I think your gonna end up with a 'hueristic' algorithm ...
an exact solution is gonna be "waaay" painful because of the basic
nature of the problem -- which is looking at matching or solving a prime
factorization by adding numbers together instead of multiplying.


My 2¢? ... if you don't have a hammer handy ... go for the beer!


RonL.

-----Original Message-----
From: rudy [mailto:r937 at interlog.com]
Sent: Thursday, November 08, 2001 8:23 PM
To: Joe Crawford; thechat at lists.evolt.org
Subject: Re: [thechat] Programming Problem


sql?  you'd never get a result set back, it'd be too large   ;o)


here's how i'd do it...

1. obtain hammer
2. ...

;o)


seriously, you're looking at a tremendously large number

the number of distinct combinations of four cards drawn from a playing
card
deck is 52*51*50*49 = 6,497,400

if you disregard suits, there are fewer combos, but i can't be bothered
counting them -- you can't just divide 6,497,400 by 4, because there's
only
one hand with all sevens, but 144 different hands with two sevens and
two
eights....  urggle...

if the number of operators is 4, and they don't have to be distinct,
then
there are 4**3 = 64 ways of combining four cards (i.e. using three infix
operators), but then the possibility of parentheses throws everything
into
a cocked hat

joe, did your php program take parentheses into consideration?

   (3*7)+4-1  <>  3*(7+4)-1  <>  3*(7+4-1)

and what about order?  again, there's some redundancy

  (3*7)+4-1   =  (7*3)+4-1  =  (3*7)-1+4  = (7*3)-1+4

bottom line?  forget the computer program, have a couple beers instead

i bet there's an optimum (that will vary from person to person)
somewhere
between two beers and seventeen where you get really good at winning the
game...

rudy



_______________________________________________
thechat mailing list
thechat at lists.evolt.org
http://lists.evolt.org/mailman/listinfo/thechat
http://lists.evolt.org/thechatarchive/
________________
"You know what happens if you spill Clynelish?"
"No, what?"
"You go directly to hell"




More information about the thechat mailing list