1 / 8

Mathematical Preliminaries

Mathematical Preliminaries. The Factorial Function Permutations Logarithms Summations Recurrence Relations Algorithm Analysis. The Factorial Function. Definition: Stirling’s approximation:. Permutations. A permutation of a sequence is the members of a sequence arranged in some order.

klopp
Download Presentation

Mathematical Preliminaries

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mathematical Preliminaries • The Factorial Function • Permutations • Logarithms • Summations • Recurrence Relations • Algorithm Analysis

  2. The Factorial Function Definition: Stirling’s approximation:

  3. Permutations • A permutation of a sequence is the members of a sequence arranged in some order. • There are n! different permutations for a sequence with n distinct members. • To generate a permutation of an array:void permute(int *a, int n) { for (int i = n; i > 0; i--) swap(a[i - 1], a[random(i)]); }

  4. Logarithms

  5. Summations

  6. Recurrence Relations • For the factorial function: • For the Fibonacci sequence:

  7. Algorithm Analysis • The time T to run an algorithm as a function of n is written as T(n) • T(n) is in the set O(f(n)) if there are two positive constants c and n0 such that • If the upper bound (highest growth rate) for an algorithm is f(n) then it is in O(f(n)) in the worst case • For all inputs that are large enough, the algorithm always executes in less time than

  8. Comparison of Running Timesin Increasing Order O(1) O(log n) O(n) O(n log n) O(nc) O(cn)

More Related