Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please finish question c Mary Startupperberg is travelling to meet an important investor. The investor is available all day, so Mary can choose any time

image text in transcribed

please finish question c

Mary Startupperberg is travelling to meet an important investor. The investor is available all day, so Mary can choose any time to meet. The train takes 2 hours and the earliest Mary could return would be 2 hours after she arrives, althouglh she can stay longer if it is cheaper to return later. The train fares are contained in the arrays Out and Rtn, both of length N, such that Outli] and Rtnlil are the fares for the ith outbound and return trains respectively, which both depart at the same time. There is one train per hour in both directions, so the first possibility is to take the first outbound train and the fifth return train. Mary wants to find the lowest total fare she can pay. c Explain how to decompose this problem into N subproblems. Your answer should say what the subproblems are (what a solution to a subproblem means), how they can be solved, and how they combine to give the overall solution. i) Can the problem be solved using dynamic programming? Explain your answer with reference to your decomposition of the problem. ii) ii) Write a procedure that solves the problem. Your procedure should iterate through the input data at most once The three parts carry, respectively, 30%, 25%, and 45% of the marks. Mary Startupperberg is travelling to meet an important investor. The investor is available all day, so Mary can choose any time to meet. The train takes 2 hours and the earliest Mary could return would be 2 hours after she arrives, althouglh she can stay longer if it is cheaper to return later. The train fares are contained in the arrays Out and Rtn, both of length N, such that Outli] and Rtnlil are the fares for the ith outbound and return trains respectively, which both depart at the same time. There is one train per hour in both directions, so the first possibility is to take the first outbound train and the fifth return train. Mary wants to find the lowest total fare she can pay. c Explain how to decompose this problem into N subproblems. Your answer should say what the subproblems are (what a solution to a subproblem means), how they can be solved, and how they combine to give the overall solution. i) Can the problem be solved using dynamic programming? Explain your answer with reference to your decomposition of the problem. ii) ii) Write a procedure that solves the problem. Your procedure should iterate through the input data at most once The three parts carry, respectively, 30%, 25%, and 45% of the marks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions