(Update) I need to find stationary distribution of a Markov Chain with 4.5 million states. It means I need to solve a linear system with 4.5 million equations. Each state is a vector of size 6. I am trying to store each state in a list. The following in part of my effort in creating all admissible states.
I am trying to loop through a big set of numbers and create a set of vectors. Here is a simplified version of my code:
mylist=[]
for i in range(1,4):
for j in range(1,4-i):
for k in range(0,5-i-j):
Temp=[i,j,k]
mylist.extend(Temp)
print(mylist)
mylist=[]
Temp=[]
which will give me:
[1, 1, 0]
[1, 1, 1]
[1, 1, 2]
[1, 2, 0]
[1, 2, 1]
[2, 1, 0]
[2, 1, 1]
my question is: is there a neater, nicer, more efficient way of doing this in Python?
Thank you