[Card Shuffles] - A New Kind of Science: The NKS ForumA New Kind of Science: The NKS Forum
Pages:1
Card Shuffles
(Click here to view the original thread with full colors/images)
Posted by: Ray Donald Pratt
I've created an HTML page (viewed on my computer alone) that graphically displays the casino order of a new deck of cards and which then dispays the order of the cards after each perfect shuffle.
I organize the display of each deck as four rows of thirteen squares with the number-value of each card and its suit symbol (from one of four .gif image files) in each square. I also give each square one of four backgound colors depending on the card's suit so that I can make the patterns stand out through each shuffle.
Ah2h3h4h5h6h7h8h9hThJhQhKh
Ab2b3b4b5b6b7b8b9bTbJbQbKb
KdQdJdTd9d8d7d6d5d4d3d2dAd
KSQSJSTS9S8S7S6S5S4S3S2SAS
KdAhQd2hJd3hTd4h9d5h8d6h7d
7h6d8h5d9h4dTh3dJh2dQhAdKh
KSAbQS2bJS3bTS4b9S5b8S6b7S
7b6S8b5S9b4STb3SJb2SQbASKb
KSKdAbAhQSQd2b2hJSJd3b3hTS
Td4b4h9S9d5b5h8S8d6b6h7S7d
7b7h6S6d8b8h5S5d9b9h4S4dTb
Th3S3dJbJh2S2dQbQhASAdKbKh
7bKS7hKd6SAb6dAh8bQS8hQd5S
2b5d2h9bJS9hJd4S3b4d3hTbTS
ThTd3S4b3d4hJb9SJh9d2S5b2d
5hQb8SQh8dAS6bAd6hKb7SKh7d
Th7bTdKS3S7h4bKd3d6S4hAbJb
6d9SAhJh8b9dQS2S8h5bQd2d5S
5h2bQb5d8S2hQh9b8dJSAS9h6b
JdAd4S6h3bKb4d7S3hKhTb7dTS
5hTh2b7bQbTd5dKS8S3S2h7hQh
4b9bKd8d3dJS6SAS4h9hAb6bJb
Jd6dAd9S4SAh6hJh3b8bKb9d4d
QS7S2S3h8hKh5bTbQd7d2dTS5S
Jd5h6dThAd2b9S7b4SQbAhTd6h
5dJhKS3b8S8b3SKb2h9d7h4dQh
QS4b7S9b2SKd3h8d8h3dKhJS5b
6STbASQd4h7d9h2dAbTS6b5SJb
QSJd4b5h7S6d9bTh2SAdKd2b3h
9S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d5d6d7d8d9dTdJdQdKd
KbQbJbTb9b8b7b6b5b4b3b2bAb
KhQhJhTh9h8h7h6h5h4h3h2hAh
Etc.
At 26 shuffles, the cards have come back into numerical and suit orders, but they are reversed from the original orders, so I infer that 52 perfect shuffles of a deck of cards will bring them back to their original orders.
The most interesting thing about the patterns that show up on my HTML page is how much geometric order there is in what would otherwise seem indecipherable when some of the more complex patterns are viewed solely as a consecutive series.
(I tried to post this comment under the thread about 'spatial game theory' because it looks related, but I'm a technology dork, and I ended up with my own thread and this edited comment!)
I'm finding that it's easy enough to figure out the suit and numerical pattern of any one shuffle, but that does not give a method for finding the pattern of any and every shuffle.
The more interesting challenge is to find a method of looking at any short sequence of cards and to then know what will come. The information is there in the suit and numerical pattern, and even a short sequence will define the entire shuffle pattern.
In the psuedo-random to random world of the casino, this could only work fuzzily, but the potential advantage is enormous because it could define the possibilities of a deck and how best to play it much more precisely and much sooner than current methods of card counting in blackjack and other games.
I'm trying to develop a method of automatically creating my HTML code for any number of decks, any type of shuffle, any number of players, and with the effects on the shuffle order when players use Blackjack Basic Strategy. Ultimately, I'll need to develop a universal method for understanding any card pattern.
That's why I'm interested in NKS.
Very Respectfully,
Ray Donald Pratt
Posted by: Ray Donald Pratt
I created a VBA program in Microsoft Word which writes all the HTML code to display each of 52 single, perfect shuffles of a deck of cards as blocks of colored patterns which are reminiscent of cellular automata, as studied in NKS.
After the VBA program generated the text in Word, I copied and pasted the entire Word contents into Notepad (to remove any Word formatting), and I then saved the file with a .html extension to create a web page that can be clicked on and viewed in my Internet Explorer web browser (FireFox works, too).
I am attaching that VBA program here as a text file.
But, I will have to add four separate reply posts to attach the .gif files for displaying the suit symbols (hearts, clubs, diamonds, and spades) for the resulting HTML page.
I will also post a reply that attaches a text-file copy of the HTML page which need only be opened and re-saved with a .html extension instead of a .txt extension so as to immediately create a working web page that can viewed offline by simply clicking on it.
In addition, one of my early test pages conjoins all the shuffled decks into a contiguous block which reveals a lot of interesting patterns, so I will add another reply post that attaches that text file as well. The same instructions above for turning it into a web page also apply.
On a personal note, this was a personal triumph for me because I utterly despise Visual Basic as the most unintuitive garbage I've ever had to learn (I got an 'A' for it in a college class, but I have never before come to hate anything so thoroughly). Visual Basic for Applications, however, has proven to be a vehicle for helping me to understand Objects, Procedures and Methods in context, even though my code stays as much as possible in simple statements.
With what little I know about JavaScript, I believe that my VBA program can be easily transferred into that form and will be able to create my web pages directly.
My next task will be to create a user interface that can choose as many decks as desired and that can also choose actual casino shuffle patterns and then display the results.
I envision a sort of visual interface that lets the user select and drag and drop sections of decks of cards so that a user can create and save macros of any shuffle procedure that he or she sees at the casinos.
The idea is too immature, at present, to worry about secrecy, and I don't mind if someone else -- smarter than I -- gets interested and carries the torch further (and burns down a few houses).
Very Respectfully,
Ray Donald Pratt
Posted by: Ray Donald Pratt
Hearts image file attached.
Posted by: Ray Donald Pratt
Clubs image file attached.
Posted by: Ray Donald Pratt
Diamonds image file attached.
Posted by: Ray Donald Pratt
Spades image file attached.
Posted by: Ray Donald Pratt
The attached file need only be opened and re-saved with a .html extension instead of its current .txt extension, and you will then have a working web page that you can simply click on to see in your web browser.
Please save the HTML page in the same folder with the .gif suit-symbol files above so that the web page can see and pull in the suit symbols as needed.
Posted by: Ray Donald Pratt
The attached text file can be turned into a web page as above.
The attached file is an early test result of my VBA program which created an HTML web page that displays a contiguous block of 52 sequential shuffles of a deck of cards.
The two-dimensional patterns revealed are interesting because they show how much geometric patterning there is among the sequential shuffles of a deck of cards even though it's hard to see that much order when viewing the cards in a linear fashion.
Posted by: Ray Donald Pratt
I just corrected some formatting errors in my original post which displays card patterns, and I'm surprised that I did not see and correct those errors earlier. Each block represents four rows of 13 cards for each shuffled deck, and yet I found several single rows printed out alone instead of with the block of cards to which they belong. I eliminated the extra 'enter-key' mistakes, and I apologize for not catching it sooner. It's almost ridiculous that I did not see them sooner in a post about seeing visual patterns!
Anywhichway, since my last posts, I've extended my program to two decks and found that when you perfectly shuffle two decks as if it were one superdeck, it will come back into its original order every 12th shuffle.
One deck comes back into the starting card order after 52 perfect shufffles, but two decks come back into the original starting order after 12 perfect shuffles. This is extremely counter-intuitive.
Of course, in an actual casino, neither one nor two decks are subjected to only simple, perfect, interleaving shuffles of the top and bottom halves of the deck(s) of cards ("riffle" shuffles), but I found it terribly surprising that perfectly shuffling two decks of cards would bring them back into their original order more than four times faster than one deck of cards. I double-checked this by using pastel colors for the begining top deck and pure bright colors for the beginning bottom deck, and my resulting HTML page does indeed show that the cards come back in their original order every 12th shuffle.
My plans for extending my program have taken a turn recently after an insight I had about how to quantify texture. Mr. Wolfram points out in his NKS book that two or more patterns with the exact same number of light and dark elements can nonetheless have markedly different patterns -- or as stated otherwise, they can have markedly different textures. The game of 21 is no different, for you can have different decks of cards where the count balance of high and low cards can be the same, but the resulting play of the cards can be markedly different. A higher than average count of low cards played out at any given time leaves the deck temporarily rich in ten-valued cards, which allegedly creates an advantage for the player over the house, but the ugly truth is that the player can lose so often even with a high count that the player's overall advantage from count-adjusted playing and betting is only about 1%, even under the best of game rules.
If the player would consider not just the balance of high versus low cards, but also the texture of how those cards play out in sequence, then the player could begin to identify the differences in texture between winning and losing decks.
The bugaboo for me has been how to capture that texture as a number or formula that can be manipulated mathematically. You cannot average texture and keep its information, for as soon as you average it, you have equal results across all decks of cards. And yet, as human beings, pattern and texture are self-evident truths that we incorporate in our creations of art. So, why can we not capture pattern or texture as a formula?
My recent insight was to break down pattern recognition into some meaningful steps. For a blackjack player who truly studies the game, each card value has meaning as to its effects on the probable outcome of the hands being played. (The broad division of high and low cards reflects this recognition of the different effects that these cards have on the game.) With such an understanding of each card in mind, further noting the texture, or pattern, in the sequence of the cards as they come out is primarily, at its most fundamental level, a noting of one value relative to another -- the difference between them -- and also noting any identifiable groupings and any differences from other groupings.
This insight has to bear in mind that each card in the game will only be 'groupable' or recognizable as a type based on how you perceive and judge that card as a value. For example, there is nothing earth-shatteringly different about a four or a five or even a seven taken simply as numbers -- they are all a big so-what that can and should be averaged (smile!). However, when it's your money on the table, you may want to care more about how different groupings of numbers, patterns and textures, affect the game.
Specifically, if I am in an incompletely random game of blackjack, and I see a pattern of fives coupled with sevens, I am going to happier about that game than one where I see a pattern of fives coupled with fours. The reason is fairly obvious when you get ready to double down with your total of eight against a dealer's up-card of five. With one scenario, you have a good chance that the dealer will turn up a total of 12 which can be busted with a 10-valued card, but with the other scenario, you have a horrible chance that the dealer will turn up a total of 9 and turn it into a 19 with a 10-valued card, and cause you to lose money or tie, even if you get your best possible single card on your double down.
I am not sure that I can create a formula that can represents a pattern or texture of card sequences and groupings through time, but I am sure that the computer could model it and count the results.
Today Blackjack, tomorrow Keno! Onward Christian soldiers!
Very Respectfully,
Ray Donald Pratt
Posted by: Jason Wesley Ellis
Hi Ray Donald Pratt,
I think it would be interesting if you were to model shuffles somewhat the same way Wolfram modelled powers of three on pg. 119. you could represent "low" cards with white and "high" with black...according to the simple high/low card counting method. each line would give the count. You could even run a program that would play out the deck according to basic strategy and then reshuffle, continuing the automata.
jason
Posted by: Jason Wesley Ellis
My last post was written hastily on a public access computer...sorry. This shuffling/blackjack problem is interesting, and I think there are many ways that you could model the game. I would like to see, as in my last post, 4, 6, & 8 deck shoes played through a hand at a time. Each line would represent a hand. It would be interesting to see the differences in pattern between 1 to through 7 gamblers. I believe that a definite stucture would emerge in this game over many shuffles. The texture that you spoke of is something that I myself have experienced. It would be good if someone were to model blackjack as played by basic strategy and blackjack as played by an experienced card counter---there is an ostensive difference between the two...
Considering shuffles, no dealer has a perfect riffle shuffle every time, and shoes are broken down and shuffled differently in different casinos. Any modeling of shuffling would benefit from a range of riffling, eg. from perfect riffle to, say, a dealer who tends to riffle well at the start of the shuffle, but who doesn't finish what he starts. Variations of shuffling could fill a fairly large book.
Also, it would be good to model the "wash" stage in a shuffle-- when a table is opened. I have seen cards washed in many different ways.
Posted by: Ray Donald Pratt
Greetings Mr. Ellis:
This is what I now know:
1. Busy times of day at the casino create the worst possible random conditions for the 21 player. The reason is that during busy times, many players enter and leave the games very frequently and alter the number of players and playing styles quite chaotically, which can shuffle the cards into unpredictable patterns. This will all but remove predictable cycles of the types of cards that come out. When that is the case, the odds against you will work their magic because the random short-term conditions will mirror the long-term odds. Yes, you can have short little winning streaks and exploitable patterns, but you will get ground out by the odds if you keep playing under those conditions.
2. The surest sign of a poor table is one where long concatenations of small cards occur. It is not an absolute sign, but it is a danger sign. The reasons are:
(a) It creates a joker for the dealer to draw from since the dealer will only draw as much from the string of small cards as the dealer needs to make a hand; and,
(b) It does not give the player an equal chance to draw from a joker because nothing is perfect and the player has to risk busting first; and,
(c) The long strings of small cards will often come in cycles where players stand on their stiffs versus the dealers small up-cards, and then the dealer alone draws from the string of available small cards to make a hand while the players stand with losing hands; and,
(d) The long strings of small cards will naturally leave combinations of high cards that lose some of their value by being more possible, especially if the pairs of high cards come in alternate cycles that the dealer is just as likely to receive as the player.
I was considering this evening the question of how long concatenations of small cards become endemic at busy tables during the busy times of day. After all, what happened to the chaotic randomness caused by players entering and leaving the tables willy nilly? How do these long strings of small cards come to be if there has been an adequate wash and shuffle at the beginning?
Poor players who don't hit their stiffs against the dealer's up-cards of 7 through Ace create a shuffle of high-low stiffs as the dealer picks up all the cards on the table. Since there are 2.25 non-ten-valued cards for every ten-valued card, the effect adds up. In effect, poor players increasingly leave small cards clumped together by not pulling them into combinations consisting of two or more small cards with a ten-valued card to make a hand (or even a bust hand).
I would be interested in proving this visually.
Anywhichway, I like your idea of graphically showing the results of hands drawn. I was too focused on shuffle patterns. I was merely going to count the wins and losses without looking at the visual patterns of the wins and losses.
Thank you and Respectfully,
Ray Donald Pratt
Posted by: Ray Donald Pratt
I have come to an already-stated understanding above of how the worst possible pattern of cards comes to be in the game of 21.
The worst possible pattern is a truly random pattern, for then the short-term pattern reflects the long-term odds against the player.
A truly random pattern occurs when the conditions that affect the overall pattern, the player and dealer choices that affect how the cards are played out and brought back together, become unpredictable, as when poor players make nonstandard plays and do so inconsistently from hand to hand, and where players drift in and out of games and create an unpredictable number of players at any given time and thus unpredictably change the pattern of how the cards are played out and brought back together, etc.
Conversely, a steady table of good players can slowly create order, even over of an initially unpredictable pattern of cards. (Even so, the order that emerges can nonetheless be unfavorable to the players.)
Thus, the window of opportunity for beating the game is not during the wild weekend hours of Las Vegas, but rather in the slower hours among better players.
I became pristinely conscious of patterns in this regard, and I know both that I can beat the game and how to beat the game, but I ultimately found that my last and worst obstacle is me.
Until I acquire the self mastery and self understanding that it takes to control my emotional reactions to losses -- until I learn to follow my own rules for success in the game -- I have to quit gambling.
I will study the game further, and I will enjoy doing so, but until I learn how to control myself, all knowledge of the game is useless.
Very Respectfully,
Ray Donald Pratt
Posted by: Jason Wesley Ellis
Hi Mr. Pratt,
I was wondering if you have considered the game of baccarat in an NKS type format.
I have heard that the game of blackjack was actually derived from baccarat, so perhaps insights gained in blackjack would be beneficial in playing baccarat. (A game where one doesn't suffer from the poor play of other players at the table.) Also, in baccarat a more accurate count may be established, especially towards the end of a shoe, as typically only one to thirteen cards (I think) are burned after a shuffle. In blackjack, more often then not, at least a deck ((and sometimes much more then a deck)) are never seen in play. I have read before that there are no true baccarat counting methods, or that there are only methods that lend only slight advantages rather rarely. It's almost like this-consider a computer program that graphs the total wins/losses for successive tosses of a coin,,,you either win one unit or lose a unit. This graph will not be simple, that is, it won't be like up one then down one then up one and so on. It would be more random. It would maybe look alot like the middle column of rule 30 if say, for example, black was win and white was lose. The line of this graph would fluctuate, maybe arbitrarily as high or low as one could want if extended to infinity. Perhaps there is a deeper way to penetrate these fluctuations using NKS.
jason
Posted by: ChiefWiggum
Hi Ray
I fear that Card based games may be phased out in Casinos within 10 years, due to developments in "Augmented Reality".
"Kaleidoscope", a film starring Warren Beatty and Susannah York, when combined with "Augmented Reality" gives new meaning to "the house edge".
Good Luck with your work.
Forum Sponsored by Wolfram Research
© 2004-2008 Wolfram Research, Inc. | Powered by vBulletin 2.3.0 © 2000-2002 Jelsoft Enterprises, Ltd. |
Disclaimer
vB Easy Archive Final - Created by Xenon and modified/released by SkuZZy from the Job Openings