Email Record: Algorithms for random generation and counting :