algorithm for an optimization problem
-
The carpenter manufactures chairs and tables. He can sell them on the market, each table for Pt EUR and each chair for Pc EUR. He needs A hours and B wooden planks to produce one table and C hours and D planks for one chair. His weekly workload cannot be higher than H hours. His weekly supply for planks is S. The carpenter cannot store the planks. Help the carpenter to prepare his weekly schedule that maximizes his income. Design an algorithm that accepts A, B, C, D, H, S, Pt, Pc as an input and tells how many chairs and how many tables the carpenter should produce weekly, and what is the income assuming this production plan.
I haven't even got a clue... Can anyone please help?
-
The carpenter manufactures chairs and tables. He can sell them on the market, each table for Pt EUR and each chair for Pc EUR. He needs A hours and B wooden planks to produce one table and C hours and D planks for one chair. His weekly workload cannot be higher than H hours. His weekly supply for planks is S. The carpenter cannot store the planks. Help the carpenter to prepare his weekly schedule that maximizes his income. Design an algorithm that accepts A, B, C, D, H, S, Pt, Pc as an input and tells how many chairs and how many tables the carpenter should produce weekly, and what is the income assuming this production plan.
I haven't even got a clue... Can anyone please help?
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Try it yourself, you may find it is not as difficult as you think! If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action. Try it yourself, you may find it is not as difficult as you think! If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
of course It's just that I'm a total beginner and I just figured this might be the place to look for help. Well obviously I know it'd be best to start from inputing all the variables and then decide whether the chairs or tables are more profitable. My problem is I don't know how to decide that since there are two variables for each. Any suggestions?
-
of course It's just that I'm a total beginner and I just figured this might be the place to look for help. Well obviously I know it'd be best to start from inputing all the variables and then decide whether the chairs or tables are more profitable. My problem is I don't know how to decide that since there are two variables for each. Any suggestions?
Start by looking at how to would do it manually: get a pen and paper, and start playing with numbers. Work out how you do it yourself, and an algorithm should become apparent. Working this out is part of the task - heck, it is the task, you aren't supposed to implement it yet, if ever. It's an exercise in logical thinking and analysis, intended to start you thinking in "appropriate" ways. If you don't do it yourself, the "thought patterns" that you will use later don't start to form, and things can be a load harder later.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
-
Start by looking at how to would do it manually: get a pen and paper, and start playing with numbers. Work out how you do it yourself, and an algorithm should become apparent. Working this out is part of the task - heck, it is the task, you aren't supposed to implement it yet, if ever. It's an exercise in logical thinking and analysis, intended to start you thinking in "appropriate" ways. If you don't do it yourself, the "thought patterns" that you will use later don't start to form, and things can be a load harder later.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!
OriginalGriff wrote:
Start by looking at how to would do it manually: get a pen and paper...
I wholeheartedly agree.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
-
of course It's just that I'm a total beginner and I just figured this might be the place to look for help. Well obviously I know it'd be best to start from inputing all the variables and then decide whether the chairs or tables are more profitable. My problem is I don't know how to decide that since there are two variables for each. Any suggestions?
Wel, I agree with all the others. Every Computer Program starts with understanding the problem you are trying to resolve. This is quite fundamental! If you do not understand the problem, you will be unlikely to write a program that will resolve the issue at hand. the best start is possibly to write the question down, and in your mind break it down into the fundamental decisions program has to make. ( I have spent weeks with problems like this spinning through my head, trying to find the right approach to the problems I faced at the time) Your question although wordy is quite basic. If you can resolve it, good and well, in that case Just consider yourself happy that you are (for now) not required to recover from "Fault" conditions. If you can not, well, maybe you are not programmer material, and, you should possibly make another career choice. Regards,
Bram van Kampen
-
The carpenter manufactures chairs and tables. He can sell them on the market, each table for Pt EUR and each chair for Pc EUR. He needs A hours and B wooden planks to produce one table and C hours and D planks for one chair. His weekly workload cannot be higher than H hours. His weekly supply for planks is S. The carpenter cannot store the planks. Help the carpenter to prepare his weekly schedule that maximizes his income. Design an algorithm that accepts A, B, C, D, H, S, Pt, Pc as an input and tells how many chairs and how many tables the carpenter should produce weekly, and what is the income assuming this production plan.
I haven't even got a clue... Can anyone please help?
You could use, for instance, Lagrange Multipliers[^]. More generally you could have a look at Constrained optimization - Wikipedia[^].
-
The carpenter manufactures chairs and tables. He can sell them on the market, each table for Pt EUR and each chair for Pc EUR. He needs A hours and B wooden planks to produce one table and C hours and D planks for one chair. His weekly workload cannot be higher than H hours. His weekly supply for planks is S. The carpenter cannot store the planks. Help the carpenter to prepare his weekly schedule that maximizes his income. Design an algorithm that accepts A, B, C, D, H, S, Pt, Pc as an input and tells how many chairs and how many tables the carpenter should produce weekly, and what is the income assuming this production plan.
I haven't even got a clue... Can anyone please help?
Member 13478986 wrote:
Can anyone please help?
Start with the chair only. So A, B and H. (Ignore S) Figure that out. Then add S. After that add C and D. It might help to only do C, D, H and S first. However after you did it for A and B this should be trivial.