discrete rv optimizaiton