# [texhax] Meaning of Code frag

P. R. Stanley prstanley at ntlworld.com
Sun Feb 22 16:58:46 CET 2009

>It's a code frag taken from the Wikipedia page on the Big O notation:
http://en.wikipedia.org/wiki/Big_O_notation

>Paul:
>
> > [start code]
> > f(x)=O(g(x))\mbox{ as }x\to a
> >   if and only if there exist positive numbers d and M such that
> > |f(x)| \le \; M |g(x)|\mbox{ for }|x - a| < \delta.
> > If g(x) is non-zero for values of x
> > [end code]
> >
> > Is the | enclosing the functions used to denote order of growth?
>
>It should mean the absolute value.
>
>I tried the code chunk and it failed:
>
>\documentclass[12pt]{article}
>\begin{document}
>f(x)=O(g(x))\mbox{ as }x\to a
>   if and only if there exist positive numbers d and M such that
>|f(x)| \le \; M |g(x)|\mbox{ for }|x - a| < \delta.
>If g(x) is non-zero for values of x
>\end{document}
>
>which gave:
>
>! Missing $inserted. ><inserted text> >$
>l.3 f(x)=O(g(x))\mbox{ as }x\to
>                                 a
>?
>! Emergency stop.
><inserted text>
>                 $>l.3 f(x)=O(g(x))\mbox{ as }x\to > a >No pages of output. > >It's useful to give complete functional examples! > >Fill in the missing$ ...
>
>\documentclass[12pt]{article}
>\begin{document}
>$f(x)=O(g(x))\mbox{ as }x\to a$
>   if and only if there exist positive numbers d and M such that
>$|f(x)| \le \; M |g(x)|\mbox{ for }|x - a| < \delta$.
>If $g(x)$ is non-zero for values of $x$
>\end{document}
>
>That typesets nicely.
>
>Looks like a snip of a $\delta-\epsilon$ proof in calculus,
>not that I recall how those work anymore!
>
>Bottom line:  it is better to give complete but minimal working code
>so that others can play with it.
>
>Tom
>
>   Dr. Thomas D. Schneider
>   National Institutes of Health
>   National Cancer Institute
>   Center for Cancer Research Nanobiology Program
>   Molecular Information Theory Group
>   Frederick, Maryland  21702-1201
>   toms at ncifcrf.gov
>   permanent email: toms at alum.mit.edu
>   http://www.ccrnp.ncifcrf.gov/~toms/