1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
wolverine [178]
2 years ago
6

Professor Gekko has always dreamed of inline skating across North Dakota. He plans to cross the state on highway U.S. 2, which r

uns 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.
a. Give an efficient algorithm by which he can determine which water stops he should make.

b. Prove that your strategy yields an optimal solution, and give its
Computers and Technology
1 answer:
geniusboy [140]2 years ago
8 0

The efficient algorithm by which he can determine which water stops he should make; <em>has been determined below and the strategy which is the greedy strategy has been proven to yield an optimal solution.</em>

<em />

To solve this question optimally, we will make use of the greedy solution.

In this method, we will maximize the distance that can be covered from a particular point in such a way that there must be a place where water can be gotten before a run out is experienced.

Now, the first point at which there will be a stop should be located at a point that is farthest from the starting position and is also made to be ≤ m miles from the starting position.

Now, this this situation is one that shows optimal substructure and since our  first stopping point will be made to be at p, it means that we are solving the sub-question with the assumption that our starting point is at p.

When we combine the two stated plans above, we will arrive at an optimal solution for the normal reasons via cut and paste.

B) Now we need to show that the greedy approach earlier used produce a first stopping point which is contained in the optimal solution.

Let O represent any optimal solution whereby the professor stops at positions o₁, o₂, o₃....oₙ.

Let h₁ represent the farthest stopping point that is reachable from the starting point. Then we can replace o₁ by h₂ to generate a modified solution H since o₁ - o₂ < o₂ - h₁.

Finally, we can really make it to the positions in H without having to run out of water and since H has the same number of stops, we can conclude that h₁   is contained in one of optimal solution.

Therefore our strategy which is the greedy strategy has been proven to work.

Read more about algorithms at; brainly.com/question/24793921

You might be interested in
If you are trying to improve your budget and spending, which option would save you the most money?
Solnce55 [7]

Explanation:

If you want to improve your budget and spending, then the best option that would save you the most money would be buying the securities for a long period of time on fixed basis. This will allow you to hold your savings with the bank, and you won't be able to take them out easily before the term period. In this way you won't think of spending that money. Also you can have an interest amount earned on these securities. In this way you can save the most money.

8 0
3 years ago
Read 2 more answers
* Declare a variablecalled "car" of type "Car", and initialise its value to a new instance of the "Car"class.
kicyunya [14]

Answer:

Car car = new Car();

Explanation:

Here we declare a variable called car which is a reference to an object of type Car.

Next we create a new object of type Car by using the new keyword. Here we are invoking no argument constructor of class Car. In case the car class has other constructors which take additional arguments, we could have initialized our object using the corresponding version of new.

The reference variable car is initialized then to the newly created object of type Car as described in the previous step. Now we can use the car reference variable to invoke relevant methods defined in the Car class.

3 0
3 years ago
The process of searching for a special pattern of symbols within a larger collection of information is called pattern ____.
tatuchka [14]

Answer:

Pattern Matching

Explanation:

Pattern matching in computer science is defined as the analysing & finding specific sequences of data of some pattern among raw data or a sequence of tokens.

4 0
3 years ago
A is a paid placement that appears in a search engines results page at or near the top of the results
densk [106]
I wish I was smarter lol
4 0
3 years ago
How to use 2 tabs at once on my Lenovo yoga book?​
svp [43]
To turn on Multi-window: Method 1: Swipe up from the bottom of Home screen to show Bottom switch, touch Multi-wins. Method 2: Tap Settings on Home screen, tap Multi-window, check Multi-window on the right.
3 0
3 years ago
Other questions:
  • What term refers to a piece of software that interfaces with the hardware on your computer?
    10·2 answers
  • What do you call the number that is used as an index to pinpoint a specific element within an array?
    14·1 answer
  • Consider this data sequence: "fish bird reptile reptile bird bird bird mammal fish". let's define a singleton to be a data eleme
    5·1 answer
  • Describe an application where a parallel circuit might work better than a series circuit.
    15·1 answer
  • A typist is entering text on keyboard at the rate of 30 words per minute. if each word is 6 characters long on average, what ban
    5·2 answers
  • It is important to verify internet source because-------- choose that apply. A.the source should be written by real author. B.an
    6·2 answers
  • If you define a destructor, are you required to define an operator '=' and a copy constructor?
    9·1 answer
  • Why media is far from government​
    6·2 answers
  • Edit the following statement so it uses the constant named YEAR:
    5·1 answer
  • What is the accurate description
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!