{"items": [{"author": "Sweet", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128650530142", "anchor": "fb-10100128650530142", "service": "fb", "text": "Picking 4 numbers that add to 9 should be equivalent to arranging 9 balls in 4 boxes, equiv to arranging 3 dividers among 9 balls, equivalent to pickig 3 items out of12 to be dividers. So I am unsure where the error is, be it mine or thine, but I would expect 12 choose 3 = 220 such hands.", "timestamp": "1577242778"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128650530142&reply_comment_id=10100128650759682", "anchor": "fb-10100128650530142_10100128650759682", "service": "fb", "text": "&rarr;&nbsp;Are you including that some of the four numbers are allowed to be zero?", "timestamp": "1577242913"}, {"author": "Sweet", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128650530142&reply_comment_id=10100128650939322", "anchor": "fb-10100128650530142_10100128650939322", "service": "fb", "text": "&rarr;&nbsp;Yes.<br><br>I figured out what went wrong... s does not range over range(0, 10-c-d-h), it  is fully determined by c,d,h. Taking out that for loop for s gives 220 programmatically as well.", "timestamp": "1577243057"}, {"author": "Andrew", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128650734732", "anchor": "fb-10100128650734732", "service": "fb", "text": "I can write up more later, but for the 13-choose-4 proof you're looking for \"stars and bars\".", "timestamp": "1577242883"}, {"author": "Sweet", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592", "anchor": "fb-10100128651303592", "service": "fb", "text": "I think <br>&gt;Then all the other cards need to be \"good\", in that no other player can have a higher card in their suit.<br><br>doesn't quite include all cases since players must follow the lead suit for each trick. Consider<br><br>A<br>A<br>A<br>A K J 9 8 7 6 5 4 3.<br><br>Whenever the opponents play their Q and 10, those could only take tricks on the first two long-suit tricks, but the opponent may merely make sure to play the K and A on those two tricks. Thus this hand is also absolutely winning, even though it's missing two high cards in the great suit. <br><br>I have no idea how to deal with this when trying to count hands.", "timestamp": "1577243430"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128653025142", "anchor": "fb-10100128651303592_10100128653025142", "service": "fb", "text": "&rarr;&nbsp;Ooh, good point!<br><br>In the worst case for a suit, an single opponent has all the cards you don't. So if your suit is length N, you need the top 13-N cards in order, and then any remaining cards in that suit are also good because no one else has that suit. In your example the suit is length 10 so you need the A K Q and seven other cards.<br><br>Your specific example doesn't work because the person with all the points spends all but the first trick leading. Their A takes the 2, their K takes the 10, and then their J loses to the Q.", "timestamp": "1577244093"}, {"author": "Sweet", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128653114962", "anchor": "fb-10100128651303592_10100128653114962", "service": "fb", "text": "&rarr;&nbsp;Jeff Ah nice. I completely forgot that 2s exist clearly.", "timestamp": "1577244147"}, {"author": "Sweet", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128654437312", "anchor": "fb-10100128651303592_10100128654437312", "service": "fb", "text": "&rarr;&nbsp;So to recap what you're saying, for each suit, top 13-N are fixed, then can pick (2N-13) cards from the remaining N cards. I think this code would count that:<br><br>from math import factorial<br><br>def calculate_combinations(n, r):<br>    if (r &lt;= 0) or (r &gt;= n):<br>      return 0<br>    return factorial(n) / factorial(r) / factorial(n-r)<br><br>def arrangementsInSuit(N):<br>  return max(calculate_combinations(N, 2*N-13),1)<br><br>totalArrangements = 0;<br>for c in range(10):<br>  arrangements = arrangementsInSuit(c)<br>  for d in range(10 - c):<br>    arrangements_d = arrangements * arrangementsInSuit(d)<br>    for h in range(10 - c - d):<br>      arrangements_h = arrangements_d * arrangementsInSuit(h)<br>      s=9-c-d-h<br>      arrangements_s = arrangements_h * arrangementsInSuit(s)<br>      print c,d,h,s,arrangements<br>      totalArrangements += arrangements_s<br>print totalArrangements<br><br>ends up giving 1524 hands.", "timestamp": "1577244705"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128704611762", "anchor": "fb-10100128651303592_10100128704611762", "service": "fb", "text": "&rarr;&nbsp;Here's another way to think about it: to get into this situation you need to have the majority of a suit, which is seven cards. Add in the other three aces and your options are:<br><br>* Top seven cards and up to 6-choose-3 other cards<br><br>* Top eight cards and up to 5-choose-2 others<br><br>* Top nine cards and up to 5-choose-1 others<br><br>Except this overcounts, since these categories overlap", "timestamp": "1577274972"}, {"author": "Nix", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128714786372", "anchor": "fb-10100128651303592_10100128714786372", "service": "fb", "text": "&rarr;&nbsp;Confused by two things:<br>* Doesn't the category \"top 7 cards and up to 6-choose-3 others\" include the card combinations counted by the other categories?<br>* Isn't is also possible to have all but one card, and then as long as you have the ace it doesn't matter what you are missing?<br><br>I think to dominate a suit (run everyone out of the suit and ensure you take a trick with every card you have of the suit) you need to have:<br> * the top K cards of the suit<br> * all but K of the cards in the suit<br> * at least half the cards of the suit (so K &lt;= 7)", "timestamp": "1577281951"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128718608712", "anchor": "fb-10100128651303592_10100128718608712", "service": "fb", "text": "&rarr;&nbsp;Nix I think my \"if your suit is length N, you need the top 13-N cards in order, and then any remaining cards in that suit are also good because no one else has that suit\" is right though?", "timestamp": "1577285085"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128651303592&reply_comment_id=10100128728299292", "anchor": "fb-10100128651303592_10100128728299292", "service": "fb", "text": "&rarr;&nbsp;I've updated the post with a revised solution that takes this into account", "timestamp": "1577290973"}, {"author": "Protagoras", "source_link": "https://www.lesswrong.com/posts/kSwsNsbq3QWHKoFma#WhnfQGMPgRwHXCgjW", "anchor": "lw-WhnfQGMPgRwHXCgjW", "service": "lw", "text": "Your requirements are very slightly too strong. If you have more than 6 cards in a suit, the amount of them that have to be top cards is reduced. In your second example, a spade suit of A,K,Q,8,7,6,5,4,3,2 would have served just as well, as even if all the opposing spades were in one hand, playing out the A,K,Q would force them all out, making the remaining spades also winners.", "timestamp": 1577243769}, {"author": "jkaufman", "source_link": "https://www.lesswrong.com/posts/kSwsNsbq3QWHKoFma#qWFmzD3PmChey6BJA", "anchor": "lw-qWFmzD3PmChey6BJA", "service": "lw", "text": "&rarr;&nbsp;Thanks!  Updated the post to fix this.\n", "timestamp": 1577291041}, {"author": "Timothy Johnson", "source_link": "https://www.lesswrong.com/posts/kSwsNsbq3QWHKoFma#hbYFKNhd9DJ2x4Zas", "anchor": "lw-hbYFKNhd9DJ2x4Zas", "service": "lw", "text": "I believe the number of solutions you get should be 12-choose-3 instead of 13-choose-4. After the number of cards in each of the first three suits is chosen, the number of cards in the fourth suit is already determined.<br><br>The usual explanation for this in a standard combinatorics class use the &quot;stars and bars&quot; method: https://en.wikipedia.org/wiki/Stars_and_bars_(combinatorics).", "timestamp": 1577264676}, {"author": "jkaufman", "source_link": "https://www.lesswrong.com/posts/kSwsNsbq3QWHKoFma#mixQBe6KCzuM9SFfx", "anchor": "lw-mixQBe6KCzuM9SFfx", "service": "lw", "text": "&rarr;&nbsp;Thanks! I've updated the post to fix this.\n", "timestamp": 1577291063}, {"author": "Linchuan", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752", "anchor": "fb-10100128774476752", "service": "fb", "text": "In Hearts, the passing mechanic makes \"absolutely dominant\" strategies a lot more common. <br><br>Like I've seen shooting the moon happen pretty regularly, and I suspect a fair percentage of them couldn't have been prevented even with perfect play", "timestamp": "1577311866"}, {"author": "Linchuan", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752&reply_comment_id=10100128777375942", "anchor": "fb-10100128774476752_10100128777375942", "service": "fb", "text": "&rarr;&nbsp;Do you know if you need Aces of every suit in bridge?<br><br>In Hearts, the following is dominant:<br><br>A Clubs<br>A, 2-Q of any other suit. <br><br>Or more succinctly:<br>2-A Clubs", "timestamp": "1577313488"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752&reply_comment_id=10100128791442752", "anchor": "fb-10100128774476752_10100128791442752", "service": "fb", "text": "&rarr;&nbsp;Linchuan you need to take all the tricks, and there's no trump. If your opponent leads an ace on the first trick it will take that trick.", "timestamp": "1577320511"}, {"author": "Linchuan", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752&reply_comment_id=10100128793623382", "anchor": "fb-10100128774476752_10100128793623382", "service": "fb", "text": "&rarr;&nbsp;Jeff&nbsp;Kaufman is there a mandatory start card? In Hearts whoever has the two of clubs starts, and then after you win it you can just lead.", "timestamp": "1577321514"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752&reply_comment_id=10100128795140342", "anchor": "fb-10100128774476752_10100128795140342", "service": "fb", "text": "&rarr;&nbsp;Linchuan the person to the right of the dummy leads any card they want", "timestamp": "1577322324"}, {"author": "Linchuan", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128774476752&reply_comment_id=10100128795564492", "anchor": "fb-10100128774476752_10100128795564492", "service": "fb", "text": "&rarr;&nbsp;Got it, that explains why all your examples had 4 suits!", "timestamp": "1577322420"}, {"author": "Shawn", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128985718422", "anchor": "fb-10100128985718422", "service": "fb", "text": "I think the answer should actually be (12 choose 3): Consider this one-to-one correspondence between winning bridge hands and choices of 3 chosen numbers 1-12: Given the winning bridge hand with (a Clubs, b Diamonds, c Hearts, 13-a-b-c Spades), map this to the triple (a, a + b, a + b + c) which are one of the options for choosing 3 numbers from the range 1-12 (Note 1 &lt;= a &lt; a + b &lt; a + b + c &lt;= 12). Conversely given a triple of numbers chosen from 1-12 (1 &lt;= d &lt; e &lt; f &lt;= 12) we can map that back to a single winning bridge hand (d Clubs, e-d Diamonds, f-e Hearts, 13-f Spades). So this correspondence is one-to-one. Fun problem, thanks :)", "timestamp": "1577432914"}, {"author": "Shawn", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128985718422&reply_comment_id=10100128985798262", "anchor": "fb-10100128985718422_10100128985798262", "service": "fb", "text": "&rarr;&nbsp;A visual way to think about this is that if you arrayed the cards in a consistent suit order, all the ways to get a winning bridge hand are equivalent to all the ways to choose 3 spots between cards where the suit will change. There are 12 such spaces between the 13 cards.", "timestamp": "1577433032"}, {"author": "Jeff&nbsp;Kaufman", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128985718422&reply_comment_id=10100128993507812", "anchor": "fb-10100128985718422_10100128993507812", "service": "fb", "text": "&rarr;&nbsp;I think this is right for how I was originally thinking about the problem, but misses that if you have all but N of a suit you only need to have the top N cards in the suit. After you've played those N tricks no one else will have any cards in the suit and your others will all be good. See the update at the end of the post?", "timestamp": "1577448445"}, {"author": "Shawn", "source_link": "https://www.facebook.com/jefftk/posts/10100128649377452?comment_id=10100128985718422&reply_comment_id=10100130032211242", "anchor": "fb-10100128985718422_10100130032211242", "service": "fb", "text": "&rarr;&nbsp;Jeff, oh, I misunderstood your last update the first time reading through. I agree, that makes it much more mathematically complicated :)", "timestamp": "1577998409"}]}