Question

In: Advanced Math

  A company makes four types of gourmet chocolate bars. Chocolate Bar I contains 5 grams...



  A company makes four types of gourmet chocolate bars. Chocolate Bar I contains 5 grams of nuts, 5 grams of biscuit, 10 grams of caramel, and 100 grams of chocolate, and sells for $5.40. Chocolate Bar II contains 10 grams of nuts, 10 grams of biscuit, 10 grams of caramel, and 90 grams of chocolate and sells for $6.25. Chocolate Bar III contains no nuts, 10 grams of biscuit, 10 grams of caramel, and 100 grams of chocolate and sells for $5.25. Chocolate Bar IV contains 20 grams of nuts, no biscuit, 10 grams of caramel, and 90 grams of chocolate and sells for $7.00. The ingredient costs are $0.15 per gram of nuts, $0.025 per gram of biscuit, $0.02 per gram of caramel, and $0.015 per gram of chocolate. The company has supplier agreements that force them to order at least 50,000 grams of each ingredient per week (nuts, biscuit, caramel, and chocolate). However, due to the space in their warehouse and the expense of holding too much inventory, the company cannot hold more than 100,000 grams of nuts; 75,000 grams of biscuits; 85,000 grams of caramel; and 500,000 grams of chocolate per week. How many chocolate bars of each type should the company produce each week in order to maximize its weekly profit?   

Solutions

Expert Solution

Let be the number of chocolate bars of type I, II, III, and IV respectively.

Amount of nuts needed

Amount of biscuits needed

Amount of caramel needed

Amount of chocolate needed

Therefore, cost price of nuts

Cost price of biscuits

Cost price of caramel

Cost price of chocolate

Total cost

Total sale

Therefore, profit

We want to maximize the objective function

subject to

You will get maximum at and the maximum profit

Write a Python code as follows:

import numpy as np
from scipy.optimize import minimize

def objective(x):
return x[0]*x[3]*(x[0]+x[1]+x[2])+x[2]

def constraint1(x):
return x[1]
def constraint2(x):
return x[2]
def constraint3(x):
return x[3]
def constraint4(x):
return x[4]
def constraint5(x):
return x[1]+2*x[2]+4*x[4]-10000
def constraint6(x):
return 20000-(x[1]+2*x[2]+4*x[4])
def constraint7(x):
return x[1]+2*x[2]+2*x[3]-10000
def constraint8(x):
return 15000-(x[1]+2*x[2]+2*x[3])
def constraint9(x):
return x[1]+x[2]+x[3]+x[4]-5000
def constraint10(x):
return 8500-(x[1]+x[2]+x[3]+x[4])
def constraint11(x):
return 10*x[1]+9*x[2]+10*x[3]+9*x[4]-5000
def constraint12(x):
return 50000-(10*x[1]+9*x[2]+10*x[3]+9*x[4])
# initial guesses
n = 4
x0 = np.zeros(n)
x0[0] = 0.0
x0[1] = 0.0
x0[2] = 0.0
x0[3] = 0.0

# show initial objective
print('Initial SSE Objective: ' + str(objective(x0)))

# optimize
b = (0.0,8500.0)
bnds = (b, b, b, b)
con1 = {'type': 'ineq', 'fun': constraint1}
con2 = {'type': 'ineq', 'fun': constraint2}
con3 = {'type': 'ineq', 'fun': constraint3}
con4 = {'type': 'ineq', 'fun': constraint4}
con5 = {'type': 'ineq', 'fun': constraint5}
con6 = {'type': 'ineq', 'fun': constraint6}
con7 = {'type': 'ineq', 'fun': constraint7}
con8 = {'type': 'ineq', 'fun': constraint8}
con9 = {'type': 'ineq', 'fun': constraint9}
con10 = {'type': 'ineq', 'fun': constraint10}
con11 = {'type': 'ineq', 'fun': constraint11}
con12 = {'type': 'ineq', 'fun': constraint12}
cons = ([con1,con2,con3,con4,con5,con6,con7,con8,con9,con10,con11,con12])
solution = minimize(objective,x0,method='SLSQP',\
bounds=bnds,constraints=cons)
x = solution.x

# show final objective
print('Final SSE Objective: ' + str(objective(x)))

# print solution
print('Solution')
print('x1 = ' + str(x[0]))
print('x2 = ' + str(x[1]))
print('x3 = ' + str(x[2]))
print('x4 = ' + str(x[3]))


Related Solutions

The sugar bear candy factory makes two types of chocolate candy bars milk chocolate and milk...
The sugar bear candy factory makes two types of chocolate candy bars milk chocolate and milk chocolate with almonds. In a typical day, 40% of the candy bars are being made of milk chocolate with almonds and the rest is plain milk chocolate. At the end of the day, a quality control expert randomly chooses 14 candy bars for inspection. a. What is the probability that fewer than 6 of the candy bars contained almonds? b.What is the probability that...
Problem 2) Willy Wonka’s Chocolate Factory produces four types of chocolate bars: • 30 percent of...
Problem 2) Willy Wonka’s Chocolate Factory produces four types of chocolate bars: • 30 percent of the chocolate bars are milk chocolate of which 10 percent have a golden ticket, • 15 percent of the chocolate bars are bitter chocolate of which 20 percent have a golden ticket, • 35 percent of the chocolate bars are mint chocolate of which 40 percent have a golden ticket, • 20 percent of the chocolate bars are vegemite chocolate of which 5 percent...
The company manufactures chocolate bars with nominal weight of 115 g per bar. In order to...
The company manufactures chocolate bars with nominal weight of 115 g per bar. In order to to avoid risk of short changing, the mean weight is set as 117 g and SD of 2 g. Assuming that 40 chocolate bars are selected, 97% of the sample means will be between what value? ( give the upper and lower value)
The company manufactures chocolate bars with nominal weight of 115 g per bar. In order to...
The company manufactures chocolate bars with nominal weight of 115 g per bar. In order to to avoid risk of short changing, the mean weight is set as 117 g and SD of 2 g. What is the probability that : (a) a random chocolate bar weighs between 116 gram and 120 gram? (b) a particular sample mean would be less than 116.5 millimeters chosen of 40 random samples of chocolate bar.
Acme Food Ltd. company makes TWIXIE chocolate bars. The company has two processing departments: Baking and...
Acme Food Ltd. company makes TWIXIE chocolate bars. The company has two processing departments: Baking and Mixing. In the Baking Department, the raw ingredients for the one side is made as well as the ingredients for the other side in specially made vats that separate the two sides of the candy bar. In the Mixing Department, the melted chocolate and other ingredients from the Baking Department are carefully packaged into decorative wrapping done by hand. The company uses a process...
A random sample of 18 Belgium chocolate bars has, on average, 345 calories per bar, with...
A random sample of 18 Belgium chocolate bars has, on average, 345 calories per bar, with a standard deviation of 28 calories.  Construct a 95% confidence interval for the true mean calorie content of these chocolate bars.  Assume that the distribution of the calorie content is approximately normal
Flexible Budgeting and Variance Analysis I Love My Chocolate Company makes dark chocolate and light chocolate....
Flexible Budgeting and Variance Analysis I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and sugar. The following planning information has been made available: Standard Amount per Case      Dark Chocolate      Light Chocolate      Standard Price per Pound Cocoa 9 lbs. 6 lbs. $4.60 Sugar 7 lbs. 11 lbs. 0.60 Standard labor time 0.3 hr. 0.4 hr. Dark Chocolate Light Chocolate Planned production 4,500 cases 9,800 cases Standard labor rate $13.00 per hr. $13.00 per hr....
Flexible Budgeting and Variance Analysis I Love My Chocolate Company makes dark chocolate and light chocolate....
Flexible Budgeting and Variance Analysis I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and sugar. The following planning information has been made available: Standard Amount per Case      Dark Chocolate      Light Chocolate      Standard Price per Pound Cocoa 9 lbs. 6 lbs. $4.20 Sugar 7 lbs. 11 lbs. 0.60 Standard labor time 0.3 hr. 0.4 hr. Dark Chocolate Light Chocolate Planned production 4,400 cases 13,500 cases Standard labor rate $13.00 per hr. $13.00 per hr....
I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and...
I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and sugar. The following planning information has been made available: Standard Amount per Case      Dark Chocolate      Light Chocolate      Standard Price per Pound Cocoa 12 lbs. 9 lbs. $4.20 Sugar 10 lbs. 14 lbs. 0.60 Standard labor time 0.4 hr. 0.5 hr. Dark Chocolate Light Chocolate Planned production 5,200 cases 9,900 cases Standard labor rate $13.50 per hr. $13.50 per hr. I Love My Chocolate Company...
I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and...
I Love My Chocolate Company makes dark chocolate and light chocolate. Both products require cocoa and sugar. The following planning information has been made available: Standard Amount per Case Dark Chocolate Light Chocolate Standard Price per Pound Cocoa 9 lbs. 6 lbs. $5.00 Sugar 7 lbs. 11 lbs. 0.60 Standard labor time 0.4 hr. 0.5 hr. Dark Chocolate Light Chocolate Planned production 3,800 cases 11,700 cases Standard labor rate $16.00 per hr. $16.00 per hr. I Love My Chocolate Company...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT