title: Big O notation author: Keith A. Lewis institution: KALX, LLC email: [email protected] classoption: fleqn abstract: Back of the envelope calculations. ...
\newcommand\mb[1]{\boldsymbol{#1}} \newcommand\bm[1]{\boldsymbol{#1}} \newcommand\RR{\bm{R}} \newcommand\FF{\bm{F}} \newcommand\NN{\bm{N}} \newcommand\LL{\mathcal{L}} \newcommand\BB{\mathcal{B}} \newcommand\ran{\operatorname{ran}} \renewcommand\ker{\operatorname{ker}} \newcommand\span{\operatorname{span}}
The expression
Exercise. Show $f(n) = O(n)$ implies $c + f(n) = O(n)$ for any constant $c$.
Hint. If
Exercise. Show $f(n) = O(n)$ implies $cf(n) = O(n)$ for any constant $c$.
Hint. If
The "big O" notation is an abuse of the equal sign. For example
We can similarly define
Exercise Show if $f_1\in O(g_1)$ and $f_2\in O(g_2)$ then $f_1 + f_2\in O(g_1 + g_2)$ and $f_1f_2\in O(g_1g_2)$.
Computers compute things that take time and space in memory. Time is usually measured by the number of machine instructions needed for an algorithm. Some algorithms can be run in parallel and the time can be divided by the number of processors available. Space cannot be subdivided but it can be distributed across multiple storage devices. The CAP theorem proves limitations on the Consistency, Availability, and Partition tolerance.
A distributed system is a system where I can’t get my work done because a computer has failed that I’ve never even heard of. -- Leslie Lamport
Big O notation is a useful way to express rough estimates. It can help identify when a potential solution to a complicated problem is not feasible by writing on the back of an envelope.