In this problem, you’ll use brute force search to find an optimal answer. Suppose you’ve been
tasked to design a normal, rectangular building, unlike Luddy, that has a loss of heat given by:
f(x, y, z) = 11xy + 14yz + 15xz
where the variables x, y, z are the three dimensions. We want to have a building with minimalheat loss. Suppose the volume of the building is 147,840ft3 ; in other words:
xyz = 147840
Although we can solve this using calculus, we prefer search! We want to find values for each
variable from zero to 100 inclusive that minimizes the heat loss that equals the volume. So your
function will find x, y, z where f(x, y, z) is a minimum and equal to the building size.
def vol(x,y,z):
return x*y*z == 147840
def f(x,y,z):
# TODO: for a single value of x, y, z, caluclate the value of function "f"
pass
if __name__ == "main":
#some arbitrary starting point
a,b,c = 1,1,1
# TODO: LOOPS SEARCHING THROUGH all possible
#VALUES KEEPING MINIMUM
# HINT: There should be no print statements in the for loops
# Do not remove these statements
print("Smallest dimension possible")
print("H W L Value")
print(a,b,c,f(a,b,c))
In Python Brute Force Search
The Output needs to be this:
H W L Value
56 60 44 110880
I have updated the f(x,y,z) function and also the loop to find out the minimum value.
def vol(x,y,z):
return x*y*z == 147840
def f(x,y,z):
# TODO: for a single value of x, y, z, caluclate the value of
function "f"
return 11*x*y+14*y*z+15*x*z
pass
if __name__ == "main":
#some arbitrary starting point
a,b,c = 1,1,1
# TODO: LOOPS SEARCHING THROUGH all possible
hl=1000000
for i in range(100):
for j in range(100):
for k in range(100):
if vol(i,j,k):
temp=f(i,j,k)
if temp < hl :
a=i
b=j
c=k
#VALUES KEEPING MINIMUM
# HINT: There should be no print statements in the for loops
# Do not remove these statements
print("Smallest dimension possible")
print("H W L Value")
print(a,b,c,f(a,b,c))
//Kindly Upvote the
answer if it helps to solve your query and comment to ask if you
have any queries regarding the solution or
approach.
In this problem, you’ll use brute force search to find an optimal answer. Suppose you’ve been...
could use some help on this one, thanks in advance i will rate Suppose that R is the finite region bounded by )v and f(a) Find the exact value of the volume of the object we obtain when rotating R about the x-axis. Preview Find the exact value of the volume of the object we obtain when rotating R about the y-axis. Preview License Points possible: 1 Unlimited attempts. Message instructor about this question Submit Suppose that R is the...
Question #1 (15 Marks) a) (8 Marks) Answer the following questions with True or False. 1) 2) 3) Every basic solution in the assignment problem is necessarily degenerate. The assignment problem cannot be solved using the transportation technique. If the gradient vector of a function at a given point is zero, the point can only be a maximum or minimum. If a single-variable function has two local minima, it must have at least one local 4) maximum 5) The Golden...
How to solve #7 Suppose that /(x,y)=(x+y2)3. Find s. and at the port az) , supportait atturbanco nennt.yoy, tindhaw.th.he%.anda 7. in a certain suburban community, commuters have the choice of geting into the ity by bus or train. The demand for these modes of transportation variles with their cost Let /(P.,P) be the number of people who will take the train when p, i the price of the bus ride and py is the price of the train ride. Would...
Python Help Please! This is a problem that I have been stuck on.I am only suppose to use the basic python coding principles, including for loops, if statements, elif statements, lists, counters, functions, nested statements, .read, .write, while, local variables or global variables, etc. Thank you! I am using python 3.4.1. ***( The bottom photo is a continuation of the first one)**** Problem statement For this program, you are to design and implement text search engine, similar to the one...
how to make my code of python work probely my q is how to write a code to find the average actual water level, average error by using python and my program should be flexible where user can select the column no. If you can see in the main program, it asked which column to know the maximum or average, the column number is passed to the function. The function should look which column to do. #THIS PROGRAMMING IS ABLE...
I am programing an Extended Kalman Filter , with noise but not getting correct answer . this is my code # ---------- # Part Two # # Now we'll make the scenario a bit more realistic. Now Traxbot's # sensor measurements are a bit noisy (though its motions are still # completetly noise-free and it still moves in an almost-circle). # You'll have to write a function that takes as input the next # noisy (x, y) sensor measurement and...
Question 2: Finding the best Scrabble word with Recursion using java Scrabble is a game in which players construct words from random letters, building on words already played. Each letter has an associated point value and the aim is to collect more points than your opponent. Please see https: //en.wikipedia.org/wiki/Scrabble for an overview if you are unfamiliar with the game. You will write a program that allows a user to enter 7 letters (representing the letter tiles they hold), plus...
please use python and provide run result, thank you! click on pic to make it bigger For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...
Nombre . Responde las siguientes preguntas A) SI P(A 6 B)-1/3 P(B)- 1/4 y P(Ay B)-1/5, halle P(A) B ) Cual es la probabilidad de lanzar un par de dados y que la suma de los resultados de los dos dados sea 7 C ) Una prueba de selección múltiple tiene cinco posibles respuestas de las cuales una es correcta, si 13 estudiantes eligen las respuestas al azar. Cuaál es la probabilidad de que los 13 escojan la respuesta correcta?...