<jupyter_start><jupyter_text>Markov Chain- Set of possible states- Initial state- Transition Model<jupyter_code># transition matrix
T = np.array([[0.9, 0.1], [0.5, 0.5]])

# T after some steps
T_3 = np.linalg.matrix_power(T, 3)
T_50 = np.linalg.matrix_power(T, 50)
T_100 = np.linalg.matrix_power(T, 100)

print(T_3)
print(T_50)
print(T_100)
# initial distribution
v = np.array([[1, 0]])

# distribution after some steps
v_1 = np.dot(v, T)
v_3 = np.dot(v, T_3)
v_50 = np.dot(v, T_50)
v_100 = np.dot(v, T_100)

print(v_1)
print(v_3)
print(v_50)
print(v_100)<jupyter_output>[[0.9 0.1]]
[[0.844 0.156]]
[[0.83333333 0.16666667]]
[[0.83333333 0.16666667]]
{'fraction_non_alphanumeric': 0.18, 'fraction_numerical': 0.1476923076923077, 'mean_word_length': 5.027777777777778, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '628358', 'license': 'MIT', 'n_tokens_mistral': 366, 'n_tokens_neox': 314, 'n_words': 65, 'path': 'markov_chain.ipynb', 'repo_name': 'shuuchen/keras_reinforcement_learning', 'size': '650'}