This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding=utf-8 | |
# License: Public domain (CC0) | |
# Isaac Turner 2016/12/05 | |
from __future__ import print_function | |
import difflib | |
import re |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Computes the probability distribution of states created by | |
the shuffle2 algorithm. This should return results similar to | |
enumerate_shuffle.py. | |
A state is a 2-tuple: (swapped, deck) | |
The probability of transitioning from one state to another can be represented by | |
a Markov matrix M. |