Forgive me if this has been answered, as my phone isn't letting me search StackOverflow. I searched Google but couldn't find any information.  I'm an aspiring programmer learning C++.  While I'm reading people's questions and such, I see the term "O(n)" releatively often.    Could anyone shed some light on this and tell me what that means?
I'd prefer as little formal definition as possible and simple mathematics.
What I am up to is to write some exercises dealing with logical formulas for my students, like:     And the students should draw these formulas on . At the end of the lesson, I really would like to print the correct answer for them. I found a great resource on a forum thread at , which helped me a lot to make up some Venn diagrams with tikz, but have some problems with visualizing complements, like ~A.  A simple, modified version of the TeX file found on the forum linked above, can be seen below, which produces the following expression:    \documentclass{letter}   \usepackage{tikz}   \def\firstcircle{(90:1.75cm) circle (2.5cm)}   \def\secondcircle{(210:1.75cm) circle (2.5cm)}   \def\thirdcircle{(330:1.75cm) circle (2.5cm)}   \begin{document}     \begin{tikzpicture}       \begin{scope}     \clip \secondcircle;     \fill[cyan] \thirdcircle;       \end{scope}       \begin{scope}     \clip \firstcircle;     \fill[cyan] \thirdcircle;       \end{scope}       \draw \firstcircle node[text=black,above] {$A$};       \draw \secondcircle node [text=black,below left] {$B$};       \draw \thirdcircle node [text=black,below right] {$C$};     \end{tikzpicture}   \end{document}   Which looks like:    Could anyone please help me out plotting/defining some expressions dealing with complements? A nice example could be:    That should look like: (image from )    I do not insist on the red color :)  I would like to use the simplest possible solution, as I would like to mass generate the exercises with the help of . So any suggestion dealing with gnuplot, R or any other opensource packages is welcome. Thank you!    UPDATE (25/01/2011): added details based on answers.  Thank you @Leo Liu, you helped me a lot! I modified a bit the code you suggested to be able to color the area outside of the two circles also (in the H universe), but have no idea how to set a background to that polygon also. The code:  \begin{tikzpicture}[fill=gray] % left hand \scope \clip (-2,-2) rectangle (2,2)       (1,0) circle (1); \fill (0,0) circle (1); \endscope % right hand \scope \clip (-2,-2) rectangle (2,2)       (0,0) circle (1); \fill (1,0) circle (1); \endscope % outline \draw (0,0) circle (1) (0,1)  node [text=black,above] {$A$}       (1,0) circle (1) (1,1)  node [text=black,above] {$B$}       (-2,-2) rectangle (3,2) node [text=black,above] {$H$}; \end{tikzpicture}   And the image generated:    I will also look for even odd rule in the near future which does not make sense for me at the moment but looks really simple and promising! GRUB Help and Reinstalling Ubuntu Recently, I installed Ubuntu 10 Netbook edition (on my netbook, yes, obvious). My battery died literally, while I was using Ubuntu.   Now, when I restart the computer, it seems that GRUB has duplicated all of the entries in the MBR that pertain to the partition that houses my Ubuntu install. For example:  Ubuntu ... Ubuntu ... (Recovery Mode) Ubuntu ... Ubuntu ... (Recovery Mode) Memtest ... Memtest ... Windows (Vista loader) Windows (Windows 7 starter loader)    When I try to access either of the two Ubuntu instances in the boot loader it presents me with an error akin to this:   ...numbers... Kernel panic ... VFS unable to mount...   What I would like to do is:  Wipe out grub, and Ubuntu, and then reinstall Ubuntu (I really only use it for emacs and ess for R so there's nothing in the home directory that I need to backup)  How would I go about "resetting" my system? Or fixing the issue that I have.   Thanks in advance!   BEB A question about causality and Quantum Field Theory from improper Lorentz transformation Related post   In Peskin and Schroeder's QFT p28, the authors tried to show causality is preserved in scalar field theory.  Consider commutator $$ [ \phi(x), \phi(y) ] = D(x-y) - D(y-x) \tag{2.53} $$ where $D(x-y)$ is the two-point correlation function,  $$D(x-y):= \langle 0 | \phi(x) \phi(y) | 0 \rangle  = \int \frac{d^3 p}{ (2\pi)^3} \frac{1}{ 2E_{\mathbf{p}}} e^{-ip(x-y)}\tag{2.50}$$  P&amp;S argued that each term in the right-hand-side of (2.53) is Lorentz invariant, since $$\int \frac{d^3p }{ (2\pi)^3} \frac{1}{2E_{\mathbf{p}}} = \int \frac{ d^4 p }{ (2\pi)^4} (2\pi) \delta(p^2-m^2)|_{p^0&gt;0} \tag{2.40}$$ is Lorentz invariant.  Since there exists a continuous Lorentz transformation in the spacelike interval $(x-y)^2&lt;0 $ such that $(x-y) \rightarrow - (x-y) $ and $D(y-x)=D(x-y)$, (2.53) equals zero in the spacelike interval. In timelike interval, since such continuous Lorentz transformation does not exist, (2.53) is non-zero in general.  My question is, consider a non-continuous Lorentz transmation in the timelike interval, $PT$, namely time reversal times parity transformation. I can also let  $(x-y) \rightarrow - (x-y) $. Why (2.53) in the timelike interval is non-zero?  I guess $PT$ will let (2.40) go to $p^0&lt;0$ branch. But I am not sure if it breaks the Lorentz invariant of (2.40) and (2.50). Compute the (multiplicative) inverse of $4x+3$ in the field $\frac {\Bbb F_{11}[x]}{\langle x^2+1 \rangle}$? So I am finding a polynomial $px+q$ ($p,q \in \Bbb F_{11}$) which is multiplicative inverse of $4x+3$ in $\frac {\Bbb F_{11}[x]}{\langle x^2+1 \rangle}$.  i.e. $[(4x+3)+\langle x^2+1 \rangle][(px+q)+\langle x^2+1 \rangle]=1+\langle x^2+1 \rangle$   $\Rightarrow$  $(4x+3)(px+q)+\langle x^2+1 \rangle=1+\langle x^2+1 \rangle$  $\Rightarrow$  $4px^2+(4q+3p)x+3q+\langle x^2+1 \rangle=1+\langle x^2+1 \rangle$.  We see that the remainder,when $(4x+3)(px+q)$ is divided by $x^2+1$, is $1$. So by Division algorithm,  $$ \require{enclose} \begin{array}{r} 4p \\[-3pt] x^2+1 \enclose{longdiv}{4px^2+(4q+3p)x+3q} \\[-3pt] \underline{4px^2+4p} \\[-3pt] (4q+3p)x+(3q-4p) \\[-3pt] \end{array} $$    So I equate $(4q+3p)x+(3q-4p)=1$ and solve the simultaneous linear equations  $4q+3p=0, 3q-4p=1$. I get $p=6,q=1$  Hence $6x+1$ is the required inverse.  I am pretty sure that the answer is correct but is the method to achieve it right? Integral $\int\frac{dy}{(y^2 + ay + b)^{3/2}}$ Need the indefinite integral with $a,b$ constants. This is not a homework question. Need it for a physics problem. Observe the following results for searching the text "dictionary" on Google:    Notice that there is a custom search box at the bottom of the listing for dictionary.reference.com. Is there any documentation floating around that explains the criterion by which Google decides to display such a search box? 'pyrcc5' is not recognized as an internal or external command I installed QGIS 3.0 on Windows 10. I get this error everytime i run the pyrcc4 or pyrcc5 command:  'pyrcc4' is not recognized as an internal or external command  Even if I find a place with a pyrcc4.exe file or a place with apyrcc5.bat file and add the path to the environment variables I get the same error. In the previous installation of osgeo4w i had a pyqtdev folder or something similar appear I think it was on C/. Was there supposed to be such a folder, do I need to download pyqt separately? How can PCB trace have 50 ohm impedance regardless of length and signal frequency? Hmm, this seems to be just another question on line impedances.  I understand that when we say "transmission line" effects we talk about things like cross talk, reflections and ringing (I guess that is just about it). These effects are not present at low frequencies where the PCB trace behaves like an "ideal" transmission medium, more like we expect a wire to behave in our early school days.  I also understand that the 50&nbsp;ohm value comes not from the line resistance which is going to be very small and less than 1&nbsp;ohm. This value comes from the ratio of L and C on the line. Changing C by changing the trace height above ground plane or changing L by changing the trace width shall change the impedance of the line.  We all know that the reactance of L and C is dependant on the signal frequency as well. Now my questions:   Why should we not call this as line reactance only rather than line impedance? How can it be just 50&nbsp;ohm? It has to be signal frequency dependent right?  E.g 50&nbsp;ohm at 1&nbsp;MHz  Will the world end if I chose to do a 100&nbsp;ohm or 25&nbsp;ohm trace instead?  I know that while we like to say 50&nbsp;ohm as a magic number, it will be within some range around 50&nbsp;ohm and not 50.0000 ohm exactly.  Is there any time when the actual resistance of a PCB trace may matter? scp copy over ssh doesn't work - permission denied error, please? Given the following image:   $\hskip{1.5 in}$   Supposing $A(100, 300)$ and $B(300, 100)$, how can I find the angle $\alpha$ between A and B?  On a side note, what's the main difference between a point and a vector? translating a point to a vector is as simple as Point = Vector? Sometimes I find articles where the terms are interchangable Are questions about (development) devices allowed on Stack Overflow? I've seen many questions on Stack Overflow asking which devices are best for developers. This made me wonder if questions asking for hardware device recommendations (best device for programming, best device within a certain budget, etc.) are on-topic for Stack Overflow, or if they should be asked somewhere else?  For Instance check these links:         etc. Is there a simple way to convert C++ enum to string? Contemporary written usage of "whom" in objective case Possible Duplicate:          I was writing a LinkedIn recommendation one day, and ended up pondering for a while which of these forms to use:     … is a great developer whom I always   found easy to work with.      … is a great developer who I always   found easy to work with.   Both are basically correct in contemporary English, right? But is one or the other preferable, and if so, why?   (In this case I went with the latter, as it seemed more common (Google)  and I wanted to avoid sounding unnecessarily “archaic”, although I’m not sure whether that would have been the case. Also note that I try to write in a “friendly professional” style instead of overly formal one. :-) I noticed that $f(x) = x\phi(x)$ seems to be one-to-one, where $\phi(x)$ is Euler's Phi function.  In particular, I'm writing some numerical python code and the line I have looks something like  sorted([n*phi(n) for n in range(1,1000)])   and there are no duplicates in the list.  First, is it one-to-one?  Second, if it is, is there a simple proof sketch? it normally shows in the bottom corner as a sort of 'pie' that fills up as the picture is downloaded, similar to the 'app downloading' pie when viewing a downloading app on the home page/s  prior to this the picture resolution is terrible How many times more than $0$? Is there a difference here:        It happened that he did not go to work today.   As it happened, he did not go to work today.      Do "it happened that" and "as it happened" have different meanings? Bibliography with Metadata: I am constructing a bibliography of as much of the prior research in a field I am working in. I would like to use BibTeX to print the citation in the pdf, and then I would like to add the details of the paper after the citation. Only then would I like to print the next citation. For example:  [1] Jahan M. Dawlaty and Yunquing Chen. Measurement of the optical absorption of graphene in the terahertz. Applied Physics Letters, 2008. Research Group: Cornell Pump Wavelength: 500 nm. Probe Wavelenth: 7 microns. Relaxation Time: 50 fs. [2] Paul George and Dmitry Vekslar, Measurement of Ultrafast Carrier Dynamics in Graphene. Applied Physics Letters, 2009.  . . . and so on. Does anyone know how this could be done? Multiple citations: citation order different to bibliography order I wish to cite several sources at once and sort my in-text citations in a different manner to how they appear in my bibliography. I want my citations to be sorted by year and my bibliography to be sorted by author. I am using BibLaTeX with Biber. I used  to achieve this with TeX Live 2015 but since upgrading to 2016 (as well as upgrading all my packages) this does not work.  Below is a minimal working example (with a second bibliography for illustrative purposes). I wish for the citations to be sorted ascending by year (2001, 2002, 2003) and the bibliographies to be sorted alphabetically (a, b, c) and descending by year (2003, 2002, 2001) respectively, but below is an image of the result; the bibliographies stay true to the desired sorting but the citations in-text are sorted descending by year.  If I remove the last \newrefcontext then everything (citations and bibliographies) is sorted alphabetically, and if I remove both \newrefcontexts then everything is sorted ascending by year (which was the option specified when originally calling BibLaTeX). It seems that the citations follow the last sorting referenced; ynt as per BibLaTeX options when both \newrefcontexts are removed or else whatever sorting is specified in the last \newrefcontext.  I am compiling in order pdflatex, biber, pdflatex, pdflatex and am on MacTeX.  It seems this would have worked as desired in TeX Live 2015 so is this a bug or has something changed which requires the citation sorting to be set in some other way?  \documentclass{article}  \usepackage[            backend=biber,            style=authoryear,            sorting=ynt,            sortcites,            ]{biblatex}  \usepackage{filecontents} \begin{filecontents}{lib.bib} @article{test1,   author = {b},   title = {b},   year=2003, } @article{test2,   author = {c},   title = {c},   year=2001, } @article{test3,   author = {a},   title = {a},   year=2002, } \end{filecontents}  \addbibresource{lib.bib}  \begin{document}      Hello World! \parencite{test1,test2,test3}      \newrefcontext[sorting=nyt]     \printbibliography      \newrefcontext[sorting=ydnt]     \printbibliography  \end{document}     Edit  I have a workaround but it's super crap: Typeset the document with global sorting=ynt, copy the pdf to another file, then typeset the document with global sorting=nyt; using a PDF editing tool (Apple's Preview suffices) cut the pages containing the bibliography with the desired sorting from one PDF and paste into the other. As I said super crap. I'm not sure if I'd even do this as I'd feel dirty, but it's a workaround nonetheless.  If a solution does not exist or this is a bug without a patch, then what would be similar but much better would be some kind of package (which probably doesn't exist) which only changes certain pages at a time within the PDF (while still actually 'compiling' the whole document so that all the citations are done). It might look something like:  % document preamble % ...  \usepackage{onlychange} \onlychangerange{10,12}  % Bibliography found on pages 10--12 % On next compilation will typeset all pages except 10--12  % ...   It's a long shot but maybe someone knows of such a package or this rambling has inspired an actual solution. When you have a link from lets say twitter that is t.co/foo that links back to your website how does that effect SEO and how do the major search engines handle Shortened URLs?