Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are a posteriori and a priori analyses of algorithm operations?

I am a new developer. Please help me understand what a posteriori and a priori analyses of algorithm operations are. I googled it, but I did not get any proper answers.

like image 730
Ayesha Avatar asked Apr 17 '13 05:04

Ayesha


2 Answers

Apriori analysis of algorithms : it means we do analysis (space and time) of an algorithm prior to running it on specific system - that is, we determine time and space complexity of algorithm by just seeing the algorithm rather than running it on particular system (with different processor and compiler).

Apostiari analysis of algorithms : it means we do analysis of algorithm only after running it on system. It directly depends on system and changes from system to system.

In industry we cannot do Apostiari analysis as software is generally made for an anonymous user which runs it on system different (in processor like Pentium 3 or Pentium 4) from those present in the industry.

In Apriory it is the reason we use asymptotic notations to determine time and space complexity as they changes from computer to computer but asymptotically they are same.

like image 165
P.R. Avatar answered Nov 14 '22 22:11

P.R.


In short

In an priory analysis, we obtain a function which bounds the algorithm computing time.

In a posteriori analysis, we collect actual statistics about the algorithms consumption of time and space, while it is executing.

Here is the book.

Somewhat longer:

Wikipedia definition

Ans another article citation

By far the most important reason to analyze an algorithm is to make sure it will correctly solve your problem. If our algorithm doesn't work, nothing else matters. So we must analyze it to prove that it will always work as expected.

We must also look at the efficiency of our algorithm. If it solves our problem, but does so in O(nn) time (or space!), then we should probably look at a redesign.

like image 37
Roman Nikitchenko Avatar answered Nov 14 '22 22:11

Roman Nikitchenko