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
KonstantinChe [14]
3 years ago
13

Professor Midas drives an automobile from Newark to Reno along Interstate 80. His car’s gas tank, when full, holds enough gas

to travel n miles, and his map gives the distances between gas stations on his route. The professor wishes to make as few gas stops as possible along the way. Give an efficient method by which Professor Midas can determine at which gas stations he should stop, and prove that your strategy yields an optimal solution
Computers and Technology
1 answer:
zmey [24]3 years ago
7 0

Answer:

The GREEDY Algorithm

Explanation:

Based on the situation given in question, the Greedy algorithm shall give the optimal solution to professor

Suppose that the cities are at locations0 =x0< x1< . . . < x

We shall use the induction method to prove that G is the optimal solution valid for numbers less than n

We assume another solution Z which we initially consider to be optimum as well, based on that when Z fills the tank, it fills it to full level

Let us state the values in case of n intervals. Given below, we say that g1 is the first stop and z1 is also the first stop.

This can be written as ;

G=g1, g2, . . . , gk

Z=z1, z2, . . . , zk’

Here k’ <= k and k < n

Let I be an idex where for the first time gi is not equal to zi

Considering t= maxi Zi

Z′=g1, z2, z3, . . . , zk′

Now since z2, z3, . . . , zk′ should be an optimal stopping pattern for the problem otherwise we have chosen Z, with smaller gas filling (not feasible)

Using induction hypothesis we conclude thatg2, . . . , gk is an optimal stopping pattern, which is based on greedy algorithm

You might be interested in
Ali has created a small program in Python, but he wants to store his data in a multi-dimensional array. He would like to use adv
Dafna11 [192]

NumPy is the key scientific Python computing package. This makes things simpler to display large numbers of data in advanced maths and other operating types. These operations are typically extra efficient and less code-based than that of the built-in sequences in Python are possible, and the further discussion can be defined as follows:

  • It offers a multidimensional array object, as do variations such as masks and matrixes that can be used for different mathematical activities.
  • It is an external library of basic levels in Python used for complex mathematical procedures.
  • It has integrated functions that <em><u>convert various algorithms into arrays</u></em>.

So, the answer is "NumPy".

Learn more:

brainly.com/question/24817911

6 0
2 years ago
Your employer gives you a list of all chemicals in the entire building and the location of the SDS collection, and he asks you t
stepladder [879]
Employers should familiarize themselves with the training requirements that apply to their employees and their business; design and implement effective training programs; and use qualified trainers. In addition, employers should thoroughly document all training activities, and should retain records of employee attendance at all completed trainings. Training records should include the name of the trained employee, the date of training, the type of training and the training provider. It is a best practice for employers to keep documentation of all trainings provided to demonstrate compliance with all applicable laws and regulations.
4 0
3 years ago
Read 2 more answers
What common variation of the Server Message Block (SMB) sharing protocol is considered to be a dialect of SMB?
ser-zykov [4K]

Answer:

Common Internet File System

Explanation:

Given that the Server Message Block (SMB) has various types or variations. The most common variation of this Server Message Block sharing protocol that is considered to be a dialect of SMB is known as "Common Internet File System." This is known to serve as a form of a communication protocol for giving shared access to different outlets between nodes on a network.

Hence, in this case, the correct answer is "Common Internet File System"

8 0
2 years ago
Write a piece of codes that asks the user to enter a month (an integer), a day (another integer), and a two-digit year. The prog
Sliva [168]

Answer:

Follows are the code to this question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int day,month,year;//defining integer variable

cout<<"please enter last two digit of the year: "; //print message

cin>>year;//input year value

cout<<"enter day: "; //print message

cin>>day;//input day value

cout<<"enter month: ";//print message

cin>>month;//print month message

if(month*day==year)//check magic date condition  

{

cout<<"its magic programology year";//print message

}

else

{

cout<<"its not magic year";//print message

}

return 0;

}

Output:

please enter last two digit of the year: 98

enter day: 14

enter month: 7

its magic programology year

Explanation:

In the given code, three integer variable "day, month, and year" is declared, that uses the input method "cin" to input the value from the user-end.

In the next step, an if block statement is used that check month and day value multiple is equal to year value, if the condition is true it will print "magic programology year" otherwise it will print "not the magic year".

6 0
3 years ago
What is boot sector virus​
Galina-37 [17]

Answer:

Boot Sector virus is when a virus infects the Boot Sector of a hard disk. A Boot Sector is the initial files necessary to start an OS and other bootable programs. It is typically infected by these viruses when started with infected floppy disks, however the boot virus does not have to be successful to infect your computer. Once infected, the virus tries to infect every other disk.

Hope this helps!

4 0
1 year ago
Other questions:
  • In Florida, you can drive a motorcycle if you have a _____.
    8·1 answer
  • Două numere a și b sunt numite generatoare ale unui număr natural n dacă a∙b+[a/b]=n, unde s-a notat cu [c] partea întreagă a nu
    7·1 answer
  • Blank determines the overall brightness or darkness of an entire image
    5·1 answer
  • What inspired john logie baird to create the television?
    11·1 answer
  • We have a 16 GB main memory and 256 MB fully-associative cache, with block size of 64 bytes. We wish to store a 6 x 6 matrix in
    5·1 answer
  • What happens when a computer gets a virus?
    6·2 answers
  • Software is the word for:
    15·1 answer
  • LAB: Convert to binary - methods
    11·1 answer
  • Write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space
    13·1 answer
  • Explain the integer and float datatypes with example.<br><br>​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!