Tuesday, July 25, 2006

Doing the "What If?" Shuffle (the sequel)

The investigation continues . . . In my last post I decided to track down the answer to a question about how the shuffling software works over at PokerStars, a site where I play frequently. After one of those very common “what if?” situations (I had folded a hand preflop that would have flopped a straight), I wondered about a comment I had heard on the PokerDiagram podcast regarding online sites and how they “reshuffle” the deck all throughout the hand. I wrote an email to PokerStars and they told me that, in fact, they only run their randomizing program once prior to the hand and thus “set the deck.” This meant that when you decide to fold that four-flusher on the turn and the fifth of your suit comes on the river, you can correctly torment yourself with the woulda-shoulda-couldas. If that’s your cup of tea.

Anyhow, since the fellows on PokerDiagram play on PokerRoom (a site on which I do not play), I decided to send PokerRoom an email asking how their shuffling software works. In his comment on that post, derbywhite said not to “hold your breath waiting for a reply” from PokerRoom -- good advice, as they have yet to respond (over 48 hours later). But I was already wearing my detective hat, so I decided to keep snooping. I thought I’d ask around at other sites to find out what the “norm” was. Doing so would serve a few purposes: (1) I’d find out whether other sites, like PokerStars, only shuffle the deck once prior to the hand or not; (2) I’d learn a bit about how shuffling software works, generally speaking, and how sites defend the integrity of their games; and (3) I’d perform an informal survey of the level of customer support at each site.

I looked on Poker Listings -- a helpful site that gives tons of information about fifty or so poker sites -- and picked out the ten sites that currently have the highest player volume. Those sites (from highest volume on down) are PokerStars, PartyPoker, PokerRoom, Hollywood Poker, Ultimate Bet, Paradise Poker, Doyle’s Room, Poker Share, Full Tilt Poker, and Pacific Poker. (PartyPoker has the highest cash game volume, but PokerStars makes the top of their list because of its frequent high-entry tourneys.) I had already contacted PokerStars and PokerRoom, so I sent a similar message to the other eight sites asking them about whether the cards were reshuffled during the hand or not.

The first to respond was Paradise Poker. Within 15 minutes I was directed to a page on their website with a fairly detailed description of their shuffling software that appears written for programmers. I battled through it, however, and toward the end found my answer. Each time they run the program, they create what they call a “seed” (referring to the shuffled deck). They then update the seed very frequently (again, like PokerStars, incorporating lots of input such as players’ mouse and keyboard movements), including during the hand. As they explain, “The updated seed is used for dealing cards during each card dealing round, and since a hand always lasts longer than it takes to inject 2000 bits of new random data, all subsequent cards will be dealt using a seed which is completely random and which is completely unrelated to the seed used to deal the previous hands of cards.” So Paradise reshuffles throughout the hand. Asking “what if?” is even less meaningful over there, as the cards would not necessarily have come out the same way.

Pacific Poker sent a response shortly afterwards (within 30 minutes), and while they also sent me a somewhat technical explanation of the process, the support person helpfully prefaced that with this handy sentence: “I am enclosing an explanation but in answer to your specific question it is done on every card.” Then came Hollywood Poker's response (within 45 minutes) which begins in uncertainty (“I cannot say for sure how does the random number generator works [sic] in shuffling and dealing . . . ”) but concludes by saying that at “each phase in a single hand, the cards are generated at the moment it is shown on the hand or table and not pregenerated in the deck.” Soon afterwards, Poker Share sent a terse but clear response that “the deck is shuffled after every card, rather than after every round.”

Like poker players, detectives are always looking for patterns. And I was seeing one. Of the first four sites to respond, all four reshuffled the deck throughout the hand. I wondered if I might be approaching an "industry standard" here -- one that PokerStars didn't necessarily follow . . . ?

Full Tilt Poker got back to me within 90 minutes or so with a detailed message defending its software’s integrity (but not really addressing the question). However, FTP did direct me to “a newsgroup link to a simplified explanation by Perry Friedman (one of our pros) of how our random number generator works.” I followed the link which didn’t seem to feature Perry Friedman at all but did include a transcript of a chat session involving Howard Lederer. There Lederer explains that over at FTP “the remaining cards are shuffled during the action.”

In his comment to my earlier post, mattastic had said he thought FTP reshuffles throughout the hand and he was right. Incidentally, Full Tilt has incorporated a new feature in its games that seems doubly useless, given this information. After you have folded, for the rest of the hand you can hold your mouse over your avatar to see what cards you folded, in case you forgot. (There is a thread in which some were discussing this new feature -- and related issues -- over on the Card Clubs Network Forums over the past couple of weeks.) But since they reshuffle the deck during the hand, the only thing that is significant about the cards you folded is that no one else will be receiving them. In other words, the only person who gets this information is the one person for whom it is utterly meaningless!

The only other site that responded to my message was Doyle’s Room. (I never heard from PokerRoom, PartyPoker, or Ultimate Bet.) Within an hour or so Doyle’s Room got back to me with a valiant but ambiguous reply that didn’t really answer the question. They did, however, tell me if had any further questions to contact Gaming Associates, an independent agency that consults with many online gambling sites. I sent them the question, and looking at their response it appears I’ve got the whole team buzzing over there:

Gaming Associates tries to clarify

Of the seven sites that responded, then, six of them reshuffle throughout the hand. And Mr. Pedley here (who probably knows a bit more that you or I do about the subject) says that “generally” speaking that is the way it is done -- online sites don’t usually “set the deck” the way PokerStars does.

Based on this information, I’m guessing that PokerRoom -- as Henry and Zog were saying on the PokerDiagram podcast -- probably does as most of the industry does and reshuffles throughout the hand. There’s probably an advantage, security-wise, in doing so, I would imagine, although I’m not too concerned about the integrity of PokerStars’ games. Nor am I that concerned, really -- despite the length of these last two posts -- about whether I should have played that 58-offsuit when the flop came 746. Hard enough to live in the world as it is without worrying over what it might have been . . . .

Photo: Tom Neal from the 1945 film Detour (adapted), public domain.

Labels: , , , , , , , , , , ,

Sunday, July 23, 2006

Doing the "What If?" Shuffle

What if?Just listened to the latest installment of PokerDiagram, the podcast in which two Londoners play online poker tourneys (SNGs, MTTs) and narrate their adventures as they do. If you haven’t heard it yet, go check it out. The show’s hosts, Henry and Zog, are quick-witted and knowledgeable, and they interact in ways that usually make the show entertaining and even compelling. (See my earlier post for a review of PokerDiagram.)

During this particular show (episode 42, titled “Cheers!”), Zog enters a $20+$2 MTT on PokerRoom (their favorite site). After struggling for a good while, Zog finds himself sitting in 36th place out of 44 remaining players with about 1900 chips, something like a third of the average stack size. The blinds are 100/200 and only the top ten places pay, so he’s feeling a bit of pressure to make a move when he gets dealt T9-suited in the big blind. The Zogster really wants to play the hand, but sees a substantial raise from one player and a call from another before the action gets back to him. The duo hem and haw a bit before Zog finally says “It’s close, but I’m gonna fold this.” No longer in the hand, they watch the flop come T9x and momentarily express disappointment at what appears to have been a missed opportunity.

We’ve all been there. Just today I had a hand in a $0.50/$1.00 limit ring game where I was dealt 5h8c in the small blind and after deciding it wasn’t worth the quarter to complete watched the flop come 7h4h6c. Why didn’t I call!? It was just a quarter! Then I remembered Zog having said something about how “it’s not a preshuffled, prearranged deck” when one plays online. The subject came up again later in the show, and Henry and Zog make it clear that it is their understanding that the cards are randomized at every stage of the hand, not arranged in a particular sequence before the hand and left unchanged (as would be the case in a live game). In other words -- if I’m understanding the pair correctly -- they believe that flop might not necessarily have come T9x if Zog had called.

I wondered if this were in fact the case -- if the sites don’t “set the deck” with each hand but in fact apply their shuffling software to each and every card that comes off. If I'm going to call myself a shamus, I figured some detective work was in order.

I have no account at PokerRoom, so I went over to PokerStars (where I do) and checked out what they say on their website about their shuffling software. How can they guarantee the deal is really random? Well, as they explain it, they ensure “a fair and unpredictable shuffle” by constantly gathering a great deal of “truly random data” that is then used as source material affecting the order in which the cards are dealt for a given hand. In other words, PokerStars randomizes its shuffle by figuring other, independently-produced information into the equation.

Here’s an analogy: Pauline knows her husband, Bruce, likes to have either a ham sandwich or vegetable soup for lunch. She also knows Bruce doesn’t like knowing beforehand what she’s made him for lunch, he so enjoys being surprised each day when he opens his lunchbox. (Bruce is easily amused.) So each morning Pauline makes up both lunches, places them in identical lunchboxes, and watches as Bruce grabs one off the kitchen table as he leaves for work. In order to make sure his choice is “fair and unpredictable,” Pauline checks the weather report in the newspaper to see what the high temperature is forecasted to be that day. If the forecasted high is an odd number of degrees Fahrenheit, she places the lunchbox with the ham sandwich nearest the door. If it is an even number, she places the lunchbox with the soup nearest the door.

The weather report provides Pauline source material with which to help randomize her placement of the lunchboxes, and thus, Bruce's selection. Similarly, PokerStars gathers what it considers “truly random data” to plug into its software in order to produce a random (or “fair and unpredictable”) shuffle. While Pauline only uses one piece of information for this purpose, PokerStars says it gathers 249 “random bits” and enters them all into their shuffling software in order to produce the deal. Pauline gets her one “bit” from the local newspaper; the PokerStars software -- the random number generator that determines what cards are dealt -- gathers its 249 random bits from two primary sources.

One source is the “thermal noise” produced by a resistor -- that is, the genuinely unpredictable fluctuations that occur when voltage is applied to that resistor. These fluctuations are measured and redistributed as some of the “bits” needed by the random number generator. I imagine this must be a machine or computer of some sort rigged up somewhere in Costa Rica (where PokerStars is headquartered) with lots of measuring instruments taking down various data related to the fluctuations and pumping those numbers into its randomization program.

The other source of random bits might surprise you. It’s us. That’s right -- the players. Data is gathered from “a summary of mouse movements and events timing” and used along with the thermal noise data to determine the ultimate order of the cards. So the amount of time you spent deciding whether to check, raise, or fold actually affects the order in which the cards across the site are being randomized. Of course, we’re talking about at any given moment tens of thousands of players’ movements affecting hundreds of thousands of deals, so there’s little hope of precisely tracking the effect of how one person moves his or her mouse and the timing of his or her clicks. But such actions do, most definitely, affect the process of randomization. (Reminds one more than a little of the butterfly effect, from chaos theory.)

All of this information was very diverting, but my question hadn’t really been answered by any of it. Would I have made my straight had I played my crappy 58 on that hand with the 746 flop? I wrote PokerStars support an email asking them whether or not the randomization process is applied multiple times throughout the hand (e.g., before the deal, before the flop, after the flop, after the turn) or if it is only applied once prior to the hand. As usual with PokerStars, they got back to me very quickly (in less than two hours). Here is what they had to say:

PokerStars responds to Shamus's query

I would have made my straight! It didn’t matter whether I hesitated or moved the mouse around the screen before folding -- the order of the cards for that particular hand already had been determined and would not change, regardless of the action. Zog and Henry’s claim about there not being a “preshuffled, prearranged deck” wasn’t the case here . . . ! PokerStars does, in fact, "set the deck" (as what they call a "virtual stub").

I wondered if perhaps PokerRoom does things differently, so even though I don’t have an account with them I sent them a message asking the same question. Half a day later, they've yet to get back to me. If they do, I'll post their response. Meanwhile, I'll just keep on wondering what if . . . .

(Click here to read the follow-up post.)

Photo: Tom Neal from the 1945 film Detour, public domain.

Labels: , , , ,


Older Posts

Copyright © 2006-2021 Hard-Boiled Poker.
All Rights Reserved.