• vjerancrnjak 2 hours ago

    Bruteforce thinking works in this case, given that there's only ~12*2^12 total states and transition matrix is very sparse, 1/11 is quick to calculate.

    But not all of these states are valid, visited set is just defined by 2 markers on the circle (and the start position), so now state count is much smaller.

    Ladybug needs to be on 7 or 5 while having a nice (7,5) visited state to reach 6, movements inside (7, 5) don't really matter, so state count gets to 12*11/2=66. Quite small and enough to do by hand.

    edit: been thinking a bit on finding a short proof, as 1/11 (or 1/(N-1) in general case) sounds like there could be a nice short proof, but it only made me realize how these constructive proofs are so clean and any attempts to formalize this gets me into graph theory vibes where I just feel like proof is making nonsymbolic leaps in reasoning that I just can't feel are true.

    • archargelod 4 hours ago

      > After 5000 runs, they were all 8.4-9.7%

      This sample size is really small. I ran 100 million simulations in Nim[0] (takes around a minute). And distribution converges toward 9.09% on all positions equally:

          Average turns: 65.99609065001634
          Final position distribution:
           4: 9.095%
          11: 9.093%
           7: 9.091%
           3: 9.091%
          10: 9.090%
           9: 9.090%
           1: 9.090%
           8: 9.090%
           2: 9.090%
           6: 9.090%
           5: 9.089%
           0: 0.000%
      
      
      [0] - https://play.nim-lang.org/#pasty=hwdfbsfh (reduced amount of runs to not abuse playground server resources)
      • ludwik 5 hours ago

        Shouldn't the code say:

            position = (position + direction + 1) % 12;
        
        Or have I misunderstood something?
        • LiamPowell 5 hours ago

          The +12 is to keep the number positive. The direction contains the movement so a +1 wouldn't make sense.

          • nulptr 4 hours ago

            The +12 there is so that % works correctly (ie the number never becomes negative)