Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2013-05-28 04:54:45

mom
Member
Registered: 2012-04-25
Posts: 94

find the objective function

Word problems are not my strong suite so if you could double check what I came up with it would be appreciated.

New cars are transported from docks in Baltimore and New York to dealerships in Pittsburg and Philadelphia. The dealership in Pittsburg needs 20 cars and the dealership in Philadelphia needs 15 cars. It costs $60 to transport a car from Baltimore to Pittsburgh, $45 to transport a car from Baltimore to Philadelphia, $65 to transport a car from New York to Pittsburg, and $40 to transport a car from New York to Philadelphia. There are 30 cars on the docks in Baltimore and there are 18 cars on the docks in New York. The number of cars sent from each dock to each dealership is chosen to minimize total transportation costs. If x represents the number of cars sent from Baltimore to Philadelphia and y represents the number of cars sent from New York to Pittsburgh, then what is the objective function?

What I got was 45x+65y

Is this correct or did I leave out some data that I shouldn't have?

Offline

#2 2013-05-28 05:21:17

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Hi mom;

I like it.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#3 2013-05-28 05:27:57

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

hi mom,

I've not met this sort of problem before.  Would you mind explaining how you got that?  thanks.  smile

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#4 2013-05-28 05:37:44

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Hi mom;

It looks like it is a little more complicated than what I first thought. Let me run it off and see what we get.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#5 2013-05-28 05:44:55

mom
Member
Registered: 2012-04-25
Posts: 94

Re: find the objective function

Bob,

Here is another example:

STEP 1:  decide on the objective function, this is always going to be the function that is being maximized or minimized
STEP 2:  Set up the table, this will help with writing the constraints, later
STEP 3:  Write your constraints
If you have 42 hours available for assembly and each hockey game takes 2 hours and each soccer game takes 3 hours, then 2 times the number of hockey games assembled plus 3 times the number of soccer games assembled must be less than or equal to 42:
2x + 3y < 42


I was hoping that I used the correct data for the objective function. I pulled the data below from the problem:

If x represents the number of cars sent from Baltimore to Philadelphia and y represents the number of cars sent from New York to Pittsburgh, then what is the objective function?

It costs $45 to transport a car from Baltimore to Philadelphia, and $65 to transport a car from New York to Pittsburg.

To come up with:

45x+65y

There is a lot more data in the problem but the problem specified x for cars sent from Baltimore to Philadelphia and y for cars sent from New York to Pittsburgh. Therefore, I disregarded the data that didn't relate to x and y. I am just not sure if this is actually correct.

Offline

#6 2013-05-28 05:57:54

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: find the objective function

I find that the objective function is 45x+65y+40(15-x)+60(20-y).


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#7 2013-05-28 05:58:54

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Hi mom;

That is what I thought at first too. But that has an obvious answer of zero for both.

The lowest cost is I believe,1800 and has x and y as both 0.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#8 2013-05-28 06:01:17

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

hi mom,

That example is what I call a Linear Programming Problem.  I'm OK with them.

The car transport problem is a lot more complicated.  Here's what I have done.  (note: it may all be rubbish as I've never done one of these before.)

Let z be the number of cars transported from Balt.  To Phil. and w the number from NY. to Phil.

As we want to minimise the cost, there's no point transporting more cars than necessary so

x + y = 20
z + w = 15

Then the cost equation is

60x + 65y + 45z + 40 w = 60x + 60y + 5y + 40z + 40 w + 5z = 60(x+y) + 40(z+w) + 5y + 5z = 60 x 20 + 40 x 15 + 5(y+z)

So my only chance to reduce the cost is to make y+z as small as possible.

Just looking to see if I can make it zero.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#9 2013-05-28 06:04:08

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

If y = z = 0 then

cost = 20 x 60 + 15 x 40 = 1200 + 600 = 1800.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#10 2013-05-28 06:05:21

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Constraints:
bph >= 0
np >= 0
nph >= 0
bp >= 0
0 <= bp + bph <= 30
0 <= np + nph <= 18
c < 1800,
np + bp = 20
bph + nph =15

60 bp + 45 bph + 65 np + 40 nph = cost

cost = 1800


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#11 2013-05-28 06:05:35

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: find the objective function

bob bundy wrote:

hi mom,

That example is what I call a Linear Programming Problem.  I'm OK with them.

The car transport problem is a lot more complicated.  Here's what I have done.  (note: it may all be rubbish as I've never done one of these before.)

Let z be the number of cars transported from Balt.  To Phil. and w the number from NY. to Phil.

As we want to minimise the cost, there's no point transporting more cars than necessary so

x + y = 20
z + w = 15

Then the cost equation is

60x + 65y + 45z + 40 w = 60x + 60y + 5y + 40z + 40 w + 5z = 60(x+y) + 40(z+w) + 5y + 5z = 60 x 20 + 40 x 15 + 5(y+z)

So my only chance to reduce the cost is to make y+z as small as possible.

Just looking to see if I can make it zero.

Bob

Isn't x Balt. to Phil. already?


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#12 2013-05-28 06:14:30

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

Once again you have found my error.

Back to the drawing board.  sad

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#13 2013-05-28 06:19:03

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Why are you trying to jam this into two variables?

Post #7 and post #10 are now solved by the simplex method.

If you are determined to represent this in just x and y then 0 and 0 are the obvious answers. You would naturally want to ship from the cheapest locations.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#14 2013-05-28 06:19:54

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

Revised which is x, y, z, and w.  But the simplification goes exactly the same and leads to min-cost = 1800.

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#15 2013-05-28 06:23:11

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

bobbym wrote:

Why are you trying to jam this into two variables?

Because I had my variables muddled I couldn't see how to write 'z' and 'w' in terms of x and y.  So I introduced extras.  But look on the bright side.  I got your answer.  smile  That always makes me feel good!

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#16 2013-05-28 06:30:48

mom
Member
Registered: 2012-04-25
Posts: 94

Re: find the objective function

Bob,

this problem is giving me a headache. My options are as follows:

A. -15x + 15y + 180

B. 45x + 65y

C. 105x + 105y

D. 5x + 5y + 1800

Please help

Offline

#17 2013-05-28 06:36:59

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

hi mom,

My post 8 had an error as I muddled up which one was x.  But I revised my calculation and arrived at one of the answers you have here.  So apply the method and it should work for you too.

I've got to log out now as there's a pile of washing up to do.  I'll check back when I've finished.  smile

Bob


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#18 2013-05-28 06:42:32

mom
Member
Registered: 2012-04-25
Posts: 94

Re: find the objective function

Bob,

thanks for all of your help. I got the correct answer to be 5x + 5y + 1800

It is correct. I double checked. cool

Offline

#19 2013-05-28 06:48:46

bobbym
bumpkin
From: Bumpkinland
Registered: 2009-04-12
Posts: 109,606

Re: find the objective function

Hi mom;

Actually your first answer is so good that it can be solved by inspection. No calculation at all. I am not sure that it can be done for any other problem but it works fine here.

I got your answer. That always makes me feel good!

The Russians say,"measure the cloth seven times before cutting it once." When I get the same answer he does, I recheck seven times.


In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.

Offline

#20 2013-05-28 06:57:44

Bob
Administrator
Registered: 2010-06-20
Posts: 10,619

Re: find the objective function

hi mom,

That's the answer I was hoping you'd get.  Well done!  smile

Bob

ps.  Is that all your questions sorted out?


Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei
Sometimes I deliberately make mistakes, just to test you!  …………….Bob smile

Offline

#21 2013-05-28 07:11:58

mom
Member
Registered: 2012-04-25
Posts: 94

Re: find the objective function

Thank you so much Bob!!

Offline

Board footer

Powered by FluxBB