Algorithms for Random Generation and Counting by