19

Possible Duplicate:
How to look up a math symbol?

How can I the code for "big omega", NOT \omega which is little omega. I want the symbol that's used in big-O notation.

  • 5
    You're probably looking for \mathcal{O} and/or \Omega. – Werner Oct 07 '11 at 20:20
  • 3
    To whomever down-voted the answers of Peter Grill, Werner, and myself (Mico): Would you please communicate what's so bad about answers? Enlighten us, please. – Mico Oct 07 '11 at 22:23
  • @Mico: I was wondering the same thing, especially since the OP was looking specifically for big-O notation. – Peter Grill Oct 07 '11 at 22:25
  • @Mico: Obviously, the correct answer is simply one word, "\Omega", and it was already given in Tom Bombadil's answer – the downvoted answers are just misleading. – Jukka Suomela Oct 07 '11 at 22:27
  • 3
    @JukkaSuomela: NP, but I am not 100% sure that all the OP wanted was \Omega (although that is the title). In the text he clearly indicates that he is looking for big-O notation. – Peter Grill Oct 07 '11 at 22:48
  • 1
    @PeterGrill: The terminology is a bit sloppy; people commonly refer to the "big-O notation" when they actually mean the Bachmann–Landau notation, which uses the symbols $o$, $O$, $\omega$, $\Omega$, and $\Theta$. So $\Omega$ really is the "big omega" that is used in the "big-O notation". – Jukka Suomela Oct 07 '11 at 22:56

4 Answers4

22

It's quite easy: \Omega. Also the other big letters just begin with a capital letter, e.g. \Delta, \Pi. I can also recommend DeTeXify, there you can draw something with your mouse, and and engine tries to recognize what you drew and presents some suggestions.

Tom Bombadil
  • 40,123
21

Perhaps you are looking for something like this:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\BigO}[1]{\ensuremath{\operatorname{O}\bigl(#1\bigr)}}
\begin{document}
The symbol for Big-O notation:
\BigO{n}
\end{document}

enter image description here

If you want the brackets to resize automatically you can use:

\newcommand{\BigO}[1]{\ensuremath{\operatorname{O}\left(#1\right)}}
Peter Grill
  • 223,288
  • 1
    Strange. If I use your command, the O is not typeset in italics exactly as you show in the image. I have checked both Introduction to Algorithms and The C++ Programming Language and they both typeset the big O in italics. Is it correct to typeset big O in italics? – Ali May 21 '14 at 22:44
  • @Ali: I don't know if the symbol should be in italics or not -- that is not a TeX type question. I suspect the reason yours is not in italics is due to some setup or package related issue. I would suggest you post a new question and include a MWE including \documentclass and the appropriate packages that reproduces the problem, and you can reference this question. – Peter Grill May 22 '14 at 05:53
  • There is no problem to be reproduced. The question is: Should it be typeset in italics or not? By the way, I get exactly what you got: it is not in italics and that is exactly what I see in the image in your answer. – Ali May 22 '14 at 11:55
  • This formula inserts a narrow space between O and (, which seems inconsistent with usual practice. In my own documents, I insert \! between them to close it up. – Tom Zych Dec 02 '17 at 21:06
  • @TomZych: I belive the above is correct spacing for an operator. Do you also insert a \! following \sin as well? Perhaps you should post a follow-up question as there others who are more knowledgable to answer a question about how Big-O notation should be typeset. Would be good to get a definitive answer so there can be a correct answer here. – Peter Grill Dec 04 '17 at 04:55
  • @PeterGrill I’m not sure which way is more correct, really. I have two textbooks, both about 25 years old, in which big-O is typeset in italics with a thin space after. I haven’t had a chance to check more recent printed editions yet. Online, O() without a space seems quite common. – Tom Zych Dec 04 '17 at 22:35
  • The space after O is not caused by \operatorname. Rather it is caused by using \left and \right. Therefore it should be removed. The space after \sin is only used if the operand is not in brackets. – Max Xiong Jul 17 '20 at 22:03
7

An up-front comment (not directly an answer, but I'll get to that soon): The Greek "little" o, or omicron (as opposed to the "big" o, i.e., omega), is identical in appearance -- in both its lowercase and uppercase versions -- to the Roman letters "o" and "O". Hence there are no TeX commands for $\omicron$ and $\Omicron$.

To denote the asymptotic order of magnitudes "little-oh" and "big-Oh", respectively, one frequently encounters $o$ and $O$ (i.e., using TeX's math-italics font) and -- for big-Oh only -- $\mathcal{O}$. Most math fonts (including Computer/Latin Modern) do not have lowercase mathcal letters, therefore one generally does not see $\mathcal{o}$ for "little-oh".

Incidentally, the mtpro2 package -- when loaded with the mtpcal option -- does have a symbol for $\mathcal{o}$. Unfortunately, the package is not free, but its cost (for noncommercial licenses) is very reasonable. The first line in the image below shows the results of $o$ and $O$, and the second line shows the results of $\mathcal{o}$ and $\mathcal{O}$ commands produced with the mtpro2 package loaded.

enter image description here

Finally, I must confess that I have not yet seen the symbol $\Omega$ (uppercase-Omega) used in asymptotic "big-Oh" notation, but that may be just be a consequence of my lack of erudition.

Mico
  • 506,678
  • 4
    $\Omega$ is used for lower bounds. E.g. all comparison sorts run in Omega(n log n) time – kahen Oct 07 '11 at 22:08
3

Add

\newcommand{\bigO}{\ensuremath{\mathcal{O}}}% big-O notation/symbol

to your document (preamble) and then you can use \bigO. If you want to use \Omega instead to represent your biig-O notation, then add

\newcommand{\bigO}{\ensuremath{\Omega}}% big-O notation/symbol

instead.

Werner
  • 603,163