Respuesta :
Answer:
Given that:
A= 40n^2
B = 2n^3
By given scenario:
40n^2=2n^3
dividing both sides by 2
20n^2=n^3
dividing both sides by n^2 we get
20 = n
Now putting n=20 in algorithms A and B:
A=40n^2
= 40 (20)^2
= 40 * (400)
A= 16000
B= 2n^3
= 2 (20)^3
= 2(8000)
B= 16000
Now as A and B got same on n = 20, then as given:
n0 <20 for n =20
Let us take n0 = 19, it will prove A is better than B.
We can also match the respective graphs of algorithms of A and B to see which one leads and which one lags, before they cross at n= 20.
Based on the calculations, algorithm A would be better than algorithms B for [tex]n\geq 21[/tex]
Given the following data:
- Number of operations A = [tex]40n^2[/tex]
- Number of operations B = [tex]2n^3[/tex]
What is an algorithm?
An algorithm refers to a standard formula (procedures) which contains a set of finite steps and instructions (operations) that must be executed while proffering solutions to a problem on a computer under appropriate conditions.
In this scenario, we would determine the point of intersection for the graphs describing the behavior of these two algorithms as follows:
[tex]A=B\\\\40n^2=2n^3\\\\[/tex]
n = 20.
Therefore, [tex]n_0=21[/tex]
Note: For all [tex]n\geq 21[/tex], algorithm A would be faster than algorithms B.
In conclusion, algorithm A would be better than algorithms B for [tex]n\geq 21[/tex]
Read more on algorithm here: brainly.com/question/24793921