Need Help Solving Optimization Problem In R Stack Overflow

Need Help Solving Optimization Problem In R Stack Overflow