Answered step by step
Verified Expert Solution
Question
...
1 Approved Answer
User R studio and provide code below Below there is adiet chart which gives calories, protein, carbohydrate and fat content for 4 food items. Sara
User R studio and provide code below
Below there is adiet chart which gives calories, protein, carbohydrate and fat content for 4 food items. Sara wants a diet with minimum cost. Thediet chart is as follows:
Food Item 1 | Food Item 2 | Food Item 3 | Food Item 4 | |
Calories | 400 | 200 | 150 | 500 |
Protein (in grams) | 3 | 2 | 0 | 0 |
Carbohydrates ( in grams) | 2 | 2 | 4 | 4 |
Fat (in grams) | 2 | 4 | 1 | 5 |
Cost | $1.00 | $0.40 | $0.60 | $1.80 |
The chart gives the nutrient content as well as the per-unit cost of each food item. The diet has to be planned in such a way that it should contain at least 500 calories, 6 grams of protein, 10 grams of carbohydrates and 8 grams of fat.
Determine how much of each food item is to be used in the diet to minimize the total cost.
.
- Formulatethe linear programming model for this problem.
- Define the decision variables
- Formulate the objective function
- State the constraints
- Entering the problem data and finding the optimum solution using R Studio
- Call lpSolve library Library (lpSolve)
- Enter the problem Data (formulation)
- Solution - Solve the problem
- Display the optimum solution values? How much of each food item should be used in the diet?
- Display the objective function value (total cost) of the optimum solution? What is the total cost?
- Obtain the dual values.
- What are the dual values for the calorie, protein, carbohydrate, and fat requirements?
- How much would the cost increase if the diet required one additional gram of calorie (501 grams instead of 500)?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-text-image.webp)
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Step: 3
![blur-text-image](https://dsd5zvtm8ll6.cloudfront.net/includes/images/document_product_info/blur-subtext-image.webp)
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started