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
dimaraw [331]
3 years ago
6

The running time of Algorithm A is (1/4) n2+ 1300, and the running time of another Algorithm B for solving the same problem is 1

12n − 8. Assuming all other factors equal, at what input size(s) would we prefer one algorithm to the other?
Computers and Technology
1 answer:
Mnenie [13.5K]3 years ago
8 0

Answer:

Answer is explained below

Explanation:

The running time is measured in terms of complexity classes generally expressed in an upper bound notation called the big-Oh ( "O" ) notation. We need to find the upper bound to the running time of both the algorithms and then we may compare the worst case complexities, it is also important to note that the complexity analysis holds true (and valid) for large input sizes, so, for inputs with smaller sizes, an algorithm with higher complexity class may outperform the one with lower complexity class i.e, efficiency of an algorithm may vary in cases where input sizes are smaller & more efficient algorithm might be outperformed by the lesser efficient algorithms in those cases.

That's the reason why we consider inputs of larger sizes when comparing the complexity classes of the respective algorithms under consideration.

Now coming to our question for algorithm A, we have,

let F(n) = 1/4x² + 1300

So, we can tell the upper bound to the function O(F(x)) = g(x) = x2

Also for algorithm B, we have,

let F(x) = 112x - 8

So, we can tell the upper bound to the function O(F(x)) = g(x) = x

Clearly, algorithmic complexity of algorithm A > algorithmic complexity of algorithm B

Hence we can say that for sufficiently large inputs , algorithm B will be a better choice.

Now to find the exact location of the graph in which algorithmic complexity for algorithm B becomes lesser than

algorithm A.

We need to find the intersection point of the given two equations by solving them:

We have the 2 equations as follows:

y = F(x) = 1/4x² + 1300 __(1)

y = F(X) = 112x - 8 __(2)

Let's put the value of from (2) in (1)

=> 112x - 8 = 1/4x² + 1300

=> 112x - 0.25x² = 1308

=> 0.25x² - 112x + 1308 = 0

Solving, we have

=> x = (112 ± 106) / 0.5

=> x = 436, 12

We can obtain the value for y by putting x in any of the equation:

At x=12 , y= 1336

At x = 436 , y = 48824

So we have two intersections at point (12,1336) & (436, 48824)

So before first intersection, the

Function F(x) = 112x - 8 takes lower value before x=12

& F(x) = 1/4x² + 1300 takes lower value between (12, 436)

& F(x) = 112x - 8 again takes lower value after (436,∞)

Hence,

We should choose Algorithm B for input sizes lesser than 12

& Algorithm A for input sizes between (12,436)

& Algorithm B for input sizes greater than (436,∞)

You might be interested in
In order to drive safely, you need to ___________. A. possess good vision B. look to the side while keeping your head and eyes s
Elena-2011 [213]
The question is vague, but answer B is absolutely incorrect so by default choice A is correct ...  "good" is hard to define and your vision can be corrected by glasses allowing you to drive, etc.
6 0
3 years ago
What are some of the risk associated with professional emails
noname [10]

Answer:

the answer is its a lot of riskes you would have to worry about tour email getting haacked into and lossing all of your personal information

Explanation:

5 0
3 years ago
What information does a Transform hold? (Choose all that apply)
never [62]

Answer:

Each object stores its position, orientation, and scale values.

Explanation:

5 0
3 years ago
Create a new collection class named SortedLinkedCollection that implementsa collection using a sorted linked list. Include a toS
Irina18 [472]

Answer:

Since you have not mentioned the way toString method was implemented in your class, I am just providing a sample implementation of it.

Please find the code in file attached.

Explanation:

Please see attached file.

Download txt
5 0
3 years ago
Research the history of Internet in computers<br><br>​
solniwko [45]

Answer:

This allowed different kinds of computers on different networks to "talk" to each other. ARPANET and the Defense Data Network officially changed to the TCP/IP standard on January 1, 1983, hence the birth of the Internet. All networks could now be connected by a universal language.

3 0
2 years ago
Other questions:
  • rob just got a new idea for the movie he's making, and he wants to put in late hours to get it done. Which of the following stat
    10·1 answer
  • Jenny is working on a laptop computer and notices that the computer is not running very fast. She looks and realizes that the la
    15·2 answers
  • Explain how arrays are stored in memory? Show how arr [5] is stored in the memory. Assume each memory location is one byte long
    6·1 answer
  • !WILL MARK BRAINLIEST!
    8·1 answer
  • Explain in your own words how remote-access Trojans (RATs) work. How can these be used by attackers? How would a network adminis
    10·1 answer
  • Walt has selected data in a worksheet and inserted a chart. However, the chart is inserted right on top of the data set, and he
    14·2 answers
  • Write an algorithm to show whether a given number is even or odd.
    14·1 answer
  • You manage a network that uses switches. In the lobby of your building, there are three RJ45 ports connected to a switch. You wa
    5·1 answer
  • Algorithm and flowchart to find the perimeter and area of square​
    15·1 answer
  • How can i setup a mesage room and also want to hangout ??????
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!