from random import choice

def Ehrenfest(k,n):
    # k : nombre de particules
    # n : nombre d'étapes
    R1 = [ i for i in range(1,k+1) ]
    R2 = []
    for i in range(n):
        j = choice( range(1,k+1) )
        if j in R1:
            R1.remove( j )
            R2.append( j )
        else:
            R2.remove( j )
            R1.append( j )

    return len(R1),len(R2)
