Markov Chains, Probabilistic Models, Text Generation, Hidden Markov Models, Python.
curr_state = np.random.choice([0, 1, 2], p=A[prev_state]) pi[curr_state] += 1 prev_state = curr_state itr += 1 print("PI = ", pi/steps) monte_carlo(10 ** 6, 0) Next, I will use the repeated matrix multiplication approach. # Repeated Matrix Multiplication approach def repeated_mat_mul(steps): steps