Now demonstrate an example of the review exercise 2: asymptotic analysis. This was how I answered the question 2 previous examination.
2. Find an asymptotic complexity function f (n) so the function g (n) defined experimentally by twelve points in the table below is $ \\ Omega f (n) $.
Justify this with a graph and discusses the quality of the elevation gained.
n | g (n) | n | g(n) | n | g(n) |
3 | 15 | 130 | 3,800 | 3,982 | 190,000 |
12 | 170 | 203 | 7,500 | 5,002 | 240,000 |
30 | 600 | 603 | 22,000 | 10,393 | 550,000 |
57 | 1,500 | 1.038 | 42.000 | 40.039 | 2,600,000 |
First notice that the first 4 data, f (n) may be n 2 because 3 2 approaches 15, 12 2 approaching 170, 30 2 approaching 600 and 57 2 1.500 approaches but in calculating the past, no: 3.982
2 = 5.002
15,856,324 2 25,020,004
= 10.393 2 = 108,014,449
40.039 2 = 1,603,121,251
As asymptotic complexity is more important to large bodies 2 n grows too fast, we'll try to function but was obviously less than n.
3.982 1.5 5.002 = 251,276.5054
= 353,765.5438
1.5 10.393 1.5
= 1,059,525.4449 40.039 1.5 = 8,011,702.8514
too, now with power 1.4:
3.982 1.4 5.002 = 109,683.6155
1.4 = 150,938.8936
10.393 1.4 40.039 = 420,181.8590
1.4
= 2,776,364.6813 Enough for me, g (n) = n 1.4 now seek a lower level.
know that a lower bound g (n) can be f (n) = log n, but not so close an 1.4, a more serious immediate n 1.35, so we'll take it and compare:
3.982 1.35
= 72,466.4013 5.002 98,592.5224 = 1.35
10.393 1.35 40.039
= 264,606.3437 1.35 = 1,634,377.4061
data are lower than 1.4 n, then f (n) = n 1.35 be our lower bound or $ \\ Omega f (n) $.
see the graph:
As you can see the red line represents our function g (n) approximately, the green lower bound f (n) and the blue the experimental data in the table. The lower bound is quite good because we did not go to log n to make it less than the linear n 1.4 1.35 but an which is just below g (n).
Finally I wish to comment on how do this post because someone could serve in the future. The powers are like that and n, is made with a tool that is already included in the blogs is called superscript and subscript and become
writing \u0026lt;sup> \u0026lt;/ sup> and
\u0026lt;sub> \u0026lt;/ sub>
respectively, while symbols such as $ \\ Omega $ are adding to the gadget blog (java code) to recognize LaTeX writing, but I already explained in this post . other hand the graph I made with a program called gnuplot download and free use, when downloading a document I include tutorial or guide to learn and use. It is a program based on command line but is very powerful.
0 comments:
Post a Comment