Wednesday, February 2, 2011

assignment number 2

EMPERICAL ANALYSIS

As what i have search about the Empirical Analysis , I can only find samples of it but no specific meaning. Then I decide that just read the example given. Ive notice that Empirical Analysis is like an experiment or sometimes, it is a result of an observation and I think I'm right because according to Sir. W Hamilton [1913 Webster] -"the term empirical means simply what belongs to or is the product of experience or observation. ". Base on my reading, Empirical Analysis is all about what you have realize or learned base from your experiment or observation. Its like making a theory that you need to prove the you are right and for that, you need to experiment , observe, analyze and apply. When making Empirical Analysis, just expect that the new idea will be created and the new knowledge will be earned.

            ANALYSIS OF ALGORITHM

            We all know that Algorithm Analysis is the one who study about algorithm and according to what I've read , Analysis algorithm is a computer field that deals about the algorithm and understand the complexity of an algorithm. According to the article and base from my own understanding about that reading, we need to know how to analyze the algorithm so that we will know how much source is needed when it is executed. Algorithm will compute and estimate the shortest way in solving a specific problem and if you have a good algorithm, you can solve problem quickly but we need to remember always that in algorithm, we need to have the aspect of correctness and fast execution.
Sometimes algorithm failed when it comes to large input.

          One article that catches my attention is about the student  of Charles E. Leiserson. He taped the whole discussion and posted it in the need but unfortunately I don't have my headphone. He wrote there the important highlight about the lecture. C harles is one of the most popular author about algorithm. He started at  the state and theoretical study of algorithm.  He emphasize that in algorithm, performance is not always important. we need also to consider 

modularity,
correctness,
maintainability,
security,
functionality,
robustness,
user-friendliness,
programmer's time,
simplicity,
extensibility,
reliability, and
scalability.

And I really agree with his statement. For me, the Analysis of Algorithm is one of the most important components in building a better programmer because algorithm will define the quality of your work and the quality of your learning and somehow, am a little bit more interested about the topic and I want to know more.

            BIG-O NOTATION

Base on my reading, big o notation give information to the use by comparing two algorithms. It tells us about what will happen if we do some arrangement about our algorithm. It well tells us about the speed of execution that will result to the slower or higher speed of an algorithm run time.

According to my source, big o notations have functions.

1. O(1)-constant time
   -it requires a fixed number of steps and ignores the length like the push and pop in the link list.
2. O(n)-linear time
  -unlike O (1), O (n) requires a number of steps like traversing the link list until end.
3. O(n^2) - quadratic time
 -This is referring to the proportion of the size of n operator like the 2 dimensional arrays.
4. O(log n) - logarithmic time
-inserting or removing a binary node or searching fir a specific node.
5. O(n log n) - "n log n " time
-sorting algorithm and faster than O(log n).
6. O(a^n) (a > 1) - exponential time
-recursion algorithm like Fibonacci

Implementation

Suppose we have this code fragment

{
{Your statement......}                                                   O (1)

           
            for (;;)//loop statement
            {
                        {Statement}                                         O (n)
                        {Perform another loop}                        O (n^2)
            }

The execution time of this is 1+n+n^2=n2;




No comments:

Post a Comment