<D <M <Y
Y> M> D>

: Among the stuff that my great-aunt is getting rid of is a thing that came with a piece of software written to help you learn how to beat blackjack. (Blackjack, apparantly, can be consistently beaten; that is, there are strategies that result long-term in you gaining money and the house losing money.) The thing is basically a lookup table which maps the current state of the game to the action you should take. I guess you're supposed to memorize the table and then go to a casino and get kicked out because they can see you're playing according to the system.

It gave me an idea for a genetic programming type program which evolves a winning blackjack strategy by selecting for good lookup tables. The only problem is that some of the entries on the lookup table want you to calculate some function of the game state, a "count", and take one action if the count is positive and another if it's negative. I don't know how to calculate this function of the game state.

I've tried searching the Web but all I get is people wanting to sell me books on how to calculate this function; I don't get any actual explanation of the actual function. Is it such a complicated function? If I knew anything about genetic programming I'd evolve the count function as well as the lookup table, but I don't. Does anyone reading this have one of those books that they bought at some point and can explicate the function to me?

Also, I remember seeing a Python module containing deck-of-cards logic, but I can't find it. Anyone know where it is? Nevermind, I found it: cards.py.


Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.