pescetom Posted November 29, 2020 Report Share Posted November 29, 2020 There is an ongoing discussion here about Ely Culbertson's controversial "Law of Symmetry".I hacked this script to validate it using random deals.You can plug in a hand shape (say 5-4-3-1) and get the probability that it is replicated in one or more suits.The results are discussed in the above linked thread.Please only comment on script bugs or technical issues here. Dealer that works script: ## # "Law of Symmetry" Validation # ############# insert shape of S hand as four numbers below S_sp = 5 S_he = 4 S_di = 4 S_cl = 0 S_hand = ((spades(south) == S_sp) and (hearts(south) == S_he) and (diamonds(south) == S_di) and(clubs(south) == S_cl)) W_sp = spades(west) W_he = hearts(west) W_di = diamonds(west) W_cl = clubs(west) N_sp = spades(north) N_he = hearts(north) N_di = diamonds(north) N_cl = clubs(north) E_sp = spades(east) E_he = hearts(east) E_di = diamonds(east) E_cl = clubs(east) sp_ok = (W_sp == S_he and N_sp == S_di and E_sp == S_cl) or (W_sp == S_he and N_sp == S_cl and E_sp == S_di) or (W_sp == S_di and N_sp == S_he and E_sp == S_cl) or (W_sp == S_di and N_sp == S_cl and E_sp == S_he) or (W_sp == S_cl and N_sp == S_he and E_sp == S_di) or (W_sp == S_cl and N_sp == S_di and E_sp == S_he) he_ok = (W_he == S_sp and N_he == S_di and E_he == S_cl) or (W_he == S_sp and N_he == S_cl and E_he == S_di) or (W_he == S_di and N_he == S_sp and E_he == S_cl) or (W_he == S_di and N_he == S_cl and E_he == S_sp) or (W_he == S_cl and N_he == S_sp and E_he == S_di) or (W_he == S_cl and N_he == S_di and E_he == S_sp) di_ok = (W_di == S_sp and N_di == S_he and E_di == S_cl) or (W_di == S_sp and N_di == S_cl and E_di == S_he) or (W_di == S_he and N_di == S_sp and E_di == S_cl) or (W_di == S_he and N_di == S_cl and E_di == S_sp) or (W_di == S_cl and N_di == S_sp and E_di == S_he) or (W_di == S_cl and N_di == S_he and E_di == S_sp) cl_ok = (W_cl == S_sp and N_cl == S_he and E_cl == S_di) or (W_cl == S_sp and N_cl == S_di and E_cl == S_he) or (W_cl == S_he and N_cl == S_sp and E_cl == S_di) or (W_cl == S_he and N_cl == S_di and E_cl == S_sp) or (W_cl == S_di and N_cl == S_sp and E_cl == S_he) or (W_cl == S_di and N_cl == S_he and E_cl == S_sp) tot_ok = sp_ok + he_ok + di_ok + cl_ok produce 1000 condition S_hand ###### uncomment ONE action below ########## #action printes ("Hand Shape: ",S_sp,S_he,S_di,S_cl," Suits same shape: ", sp_ok,he_ok,di_ok,cl_ok,\n) #action frequency(sp_ok,0,1) #action frequency(he_ok,0,1) #action frequency(di_ok,0,1) #action frequency(cl_ok,0,1) action frequency(tot_ok,0,4) Quote Link to comment Share on other sites More sharing options...
nullve Posted November 29, 2020 Report Share Posted November 29, 2020 I tried to check the law for the (5431) case this morning but decided to not post about it. Here's the (very ugly) code I posted and deleted 5 minutes ago but now also with a condition so that it has a chance of working :): spades_division_supports_law = (spades(north)==1 and spades(east)==3 and spades(south)==4 and spades(west)==5) or (spades(north)==1 and spades(east)==3 and spades(south)==5 and spades(west)==4) or (spades(north)==1 and spades(east)==4 and spades(south)==3 and spades(west)==5) or (spades(north)==1 and spades(east)==4 and spades(south)==5 and spades(west)==3) or (spades(north)==1 and spades(east)==5 and spades(south)==3 and spades(west)==4) or (spades(north)==1 and spades(east)==5 and spades(south)==4 and spades(west)==3) or (spades(north)==3 and spades(east)==1 and spades(south)==4 and spades(west)==5) or (spades(north)==3 and spades(east)==1 and spades(south)==5 and spades(west)==4) or (spades(north)==3 and spades(east)==4 and spades(south)==1 and spades(west)==5) or (spades(north)==3 and spades(east)==4 and spades(south)==5 and spades(west)==1) or (spades(north)==3 and spades(east)==5 and spades(south)==1 and spades(west)==4) or (spades(north)==3 and spades(east)==5 and spades(south)==4 and spades(west)==1) or (spades(north)==4 and spades(east)==1 and spades(south)==3 and spades(west)==5) or (spades(north)==4 and spades(east)==1 and spades(south)==5 and spades(west)==3) or (spades(north)==4 and spades(east)==3 and spades(south)==1 and spades(west)==5) or (spades(north)==4 and spades(east)==3 and spades(south)==5 and spades(west)==1) or (spades(north)==4 and spades(east)==5 and spades(south)==1 and spades(west)==3) or (spades(north)==4 and spades(east)==5 and spades(south)==3 and spades(west)==1) or (spades(north)==5 and spades(east)==1 and spades(south)==3 and spades(west)==4) or (spades(north)==5 and spades(east)==1 and spades(south)==4 and spades(west)==3) or (spades(north)==5 and spades(east)==3 and spades(south)==1 and spades(west)==4) or (spades(north)==5 and spades(east)==3 and spades(south)==4 and spades(west)==1) or (spades(north)==5 and spades(east)==4 and spades(south)==1 and spades(west)==3) or (spades(north)==5 and spades(east)==4 and spades(south)==3 and spades(west)==1) hearts_division_supports_law = (hearts(north)==1 and hearts(east)==3 and hearts(south)==4 and hearts(west)==5) or (hearts(north)==1 and hearts(east)==3 and hearts(south)==5 and hearts(west)==4) or (hearts(north)==1 and hearts(east)==4 and hearts(south)==3 and hearts(west)==5) or (hearts(north)==1 and hearts(east)==4 and hearts(south)==5 and hearts(west)==3) or (hearts(north)==1 and hearts(east)==5 and hearts(south)==3 and hearts(west)==4) or (hearts(north)==1 and hearts(east)==5 and hearts(south)==4 and hearts(west)==3) or (hearts(north)==3 and hearts(east)==1 and hearts(south)==4 and hearts(west)==5) or (hearts(north)==3 and hearts(east)==1 and hearts(south)==5 and hearts(west)==4) or (hearts(north)==3 and hearts(east)==4 and hearts(south)==1 and hearts(west)==5) or (hearts(north)==3 and hearts(east)==4 and hearts(south)==5 and hearts(west)==1) or (hearts(north)==3 and hearts(east)==5 and hearts(south)==1 and hearts(west)==4) or (hearts(north)==3 and hearts(east)==5 and hearts(south)==4 and hearts(west)==1) or (hearts(north)==4 and hearts(east)==1 and hearts(south)==3 and hearts(west)==5) or (hearts(north)==4 and hearts(east)==1 and hearts(south)==5 and hearts(west)==3) or (hearts(north)==4 and hearts(east)==3 and hearts(south)==1 and hearts(west)==5) or (hearts(north)==4 and hearts(east)==3 and hearts(south)==5 and hearts(west)==1) or (hearts(north)==4 and hearts(east)==5 and hearts(south)==1 and hearts(west)==3) or (hearts(north)==4 and hearts(east)==5 and hearts(south)==3 and hearts(west)==1) or (hearts(north)==5 and hearts(east)==1 and hearts(south)==3 and hearts(west)==4) or (hearts(north)==5 and hearts(east)==1 and hearts(south)==4 and hearts(west)==3) or (hearts(north)==5 and hearts(east)==3 and hearts(south)==1 and hearts(west)==4) or (hearts(north)==5 and hearts(east)==3 and hearts(south)==4 and hearts(west)==1) or (hearts(north)==5 and hearts(east)==4 and hearts(south)==1 and hearts(west)==3) or (hearts(north)==5 and hearts(east)==4 and hearts(south)==3 and hearts(west)==1) diamonds_division_supports_law = (diamonds(north)==1 and diamonds(east)==3 and diamonds(south)==4 and diamonds(west)==5) or (diamonds(north)==1 and diamonds(east)==3 and diamonds(south)==5 and diamonds(west)==4) or (diamonds(north)==1 and diamonds(east)==4 and diamonds(south)==3 and diamonds(west)==5) or (diamonds(north)==1 and diamonds(east)==4 and diamonds(south)==5 and diamonds(west)==3) or (diamonds(north)==1 and diamonds(east)==5 and diamonds(south)==3 and diamonds(west)==4) or (diamonds(north)==1 and diamonds(east)==5 and diamonds(south)==4 and diamonds(west)==3) or (diamonds(north)==3 and diamonds(east)==1 and diamonds(south)==4 and diamonds(west)==5) or (diamonds(north)==3 and diamonds(east)==1 and diamonds(south)==5 and diamonds(west)==4) or (diamonds(north)==3 and diamonds(east)==4 and diamonds(south)==1 and diamonds(west)==5) or (diamonds(north)==3 and diamonds(east)==4 and diamonds(south)==5 and diamonds(west)==1) or (diamonds(north)==3 and diamonds(east)==5 and diamonds(south)==1 and diamonds(west)==4) or (diamonds(north)==3 and diamonds(east)==5 and diamonds(south)==4 and diamonds(west)==1) or (diamonds(north)==4 and diamonds(east)==1 and diamonds(south)==3 and diamonds(west)==5) or (diamonds(north)==4 and diamonds(east)==1 and diamonds(south)==5 and diamonds(west)==3) or (diamonds(north)==4 and diamonds(east)==3 and diamonds(south)==1 and diamonds(west)==5) or (diamonds(north)==4 and diamonds(east)==3 and diamonds(south)==5 and diamonds(west)==1) or (diamonds(north)==4 and diamonds(east)==5 and diamonds(south)==1 and diamonds(west)==3) or (diamonds(north)==4 and diamonds(east)==5 and diamonds(south)==3 and diamonds(west)==1) or (diamonds(north)==5 and diamonds(east)==1 and diamonds(south)==3 and diamonds(west)==4) or (diamonds(north)==5 and diamonds(east)==1 and diamonds(south)==4 and diamonds(west)==3) or (diamonds(north)==5 and diamonds(east)==3 and diamonds(south)==1 and diamonds(west)==4) or (diamonds(north)==5 and diamonds(east)==3 and diamonds(south)==4 and diamonds(west)==1) or (diamonds(north)==5 and diamonds(east)==4 and diamonds(south)==1 and diamonds(west)==3) or (diamonds(north)==5 and diamonds(east)==4 and diamonds(south)==3 and diamonds(west)==1) clubs_division_supports_law = (clubs(north)==1 and clubs(east)==3 and clubs(south)==4 and clubs(west)==5) or (clubs(north)==1 and clubs(east)==3 and clubs(south)==5 and clubs(west)==4) or (clubs(north)==1 and clubs(east)==4 and clubs(south)==3 and clubs(west)==5) or (clubs(north)==1 and clubs(east)==4 and clubs(south)==5 and clubs(west)==3) or (clubs(north)==1 and clubs(east)==5 and clubs(south)==3 and clubs(west)==4) or (clubs(north)==1 and clubs(east)==5 and clubs(south)==4 and clubs(west)==3) or (clubs(north)==3 and clubs(east)==1 and clubs(south)==4 and clubs(west)==5) or (clubs(north)==3 and clubs(east)==1 and clubs(south)==5 and clubs(west)==4) or (clubs(north)==3 and clubs(east)==4 and clubs(south)==1 and clubs(west)==5) or (clubs(north)==3 and clubs(east)==4 and clubs(south)==5 and clubs(west)==1) or (clubs(north)==3 and clubs(east)==5 and clubs(south)==1 and clubs(west)==4) or (clubs(north)==3 and clubs(east)==5 and clubs(south)==4 and clubs(west)==1) or (clubs(north)==4 and clubs(east)==1 and clubs(south)==3 and clubs(west)==5) or (clubs(north)==4 and clubs(east)==1 and clubs(south)==5 and clubs(west)==3) or (clubs(north)==4 and clubs(east)==3 and clubs(south)==1 and clubs(west)==5) or (clubs(north)==4 and clubs(east)==3 and clubs(south)==5 and clubs(west)==1) or (clubs(north)==4 and clubs(east)==5 and clubs(south)==1 and clubs(west)==3) or (clubs(north)==4 and clubs(east)==5 and clubs(south)==3 and clubs(west)==1) or (clubs(north)==5 and clubs(east)==1 and clubs(south)==3 and clubs(west)==4) or (clubs(north)==5 and clubs(east)==1 and clubs(south)==4 and clubs(west)==3) or (clubs(north)==5 and clubs(east)==3 and clubs(south)==1 and clubs(west)==4) or (clubs(north)==5 and clubs(east)==3 and clubs(south)==4 and clubs(west)==1) or (clubs(north)==5 and clubs(east)==4 and clubs(south)==1 and clubs(west)==3) or (clubs(north)==5 and clubs(east)==4 and clubs(south)==3 and clubs(west)==1) evidence = spades_division_supports_law or hearts_division_supports_law or diamonds_division_supports_law or clubs_division_supports_law condition shape(north, any 5431) produce 1000000 action frequency "evidence: " (evidence,0,1) One run: Frequency evidence: : 0 333545 1 666455 Generated 7719534 hands Produced 1000000 hands Initial random seed 1606663368 Time needed 15.969 sec Quote Link to comment Share on other sites More sharing options...
hrothgar Posted November 29, 2020 Report Share Posted November 29, 2020 Somewhat confused here From my perspective, the first thing to do is validate that the frequency that the dealer script is producing hand shapes of shape foo corresponds to "reality". (Please note, the reason that I do this is more to check my own coding than any distrust of the Dealer program) After doing so, I'd do pairwise comparisons and check for independence. Quote Link to comment Share on other sites More sharing options...
pescetom Posted November 29, 2020 Author Report Share Posted November 29, 2020 Somewhat confused here From my perspective, the first thing to do is validate that the frequency that the dealer script is producing hand shapes of shape foo corresponds to "reality". (Please note, the reason that I do this is more to check my own coding than any distrust of the Dealer program)Of course. Just set the shape at the top and comment out the action at the end to see 1000 hands. After doing so, I'd do pairwise comparisons and check for independence.Could you explain what this involves please?I did check each of the suits separately and they seemed in the ballpark - the script uses a lot of cut and paste and it would be easy to get one suit wrong somewhere I agree.I'm directing a tourney now, but later will check that (say) 5-4-3-1 and 1-3-4-5 behave the same. Quote Link to comment Share on other sites More sharing options...
hrothgar Posted November 29, 2020 Report Share Posted November 29, 2020 Life gets complicated when you are looking at all four hands at once because you have lots of binding constraints. So, to me at least, it would be more interesting just to look at (say) the South hand and see whether the frequency with which the East hand has the same shape is greater than or less than expected Maybe I'll code something up in R later todayProbably better suited for this Quote Link to comment Share on other sites More sharing options...
smerriman Posted November 29, 2020 Report Share Posted November 29, 2020 As mentioned in the other thread, this doesn't validate or disprove the law at all - it's nothing to do with the law. The law is that the process of imperfect shuffles combined with the groupings of tricks formed by playing out a bridge hand biases the deck. The most complex part here is coming up with a shuffling algorithm that most resembles real life. If you had one of those, then perhaps you could shuffle, use robots to play out the hand, shuffle, etc and then after a while (he says 'a few hours', however many deals that would be) see if the tend is towards patterns, which is the whole basis of proving whether the law is true or not. Quote Link to comment Share on other sites More sharing options...
pescetom Posted November 29, 2020 Author Report Share Posted November 29, 2020 So, to me at least, it would be more interesting just to look at (say) the South hand and see whether the frequency with which the East hand has the same shape is greater than or less than expectedBut that is not what Culbertson is postulating. He says the shape of the south hand will be replicated in one suit looking at all four hands around the table. Quote Link to comment Share on other sites More sharing options...
pescetom Posted November 30, 2020 Author Report Share Posted November 30, 2020 I did check each of the suits separately and they seemed in the ballpark - the script uses a lot of cut and paste and it would be easy to get one suit wrong somewhere I agree.I'm directing a tourney now, but later will check that (say) 5-4-3-1 and 1-3-4-5 behave the same. I checked that the order of suit lengths has no effect on the total of matching suits for hand shape foo (by swapping pairs of suits and inverting the whole order, e.g. 5341 5314 1345 instead of 5431). I also added a debug action so you can see case by case which suit(s) have the same shape as the hand. Did not see any anomalies. Quote Link to comment Share on other sites More sharing options...
pescetom Posted November 30, 2020 Author Report Share Posted November 30, 2020 As mentioned in the other thread, this doesn't validate or disprove the law at all - it's nothing to do with the law. The law is that the process of imperfect shuffles combined with the groupings of tricks formed by playing out a bridge hand biases the deck. The most complex part here is coming up with a shuffling algorithm that most resembles real life. If you had one of those, then perhaps you could shuffle, use robots to play out the hand, shuffle, etc and then after a while (he says 'a few hours', however many deals that would be) see if the tend is towards patterns, which is the whole basis of proving whether the law is true or not. Discussed on the other thread. This one is just about the script which validates the law as applied to random deals. Quote Link to comment Share on other sites More sharing options...
PeterAlan Posted November 30, 2020 Report Share Posted November 30, 2020 The following table gives the answers for 5=4=3=1: Target shape: 5=4=3=1 # deals with 1, 2, 3, 4 or no instances of target: -- % of - --- % of --- # # deals all deals target deals -- -------------------------------------- --------- ------------ 1: 18,462,006,540,449,844,182,883,072,000 = 34.41532 % 80.66927 % 2: 3,997,264,604,908,323,574,425,600,000 = 7.45136 % 17.46595 % 3: 417,060,951,961,543,212,331,008,000 = 0.77745 % 1.82234 % 4: 9,713,344,598,876,987,228,160,000 = 0.01811 % 0.04244 % -- -------------------------------------- --------- --------- 22,886,045,441,918,587,956,867,840,000 = 42.66224 % 100.00000 % -- -------------------------------------- --------- --------- 0: 30,758,692,323,570,204,882,369,600,000 = 57.33776 % == ====================================== ========= 53,644,737,765,488,792,839,237,440,000 = 100.00000 % ====================================== ========= This is an extract from program output that gives these details for all 39 deal shapes, as well as the distributions of longest and shortest suits in the other 3 hands. If anyone is interested in the full output, I'm happy to send it out. The program calculates these quantities directly from the set of all the possible deal shapes, and does not involve simulation in any form. With that set as the staring point, it's a quick calculation: less than 1/4 second on my first-generation Surface Book. Quote Link to comment Share on other sites More sharing options...
PeterAlan Posted December 7, 2020 Report Share Posted December 7, 2020 In the unlikely event that anyone is interested, I extended my program to calculate the following statistics concerning the validity of the so-called "Law" of symmetry in the form that a particular hand shape in a deal is likely to lead to the same shape applying to one or more of the suits (Since there is a complete duality between the hand shape distributions of all possible deals and the corresponding suit distributions, any such "Law" would apply mutatis mutandis to say that a particular suit distribution would imply a corresponding hand distribution somewhere in the deal; did Culbertson make some remark to indicate that he recognised this?) The table gives, for each hand shape, the probability that a deal containing that hand shape will have one or more suits of the same shape: Proportion of deals with target hand shape that contain same suit shape: Target shape Proportion ============ ========== 4=3=3=3 59.372 % 4=4=3=2 76.127 % 4=4=4=1 30.810 % 5=3=3=2 65.237 % 5=4=2=2 56.652 % 5=4=3=1 63.130 % 5=4=4=0 29.634 % 5=5=2=1 31.655 % 5=5=3=0 23.434 % 6=3=2=2 50.414 % 6=3=3=1 35.340 % 6=4=2=1 42.194 % 6=4=3=0 32.441 % 6=5=1=1 12.984 % 6=5=2=0 17.255 % 6=6=1=0 3.236 % 7=2=2=2 18.922 % 7=3=2=1 56.865 % 7=3=3=0 12.686 % 7=4=1=1 15.143 % 7=4=2=0 16.513 % 7=5=1=0 5.459 % 7=6=0=0 0.618 % 8=2=2=1 42.049 % 8=3=1=1 26.175 % 8=3=2=0 24.625 % 8=4=1=0 10.496 % 8=5=0=0 0.910 % 9=2=1=1 48.209 % 9=2=2=0 22.315 % 9=3=1=0 27.239 % 9=4=0=0 2.676 % 10=1=1=1 24.048 % 10=2=1=0 66.576 % 10=3=0=0 9.397 % 11=1=1=0 68.421 % 11=2=0=0 31.579 % 12=1=0=0 100.000 % 13=0=0=0 100.000 % ============ ========== 1 Quote Link to comment Share on other sites More sharing options...
blackshoe Posted December 9, 2020 Report Share Posted December 9, 2020 I don't see any pattern in those percentages. OTOH, I didn't look very hard. B-) Quote Link to comment Share on other sites More sharing options...
pescetom Posted December 9, 2020 Author Report Share Posted December 9, 2020 In the unlikely event that anyone is interested, I extended my program to calculate the following statistics concerning the validity of the so-called "Law" of symmetry in the form that a particular hand shape in a deal is likely to lead to the same shape applying to one or more of the suits. Thanks very much, of course I am interested.Also pleased to see that for the key shapes it closely coincides with the outcome of my simulation with less datapoints, for example you have 6511 at 13.0% and I at 14%, you have 7411 at 15.1% and I at 15%. "With a hand-pattern 7-4-1-1 I am not so happy about my seven-card suit, for it is astonishing how often it will break 7-4-1-1.". Quote Link to comment Share on other sites More sharing options...
pescetom Posted December 9, 2020 Author Report Share Posted December 9, 2020 I don't see any pattern in those percentages. OTOH, I didn't look very hard. B-) You didn't look very hard at all :blink: Try looking at what happens when the long suit hits 6 or 7, which is Culbertson's preferred zone for examples. Quote Link to comment Share on other sites More sharing options...
PeterAlan Posted December 9, 2020 Report Share Posted December 9, 2020 I don't see any pattern in those percentages.Well the effect asserted by Culbertson certainly isn't generally there. In the extreme cases of deals containing hand patterns 13=0=0=0 or 12=1=0=0 there are perforce the same suit patterns, and some residue of the same effect shows in the relatively high results for the very unusual 11=1=1=0 and 10=2=1=0 shapes. But in the realm of the common hand distributions the numbers largely reflect the preponderance of those shapes in the set of all deal distributions: for example, in the 4=4=3=2 case, 61.185% of all deals contain at least one suit distributed 4=4=3=2; when we're constraining the shapes of the deals in question by limiting them to those with at least one flat 4=4=3=2-shaped hand it's not too surprising that the proportion with a 4=4=3=2 suit rises from 61.185% to 76.127%, but that's as far as it gets in all but the most extreme cases. I don't suppose that Culbertson ever made any attempt at a proper analysis, either of this mathematical structure or of whatever anecdotal evidence he had of the (hand-shuffled) deals he played. It's natural to notice the cases where patterns occur, and to tune out the cases where they don't, which leads to distorted impressions. Beware of intuition: results are often counter-intuitive. For example, what do you suppose is the commonest result for the longest suit in a deal? In fact, it's 6 cards (43.3% of all deals), which beats 5 (40.23%), 7 (12.64%), 4 (2.93%) and 8 (1.83%). Quote Link to comment Share on other sites More sharing options...
PeterAlan Posted December 9, 2020 Report Share Posted December 9, 2020 Try looking at what happens when the long suit hits 6 or 7, which is Culbertson's preferred zone for examples.My reply to Blackshoe crossed with your posting this. I wasn't aware of that detail of Culbertson's suggestion, but it's notable that it's only particular 6- and 7- card shapes that stand out: 7=3=2=1 (especially), 6=3=2=2, and to a lesser extent 6=4=2=1 and 6=3=3=1. Deals containing these shapes are noticeably commoner than those containing other 7- or 6-card shapes. Quote Link to comment Share on other sites More sharing options...
Recommended Posts