Project Euler #213: Flea Circus

  • + 0 comments

    Markov Chains definitely work, but it may be bottlenecked by the speed of matrix multiplications. The matrix representation will have n^2 x n^2 elements (although there's probably a better way to do it) and you'll have to multiple it by itself many times. For n=40 and m=100 you can expect it to be very slow.