{"id":2502,"date":"2009-12-11T15:04:18","date_gmt":"2009-12-11T15:04:18","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2009\/12\/11\/the-finest-poker-brains-on-your-side\/"},"modified":"2016-11-11T05:20:21","modified_gmt":"2016-11-11T10:20:21","slug":"the-finest-poker-brains-on-your-side","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2009\/12\/11\/the-finest-poker-brains-on-your-side\/","title":{"rendered":"The finest poker brains on your side!"},"content":{"rendered":"<div class=\"alert alert-info\"> <span class=\"alert_icon icon-alert-info-reverse\"><\/span><p class=\"alert_heading\"><strong>Note<\/strong><\/p><p>The file submission referenced in this post is no longer available on File Exchange.<\/p><\/div>\r\n<div xmlns:mwsh=\"https:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\r\n   <introduction><\/introduction>\r\n   <p>I'm not a big fan of computer games (my own <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/5499-yahtzee\">Yahtzee<\/a> submission notwithstaning), but <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/31779\">Luigi Giaccari's<\/a> Poker Predictor reminds us that sometimes code can exist just for fun. (Perhaps those of you who actually earn a living playing Texas Hold\r\n      'Em can argue that poker is not \"just for fun,\" but for our purposes here, let's assume that we all play cards just for the\r\n      fun of it.)\r\n   <\/p>\r\n   <p>Luigi's instructions for the installation and use of his tool are located at <a href=\"http:\/\/www.advancedmcode.org\/poker-predictor.html\">advancedmcode.org<\/a>. Poker Predictor is a MATLAB tool to calculate poker game probabilities from any possible card configuration. Probabilities\r\n      are computed with random card permutations; they are not exact, but are, according to Luigi, sure to be within 1% of the true\r\n      values. The program can simulate 100,000 10-player Texas Hold 'Em games in a matters of 0.3 seconds, so it is actually a real\r\n      time tool, very useful for online games--especially with high-level players. And Poker Predictor will allow you to specify\r\n      your own cards, as well as those of your opponents.\r\n   <\/p>\r\n   <p>Installing and setting up Luigi's file takes a bit of extra effort. You'll have to go to advancedmcode.com and download and\r\n      install a fairly large (28+ MB) zip file of hand ranks. After that, it's easy; although his program uses a <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2009b\/techdoc\/ref\/mex.html\">mex interface<\/a> to C++ code, Luigi went so far as to include for you pre-compiled files for Win32!\r\n   <\/p>\r\n   <p>Here's a snapshot of the tool, showing my probability of winning a 10-hand game with pocket aces, before the flop is turned:<\/p>\r\n   <p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/snapshot.png\"> <\/p>\r\n   <p>I have a 31% chance of winning right from the get-go!<\/p>\r\n   <p>Now if you'll excuse me, I'm off to lighten the purses of my poker buddies, armed with some new knowledge...and my MATLAB-based\r\n      odds calculator! :)\r\n   <\/p>\r\n   <p><a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=2502#respond\">Comments?<\/a><\/p><script language=\"JavaScript\">\r\n<!--\r\n\r\n    function grabCode_a54c9a33223d45d69eded8655ce1db51() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='a54c9a33223d45d69eded8655ce1db51 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' a54c9a33223d45d69eded8655ce1db51';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        author = 'Brett Shoelson';\r\n        copyright = 'Copyright 2009 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n      \r\n      d.title = title + ' (MATLAB code)';\r\n      d.close();\r\n      }   \r\n      \r\n-->\r\n<\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_a54c9a33223d45d69eded8655ce1db51()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n            the MATLAB code \r\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.9<br><\/p>\r\n<\/div>\r\n<!--\r\na54c9a33223d45d69eded8655ce1db51 ##### SOURCE BEGIN #####\r\n%% The finest poker brains on your side!\r\n%% \r\n% I'm not a big fan of computer games (my own <http:\/\/www-external-devat.mathworks.com\/matlabcentral\/fileexchange\/5499 Yahtzee>\r\n% submission notwithstaning), but <http:\/\/www-external-devat.mathworks.com\/matlabcentral\/fileexchange\/authors\/31779 Luigi Giaccari's>\r\n% <http:\/\/www-external-devat.mathworks.com\/matlabcentral\/fileexchange\/23966-poker-predictor Poker Predictor> reminds us that sometimes code\r\n% can exist just for fun. (Perhaps those of you who actually earn a living\r\n% playing Texas Hold 'Em can argue that poker is not \"just for fun,\" but\r\n% for our purposes here, let's assume that we all play cards just for the\r\n% fun of it.)\r\n\r\n%%\r\n% Luigi's instructions for the installation and use of his tool are located at <http:\/\/www.advancedmcode.org\/poker-predictor.html advancedmcode.org>.\r\n% Poker Predictor is a MATLAB tool to calculate poker game probabilities\r\n% from any possible card configuration. Probabilities are computed with\r\n% random card permutations; they are not exact, but are, according to\r\n% Luigi, sure to be within 1% of the true values. The program can simulate\r\n% 100,000 10-player Texas Hold 'Em games in a matters of 0.3 seconds, so it\r\n% is actually a real time tool, very useful for online gamesREPLACE_WITH_DASH_DASHespecially\r\n% with high-level players. And Poker Predictor will allow you to specify\r\n% your own cards, as well as those of your opponents. \r\n\r\n%%\r\n% Installing and setting up Luigi's file takes a bit of extra effort.\r\n% You'll have to go to advancedmcode.com and download and install a fairly large (28+ MB) zip file\r\n% of hand ranks. After that, it's easy; although his program uses a <https:\/\/www.mathworks.com\/help\/releases\/R2009b\/techdoc\/ref\/mex.html mex interface>\r\n% to C++ code, Luigi went so far as to include for you pre-compiled files\r\n% for Win32!\r\n\r\n%%\r\n% Here's a snapshot of the tool, showing my probability of winning a\r\n% 10-hand game with pocket aces, before the flop is turned: \r\n\r\n%%\r\n% \r\n% <<snapshot.png>>\r\n% \r\n\r\n%%\r\n% I have a 31% chance of winning right from the get-go!\r\n\r\n%%\r\n% Now if you'll excuse me, I'm off to lighten the purses of my poker buddies, armed\r\n% with some new knowledge...and my MATLAB-based odds calculator! :)\r\n\r\n%%\r\n%\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=2502#respond Comments?>\r\n##### SOURCE END ##### a54c9a33223d45d69eded8655ce1db51\r\n-->","protected":false},"excerpt":{"rendered":"<p> NoteThe file submission referenced in this post is no longer available on File Exchange.\r\n\r\n   \r\n   I'm not a big fan of computer games (my own Yahtzee submission notwithstaning), but Luigi... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2009\/12\/11\/the-finest-poker-brains-on-your-side\/\">read more >><\/a><\/p>","protected":false},"author":34,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2502"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/34"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2502"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2502\/revisions"}],"predecessor-version":[{"id":8029,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2502\/revisions\/8029"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}