<jupyter_start><jupyter_text>CONTINUOUS LINEAR PROGRAMMING<jupyter_code>from pulp import *
print('Avg Growth rate of Gold in last 5 years : ', (7.27+18.83-1.15+12.57+8.63)/5.0) #https://www.macrotrends.net/1333/historical-gold-prices-100-year-chart
print('Avg Growth rate of Platinum in last 5 years : ', (-0.04+22.12-14.70+3.81+1.30)/5.0)
prob = LpProblem("Investment", LpMaximize) ## Create a LP Maximization Problem
x1 = LpVariable("x1", lowBound = 0) ## Create variable x1 >= 0
x2 = LpVariable("x2", lowBound = 0) ## Create Variable x2 >= 0

prob += 9.23*x1 + 2.49*x2 ## Objective function (increase the value of investment in 5 years)
prob += 168*x1 + 137*x2 <= 2000 ## Constraint 1 : Finishing hours less than 100

#prob += 2*x1 + 1*x2 <= 100 ## Constraint 2 : Carpentry hours less than 100
prob # Display the problem
status = prob.solve()
LpStatus[status]
print(value(x1), value(x2), value(prob.objective))
print('Value of Gold in 5 years assuming with the same growth : ', value(x1)*9.23)
print('Value of Platinum in 5 years assuming with the same growth : ', value(x2)*2.49)
print('Total Investment value : ', (value(x1)*9.23) + (value(x2)*2.49))
## Since the result is float and cant make 33.3 chairs and 33.3 tables.<jupyter_output><empty_output><jupyter_text>INTEGER LINEAR PROGRAMMING<jupyter_code>prob = LpProblem("Nirmal Chairs Ltd", LpMaximize)
x1 = LpVariable("x1", lowBound = 0, cat = 'Integer') ##cat = 'Integer' will give the integer output
x2 = LpVariable("x2", lowBound = 0, cat = 'Integer')

prob += 20*x1 + 30*x2
prob += 1*x1 + 2*x2 <= 100
prob += 2*x1 + 1*x2 <= 100
prob
status = prob.solve()
LpStatus[status]
print(value(x1), value(x2), value(prob.objective))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15393586005830903, 'fraction_numerical': 0.08571428571428572, 'mean_word_length': 5.150537634408602, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '533410', 'license': 'CC0-1.0', 'n_tokens_mistral': 733, 'n_tokens_neox': 630, 'n_words': 180, 'path': 'Model/Investment.ipynb', 'repo_name': 'Shudharsanan/Linear_Programming', 'size': '1715'}