Cepheus learned poker by playing over a billion billion hands – more than have been played in the entirety of human history 
 
 It may not win every hand it is dealt, but over time, no one can beat Cepheus, a computer program that scientists claim plays a near-perfect game of poker. 
 
 Unveiled in Canada on Thursday, the researchers believe that Cepheus is so good that a seasoned poker star could spend their whole life playing against it and still not come out on top. 
 
 To learn the game, Cepheus spent two months playing the equivalent of more than a billion billion hands of Texas hold’em, which is more poker games than have been played in the entirety of human history. 
 
 The feat required the number-crunching power of four thousand computer processors, each handling six billion hands every second. With each game Cepheus played, the program built up a database of cards dealt, betting decisions and outcomes. At the end of the marathon training session, the database contained 11 terabytes of information on calls, raises and folds for every hand a player could have. 
 
 Cepheus learns from an algorithm that essentially minimises its regrets: the program reviews every decision made and then learns which moves paid off and which cost it the hand. “For every single possible situation you could get into, it has a description for how you should play,” said Neil Burch, a computer scientist who helped develop Cepheus at the University of Alberta Computer Poker Research Group. 
 
 The program plays a variant of poker called heads-up limit hold’em, made famous by Michael Craig’s 2005 book, The Professor, the Banker and the Suicide King. The game involves two players who bet fixed amounts with a limit on the number of raises allowed. 
 
 “Cepheus starts off with a strategy that’s quite terrible,” said Burch. “But every time it plays a hand it comes up with a better strategy.” 
 
 It is impossible to make a program that wins every hand, because an opponent can always be dealt a pair of aces or another lucky hand. Instead, Cepheus plays the hand it is dealt in the best way possible. Before every decision, it checks its cards against the database and uses probability to play the best possible game, whether that means calling, raising or folding its hand. 
 
 “Cepheus loses to no one over a long enough time. You just have to play enough hands so that luck goes away,” said Burch. 
 
 The scientists describe how they created Cepheus in the latest issue of the journal Science. The program can be played online at the University of Alberta’s website. 
 
 “I’m sure we’ll get plenty of emails from people who will play 20 or 30 hands against it, win a little bit, and then happily declare victory and say Cepheus must have a bug. But while a human or another program could get lucky and beat Cepheus in a short match, nobody could do it consistently over a long match,” said Michael Johanson, a researcher at the lab. 
 
 The program marks a milestone in artificial intelligence and game theory because it makes optimal decisions in a game where only limited information is available: a player’s own cards and those face up on the table (the flop, turn and river, in poker terminology). 
 
 Until now, all of the major games that have been “solved” by computers are “perfect-information games” such as chess and checkers where the full history of the game is known to each player. 
 
 Poker and other card games are known as imperfect-information games and are much harder for computers to master because each player has only a limited amount of information on which to base their decisions. 
 
 The parallels between poker and real-life decision-making mean that card-playing programs are far more than toys. John von Neumann, the father of modern computing, was inspired by bluffing in poker to develop game theory. Versions of game-playing programs can be used to find the most effective ways to patrol coastlines for drugs traffickers, or the best way to schedule sky marshals on commercial flights. 
 
 The Canadian researchers said they have been careful not to release information about Cepheus that could be used to win fortunes on online casinos. But other computer experts could potentially recreate the program and unleash it on the web. Even if that happened, Burch is not convinced it would make a fortune from hapless online human players. “It’s like being a really good poker player. If you start beating people all the time, nobody will want to play with you,” he said. 

 I played 400 hands against Cepheus, a poker-playing computer program developed by scientists at the University of Alberta, and I must admit that I am yet to be fully convinced by the scientists’ claims of its infallibility. People have been trying to create online poker ‘bots’ for many years now, though they are illegal on real money websites and security teams are constantly monitoring for suspicious accounts. The last thing both the sites and regular players want are successful bots scaring the more recreational types who are happy to hand over their cash. So claims by computer scientists in a highly respected scientific journal to have created a near perfect player will make the poker world take notice. 
 
 The choice of heads-up limit hold’em for Cepheus makes obvious sense: just two players and fixed betting amounts to keep things as simple as possible for the computer. However, one of the bot’s limitations appears to be that it did not seem to adapt against my change of style, something that could be its undoing. The most important thing in any heads-up battle is finding out your opponent’s flaws (known as leaks) and relentlessly exploiting them until they change their style to compensate. It’s the smartest and quickest way to win and means less reliance on the luck and the cards. If your opponent is too passive then you should raise and bluff more; if they’re too aggressive then become more passive with your made hand and let your opponent bluff into you. 
 
 At first, I was roundly stuffed by the computer’s non-stop aggression. Any bluffs I made failed miserably. To counteract this, I became more aggressive preflop and stopped bluffing almost entirely. Cepheus’s game did not adapt to my play and it made what I would consider several questionable plays. The program was reluctant to ever give up any sort of hand in a large pot making it easier to get lots of value from moderately weak hands. 
 
 I just squeezed out ahead over the 400 hands but the sample is still too small to come to any real conclusion about Cepheus’s claim to be an unbeatable poker program. Perhaps the best way to show off Cepheus would be to issue a challenge over a fixed amount of hands to a world-class professional player like Daniel Negreanu or Phil Ivey. This could create poker’s own version of Deep Blue v Garry Kasparov and would certainly be interesting for poker junkies like myself. I’d probably still take man over machine, though. 

 Image copyright Getty Images 
 
 Scientists have created a computer program they say is the perfect poker player and never makes a mistake. 
 
 The developers told Science journal they had "solved" the two-player game Fixed-limit Heads-up Texas Hold 'em. 
 
 And the algorithm had a strategy so close to optimal "it can't be beaten with statistical significance within a lifetime of human poker playing". 
 
 The poker-ace algorithm is also now available online for people to test, query and even play against. 
 
 'Perfect information' 
 
 Since scientists first started to develop game-playing artificial intelligence, there have been a series of famous cases where computer algorithms developed strategies better than the very best human players. 
 
 In 1997, for example, IBM supercomputer Deep Blue defeated world chess champion Garry Kasparov. 
 
 But these machine victories have been in what are termed "perfect-information games" - where all players are informed about everything that has occurred in the game before making a decision. 
 
 This is not the case in poker, where players do not know which cards have been dealt to other players. 
 
 This new poker-playing program has taught itself to overcome this. It has played trillions of hands of poker and been designed to learn by "regretting" and remembering every decision that does not lead to the optimum outcome. 
 
 Fixed-limit heads-up Texas hold 'em 
 
 The two players are each dealt two cards only they can see 
 
 On the basis of these alone, the first player can choose to bet a set amount against the other or "fold" awarding the game to their opponent 
 
 The second player can then choose to match the bet, double it or fold 
 
 If the bet is doubled, the first player then has the option to match it or fold 
 
 Three further cards are laid face up on the table by the dealer 
 
 The two players bet against each other for a second time based on poker hands they could potentially complete by combining their two concealed cards with the three on the table 
 
 Another card is laid face up on the table by the dealer 
 
 The two players bet against each other for a third time - but now the set amount is doubled 
 
 A fifth and final card is laid face up on the table by the dealer 
 
 The two players bet against each other for a fourth and final time - with the set amount remaining the same as in the previous round 
 
 "Our model has spent two months playing poker again and again," said lead researcher Michael Bowling from the University of Alberta. 
 
 "It's playing 24 trillion hands of poker every second for two months. 
 
 "That's more poker hands than all of humanity - so in some sense it's not surprising that it has developed the perfect strategy." 
 
 While this might seem a playful project, the use of game theory on which the research is based could have serious implications, including for security. 
 
 Automated systems for airport checkpoints, for example, could be designed to incorporate this type of uncertainty and missing information. 
 
 In this instance, though, when Dr Bowling was asked whether he thinks purist, professional poker players might be irritated by the breakthrough, he said: "I have no idea. We'll have to see how much hate email I'll be getting come Thursday afternoon." 
 
 Follow Victoria on Twitter 

 I'll see your program and raise you mine 
 
 One of the fundamental differences between playing chess and two-handed poker is that the chessboard and the pieces on it are visible throughout the entire game, but an opponent's cards in poker are private. This informational deficit increases the complexity and the uncertainty in calculating the best course of action—to raise, to fold, or to call. Bowling et al. now report that they have developed a computer program that can do just that for the heads-up variant of poker known as Limit Texas Hold 'em (see the Perspective by Sandholm). 
 
 Science, this issue p. 145; see also p. 122
– The world's greatest poker players have a formidable new foe. Scientists have developed a computer program they say plays an effectively perfect game of Fixed-limit Heads-up Texas Hold 'em, the BBC reports. The Cepheus system "can't be beaten with statistical significance within a lifetime of human poker playing," developers say. The game won't necessarily win every hand, the Guardian reports, but it should beat humans in the long run. It developed its abilities after "playing 24 trillion hands of poker every second for two months," says a researcher. The program reportedly learns from its mistakes, experiencing what might be called electronic "regret" over moves that don't work out perfectly. If you're skeptical, you can try playing against it right here. Its favored version of poker starts with players receiving two cards the other player can't see, and that's key to the significance of Cepheus. Computers have previously developed winning strategies for games like chess, but in those games, each player has all the information about what's happened so far—they're called "perfect information games." Prior to Cepheus, "no nontrivial imperfect-information game played competitively by humans" had been "solved," researchers write in Science. At the Guardian, poker writer Christopher Hall has some doubts: "One of the bot’s limitations appears to be that it did not seem to adapt against my change of style, something that could be its undoing. The most important thing in any heads-up battle is finding out your opponent’s flaws ... and relentlessly exploiting them until they change their style to compensate," he writes. He came out slightly ahead of Cepheus after 400 hands, though that's too small a sample size to draw a clear conclusion, he notes.