coursera class functional random generator