<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>_asummers</author><text>Cool little trick, if you&amp;#x27;re strictly curious about knowing which hands rank where in relation to which other hands (say in an AI or whatever).&lt;p&gt;While there are C(52, 5) different hands you can have, having 4 diamonds and a heart is the exact same thing as 3 clubs and 2 hearts, etc. so it collapses down to ~2.5k hands.&lt;p&gt;Now the next observation we make is that for most hands, suit doesn&amp;#x27;t matter, but if it does we still need a way to distinguish it, but again, a flush in hearts is the same as a flush in spades in terms of card ranking. The trick we now pull out is the Fundamental Theorem of Arithmetic, which says that for some natural number N, N can be factored into primes in exactly one way, excluding permutations of the factors.&lt;p&gt;We take advantage of this and assign each card a prime number.
2=2 3=3 4=5 ... A=41&lt;p&gt;Now, by multiplying the prime numbers together, we get things like a 2 3 A K Q hand is 2 * 3 * 41 * 39 * 37, and if they are all the same suit, you multiply by 43. You can then take these 2.5k hashes, rank them against each other in a lookup table, and know in constant time for the number of hands how hands rank against each other by just multiplying their card&amp;#x27;s values together with either 1 or 43 if same suit and seeing where it falls in the list.&lt;p&gt;I realize expected value is more widely used as the basis for these types of systems, but I always thought that was a fun trick.</text><parent_chain></parent_chain></comment><story><title>How I Used Professional Poker to Become a Data Scientist</title><url>https://medium.springboard.com/how-i-used-professional-poker-to-become-a-data-scientist-e49b75dfe8e3</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>mad_tortoise</author><text>As someone who has played poker my entire life as well as a programmer, and have drifted passively into playing online poker recently over the real game. I found this fascinating and hadn&amp;#x27;t really considered taking the data science route to playing until I read this article as it&amp;#x27;s more of a hobby. I always have a minimum I&amp;#x27;m willing to walk away losing should I do badly, however this approach has changed my view.&lt;p&gt;Does anyone else on HN have more resources like this, applying data science to poker. I will google, but on forums like this one, I find personally recommended resources to be very helpful.</text><parent_chain></parent_chain></comment><story><title>How I Used Professional Poker to Become a Data Scientist</title><url>https://medium.springboard.com/how-i-used-professional-poker-to-become-a-data-scientist-e49b75dfe8e3</url></story>