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
A source A producing fixed-length cells is required to use a Token Bucket Traffic Shaper (TBTS) of bucket capacity b=20 cell tok
makvit [3.9K]

Answer:

Please find the detailed answer as follows:

Explanation:

Long-term average cell rate is also called as sustained cell rate(SCR). It can be defined as the maximum average cell rate in a log time period(T).

The relation among the SCR, Average cell rate and Peak cell rate is as follows:

Avg.cell rate ≤ SCR ≤ PCR

If the source producing fixed-length cells at constant rate, then the long-term average cell rate will be same as peak cell rate(PCR).

6 0
3 years ago
What is the term for a problem in your code
Anna71 [15]

Answer:

bug

Explanation:

Bug

a problem in your code

7 0
3 years ago
Read 2 more answers
An over-target baseline (OTB) is a comprehensive rebaselining effort that is best categorized as an internal replanning effort.
masha68 [24]

Answer:

The answer is "option B".

Explanation:

An OTB stands for an over-target baseline, it is a new management benchmark when an original target can't have coincided and new goals for management purposes are required.

  • It is also known as a reference to the foundation for calculating or constructing.
  • It is an understanding between the client and the contractor that the cost base, which is not part of the original contract budget, should include an extra budget

6 0
4 years ago
Please answer in Java
ra1l [238]

Answer:

Scanner keyboard = new Scanner(System.in);

   

       

       

        double discount = 0;

        double productPrice;

        double subTotal;

        double salesTax;

        double saleTotal;

       

       

       System.out.printf("Enter the purchase amount:");

       productPrice = keyboard.nextDouble();

       

       if (productPrice > 10) {

          discount = 10;

}

       System.out.println( + discount + "% discount applied.");

       

       subTotal = (productPrice);

       salesTax = (subTotal * 0.14);

       saleTotal = (subTotal + salesTax - discount );

       System.out.printf("Subtotal: $%5.2f\n", subTotal);

       System.out.printf("Discount; -$%5.2f\n", productPrice - discount);

       System.out.printf("HST: $%5.2f\n", salesTax);

       System.out.printf("Total: $%5.2f\n", saleTotal + salesTax);

}

}

Explanation:

8 0
4 years ago
Select all examples of proper keyboarding technique. Look at the keys while keyboarding. Sit up straight. Aim to make no mistake
ANTONII [103]
Hey there, Carmen :)
When aiming to type properly, you should never look at the keys to maintain efficiency and learn how to type faster. That eliminates the first option. Next, with typing and with anything else, sitting up straight and not slouching/curving your spine is key. Posture allows you to stay focused and get things done. Additionally, aiming to make no mistakes is something you shouldn't do. We're all humans, everybody make mistakes. If you aim for perfection, you won't be able to do your best and learn from your mistakes because that's what their for. This next one is based on preference, but the proper way to do it is really to not relax your fingers, but to keep them up on the home row. Lastly, keeping your hands above your elbows while typing would really make you type slower, unless your desk is elevated.
Hope this helps!
7 0
3 years ago
Read 2 more answers
Other questions:
  • You friends parents are worried about going over their budget for the month. Which expense would you suggest is NOT a need?
    10·1 answer
  • I'll pay 50 dollars to anyone who can do this leave your snap after answering doing it and ill cash app it
    13·1 answer
  • What does the hard disk drive do?
    9·2 answers
  • While configuring a switch, you noticed a configuration issue with an Ether Channel bundle. You thought you corrected the issue,
    11·1 answer
  • Why are we not alowed to have are phones at school?
    5·2 answers
  • A technician has been asked to upgrade a processor and needs to do some research. The computer is just a couple of years old. Wh
    13·1 answer
  • Sensory cues are used for script writers to be able to get more creative with the story their are scripting for (i.e.
    15·1 answer
  • The type of line shown below represents an / a:​
    11·1 answer
  • there are these numbers that I've seen before but I don't know what they mean can someone help. I will give brainiest
    8·2 answers
  • Frequently used _____________ can be saved as _____________ for use in analysis, dashboards, reports, tickets, and alerts.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!