120 likes | 256 Views
Definitions of Algorithmic Terms And Formulas. (Hopefully). Sigma. n. }. j = x. j=2. Programming Example. Definition. Mathematical Example. Loop. Starting value for j. for (j=2; j++; j < n) { x=j+x; }. j increases by 1 each iteration. Limit at n.
E N D
Definitions of Algorithmic Terms And Formulas (Hopefully)
n } j = x j=2 Programming Example Definition Mathematical Example Loop Starting value for j for (j=2; j++; j<n) { x=j+x; } j increases by 1 each iteration Limit at n Add to the total each iteration Final Sum
n } j = x j=2 Now we will swap normal j here For aj
n } aj = x j=2 Now we will swap normal j here For aj
n The only change in the programming example is an extra calculation which is caused by the aj in the mathematical equation. } aj = x j=2 The aj in the equation basically states that when we are on the j th iteration of the loop what is the value of a. The programming example can, but does not have to include j in the a= statement. Programming Example Definition Mathematical Example for (j=2; j++; j<n) { a=2j; x=a+x; }
(g(n)) = { f(n) : there exist psitive constants c1, c2, and n0such that 0 < c1g(n) < f(n) < c2g(n) for all n > n0 }. Graph example of -notation Mathematical definition
(g(n)) = { f(n) : there exist psitive constants c1, c2, and n0such that 0 < c1g(n) < f(n) < c2g(n) for all n > n0 }. This is the number of inputs. This simply creates a relationship between g, f, n, c1, and c2. These two functions create the appropriate time relationship between the number of inputs and the final running time. The two can, but do not have to be different yet they must include all the information about the computer the algorithm is running on and the time per calculations.
(g(n)) = { f(n) : there exist psitive constants c1, c2, and n0such that 0 < c1g(n) < f(n) < c2g(n) for all n > n0 }. creates the relationship listed here so that the g(n)