How to find Lagrange Multiplier word problem constraint and objective function? - calculus

What would the objective and constraint be in this word problem?
A company manufactures x units of one item and y units of another. The total cost in dollars, C, of producing these two items is approximated by the function C=6x^2+3xy+7y^2+900.
If the production quota for the total number of items (both types combined) is 220, find the minimum production cost.

Related

Optimizong billboard placement

I have a table of a 18,000 billboards with an ID, latitude, longitude, Impacts(the amount of people that see the billboard in a month).
ID
Latitude
Longitude
Impacts
1
107.45
92.45
200,000
2
102.67
96.67
180,000
3
105.12
94.23
160,000
4
106.42
91.87
220,000
5
109.89
93.56
240,000
The idea is I want to build a model that optimizes for a maximum amount of impacts, keeping a minimum distance between each billboard, for an amount of billboards chosen by the user.
I can build a matrix with the linear distances of each billboard to all the others, so basically I have the value that I want to maximize which are the impacts, a distance matrix which has linear distances between each billboard which is a constraint and the amount of billboards to select which is another constraint.
does anyone know a sort of linear programming model that I could implement for this specific case?

Fair Allocation to Buckets with Constraints

I have a vector with n prices(p1,p2,...,pn).
I want to allocate these into 3 buckets A,B,C such that the average of all the prices in each bucket is as close as possible. The constraint will be that each basket has a different number of prices put into it.
Using R I've tried to MIN the squared difference between the prices in each bucket, but I'm not getting the correct results.
Am I approaching this correctly?
So the way I approached it was I had a vector:
x<-c(50,50,50,10,20,40,50,20,4,40,20)
And I want to Minimise
A<-|(0x[0]+1x[1]+0x[2]+0x[3]....) - allocation * average price |^2
B<-|(0x[0]+1x[1]+0x[2]+0x[3]....) - allocation * average price |^2
C<-|(0x[0]+1x[1]+0x[2]+0x[3]....) - allocation * average price |^2
To get the square differences from the average
Such that each bucket is either allocated or not allocated that specific price.
The constraints would be the allocations of A, B, C would be say 10 to A 5 to B and 12 to C.

Average in Adjusted cosine Similarity

what is the denominator in average rating of a user in Adjusted cosine similarity? (Item Based Collaborative Filtering)
Is it number all Items in system?? Or Just number of rated items by user??
and
is there a function in MatLab for Adjusted Cosine?
thanks
Question 1: Is it number all Items in system?? Or Just number of rated items by
user??
Answer 1: Neither
If you see this formula:
in the denominator you need to calculate the rooted sum for each Rating of user u for item i minus the average rating of this User (mean rating) and this subtraction is squared then it is the same thing for item j which you have to multiply together.
Question 2: is there a function in MatLab for Adjusted Cosine?
Answer 2: By default no. But it should be relatively easy to write it your self given that you have the formula.

Knapsack (multi-criteria)

If I have a knapsack where weight w have two values v1 and v2 and capacity is m. How will I find the total values for v1 and v2 where the weight does not exceed capacity m?
Ok, so your problem is defined as following. First some (variable definitions with sample values):
int N = 4; // number of items to choose from
int m = 6; // maximum weight in knapsack
// weight for an item[i] to be summed up, upper limited = m
int weight[N] = {5,2,4,3};
// two values for each items:
int values[2][N] = {
{1,3,5,2},
{6,3,2,4}
};
The knapsack is to be filled with the items, without exceeding weight "m" for the sum of weight for all items in the knapsack. Where you have 2 values for each item. We could regard this problem like:
I want to go on vacation by plane with my girlfriend. And we have one suitecase (=knapsack) and N items to choose from. Each item has a weight and the sum of the weight may not be too height (e.g. weight limit air line is 25 kg and suirecase is 1kg, so we have m=24 kg as a limit for items). For each item we have 2 values. The values[1][N] are the values for me (for having item n in the knapsack on our tour). The values[2][N] are the values for my girlfriend, who has different preferences. We also assume, that every item can be put only once into the knapsack and that the overall value of the knapsack is the sum of their values for me added to the sum of their values for her.
This problem can easily converted to the standard knapsack problem by just adding up the values-list. So an item gets an overall value (e.g. for me and her together) and we only have one value for one item:
int value[N] = {(1+6),(3+3),(5+2),(2+4)};
Or just:
int value[N] = {7, 6, 7, 5};
Now you have only -one- value for each item. Which is the normal knapsack problem.
How to solve the usual knapsack problem optimally is described on Wikipedia. Have a look at http://en.wikipedia.org/wiki/Knapsack_problem -- If English is not your mother tongue, also take a look at a version in your language (choose language from the menu there).
If you need further assistance, just ask.

How to calculate average velocity for different acceleration?

I want to calculate average speed of the distance traveled using gps signals.
Is this formula calculates correct avg speed?
avgspeed = totalspeed/count
where count is the no.of gps signals.
If it is wrong,please any one tell me the correct formula.
While that should work, remember that GPS signals can be confused easily if you're in diverse terrain. Therefore, I would not use an arithmetic mean, but compute the median, so outliers (quick jumps) would not have such a big effect on the result.
From Wikipedia (n being the number of signals):
If n is odd then Median (M) = value of ((n + 1)/2)th item term.
If n is even then Median (M) = value of [((n)/2)th item term + ((n)/2
+ 1)th item term ]/2