Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5995847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:01:10+00:00 2026-05-23T00:01:10+00:00

I am stumped on this homework problem. I think I have the right answer

  • 0

I am stumped on this homework problem. I think I have the right answer but am unsure how to prove it. I am also unsure of how to approach the proof. Here is the problem:

Professor Gekko has always dreamed of inline skating across North Dakota. He plans to cross the state on highway U.S. 2, which runs from Grand Forks, on the eastern border with Minnesota, to Williston, near the western border with Montana. The professor can carry two liters of water, and he can skate m miles before running out of water. (Because North Dakota is relatively flat, the professor does not have to worry about drinking water at a greater rate on uphill sections than on flat or downhill sections) The professor will start in Grand Forks with two full liters of water. His official North Dakota state map shows all the places along U.S. 2 at which he can refill his water and the distances between these locations.

The professor’s goal is to minimize the number of water stops along his route across the state. Give an efficient method by which he can determine which water stops he should make. Prove that your strategy yields an optimal solution, and give its running time.

I think he should choose his stops so that he goes the maximum distance before running out of water. That is, at every stop, if he were to keep going, he would run out of water before the next stop.

I am not sure how to proceed. I would bet that this has been done before, but I am rather new to this field of CS and could use some guidance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:01:10+00:00Added an answer on May 23, 2026 at 12:01 am

    Your algorithm is correct.

    Try to prove the following by induction on the number of stops passed. After passing each water location, no other strategy can have made fewer stops, and of those which made the same number of stops, no other strategy can leave you with more water.

    At 0 stops all strategies are equal, so it is trivial to prove the statement.

    If you don’t drink at a stop under this strategy, the result is easy to prove.

    If you do drink at a stop, from the fact that the statement was true at the previous stop, you can prove that either the other strategy made more stops last time (hence they are not ahead on stops, and can’t be ahead on water since you just got water), or else the other strategy must have likewise just got water also (else they will run out of water before the next stop).

    That is enough to fill out the induction proof.

    If you’re struggling about the concept of what is required for a formal proof, and how to do them, see How I Do Proofs. I also blogged about my experience using that handout here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This really has my stumped today. I'm sure its simple, but... Here is my
I'm completely stumped on this one. I have three different lists that need to
I have this strange call stack and I am stumped to understand why. It
I don't know if anyone has seen this issue before but I'm just stumped.
I'm admittedly a straight-C newbie, but this has got me stumped. I'm working on
I have this school assignment that I've been working on and am totally stumped
Stumped on this one. I have a many to many self referencing relationship(FluentNH) mapped
Im stumped by this simple query because its one I have not tried before.
I am stumped with this problem. ActiveSupport::JSON defines to_json on various core objects and
I have been stumped on this one for a while. I want to take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.