-3

Can someone please give the mathematical definition of f(n) and O(f(n))?

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753
kaka
  • 597
  • 3
  • 5
  • 16

1 Answers1

1

You can check this page to see a math definition of big-O notation.


Let f and g be two functions defined on some subset of the real numbers. One writes

enter image description here

if and only if there is a positive constant M such that for all sufficiently large values of x, the absolute value of f(x) is at most M multiplied by the absolute value of g(x). That is, f(x) = O(g(x)) if and only if there exists a positive real number M and a real number x0 such that

enter image description here

In many contexts, the assumption that we are interested in the growth rate as the variable x goes to infinity is left unstated, and one writes more simply that f(x) = O(g(x)).

Salvador Dali
  • 214,103
  • 147
  • 703
  • 753