but then what does O(a,b,c) means
On Tue, Feb 28, 2012 at 7:30 PM, Ronan Lamy <ronan.l...@gmail.com> wrote: > Le mardi 28 février 2012 à 19:25 +0530, prateek papriwal a écrit : > > what is O notation ? > > Typing "O?" in isympy: > > Type: WithAssumptions > Base Class: <class 'sympy.core.assumptions.WithAssumptions'> > String Form:<class 'sympy.series.order.Order'> > Namespace: Interactive > File: /home/ronan/dev/sympy/sympy/series/order.py > Docstring: > Represents the limiting behavior of some function > > The order of a function characterizes the function based on the limiting > behavior of the function as it goes to some limit. Only taking the limit > point to be 0 is currently supported. This is expressed in big O > notation > [1]_. > > The formal definition for the order of a function `g(x)` about a point > `a` > is such that `g(x) = O(f(x))` as `x \rightarrow a` if and only if for > any > `\delta > 0` there exists a `M > 0` such that `|g(x)| \leq M|f(x)|` for > `|x-a| < \delta`. This is equivalent to `\lim_{x \rightarrow a} > |g(x)/f(x)| < \infty`. > > Let's illustrate it on the following example by taking the expansion of > `\sin(x)` about 0: > > .. math :: > \sin(x) = x - x^3/3! + O(x^5) > > where in this case `O(x^5) = x^5/5! - x^7/7! + \cdots`. By the > definition > of `O`, for any `\delta > 0` there is an `M` such that: > > .. math :: > |x^5/5! - x^7/7! + ....| <= M|x^5| \text{ for } |x| < \delta > > or by the alternate definition: > > .. math :: > \lim_{x \rightarrow 0} | (x^5/5! - x^7/7! + ....) / x^5| < \infty > > which surely is true, because > > .. math :: > \lim_{x \rightarrow 0} | (x^5/5! - x^7/7! + ....) / x^5| = 1/5! > > > As it is usually used, the order of a function can be intuitively > thought > of representing all terms of powers greater than the one specified. For > example, `O(x^3)` corresponds to any terms proportional to `x^3, > x^4,\ldots` and any higher power. For a polynomial, this leaves terms > proportional to `x^2`, `x` and constants. > > Examples > ======== > > >>> from sympy import O > >>> from sympy.abc import x > >>> O(x) > O(x) > >>> O(x)*x > O(x**2) > >>> O(x)-O(x) > O(x) > > References > ========== > > .. [1] `Big O notation <http://en.wikipedia.org/wiki/Big_O_notation>`_ > > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to sympy@googlegroups.com. > To unsubscribe from this group, send email to > sympy+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com. To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.