Editing
Optimization Theory
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Modeling 'The Diet Problem' (Linear Programming):''' <syntaxhighlight lang="python"> def simple_optimize_profit(hours_avail, price_a, price_b, time_per_a, time_per_b): """ Max Profit = (n_a * price_a) + (n_b * price_b) Constraint: (n_a * time_per_a) + (n_b * time_per_b) <= hours_avail """ # If we only make A count_a = hours_avail // time_per_a profit_a = count_a * price_a # If we only make B count_b = hours_avail // time_per_b profit_b = count_b * price_b if profit_a > profit_b: return f"Best: Make {count_a} of A. Profit: ${profit_a}" else: return f"Best: Make {count_b} of B. Profit: ${profit_b}" # 40 hours, Product A ($50, 2h), Product B ($30, 1h) print(simple_optimize_profit(40, 50, 30, 2, 1)) # Even though A is 'more expensive', B is better because # you can make more of it in the same time. </syntaxhighlight> ; Optimization in Action : '''Logistics (The Traveling Salesman)''' β Finding the shortest route to visit 100 cities. It is a "Hard" problem that powers UPS and FedEx. : '''Portfolio Optimization''' β Choosing a mix of stocks to get the highest return for the lowest risk. : '''Backpropagation''' β The optimization algorithm that trains AI by minimizing the "Error" between the AI's guess and the truth. : '''Structural Engineering''' β Designing a bridge with the minimum amount of steel that can still support 100 tons. </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information