Questions tagged [notation]

Use this tag whenever you have a question about what some particular symbol/notation means.

199 questions
48
votes
10 answers

O(·) is not a function, so how can a function be equal to it?

I totally understand what big $O$ notation means. My issue is when we say $T(n)=O(f(n))$ , where $T(n)$ is running time of an algorithm on input of size $n$. I understand semantics of it. But $T(n)$ and $O(f(n))$ are two different things. $T(n)$ is…
doubleE
  • 591
  • 1
  • 4
  • 8
47
votes
2 answers

Order of growth definition from Reynolds & Tymann

I am reading a book called Principles of Computer Science (2008), by Carl Reynolds and Paul Tymann (published by Schaum's Outlines). The second chapter introduces algorithms with an example of a sequential search which simply iterates through a list…
JW.
  • 581
  • 4
  • 7
41
votes
4 answers

What is the name the class of functions described by O(n log n)?

In "Big O", common notations have common names (instead of saying, "Oh of some constant factor"): O(1) is "Constant" O(log n) is "Logarithmic" O(n) is "Linear" O(n^2) is "Quadratic" O(n * log n) is ??? Is it just "n log n" or does it have a special…
GlenPeterson
  • 545
  • 1
  • 4
  • 10
26
votes
3 answers

Is there any reason why the modulo operator is denoted as %?

I would like to know if there is any reason why many programming languages use the notation % for the modulo operator? It is used in the most "famous" languages: C C++ C# Go Java Julia Lua Perl Python
zdm
  • 1,056
  • 9
  • 15
22
votes
3 answers

What is the purpose of using NIL for representing null nodes?

In my Algorithms and Data Structures course, professors, slides and the book (Introduction to Algorithms, 3rd edition) have been using the word NIL to denote for example a child of a node (in a tree) that does not exist. Once, during a lecture,…
user20691
20
votes
1 answer

Can a Big-Oh time complexity contain more than one variable?

Let us say for instance I am doing string processing that requires some analysis of two strings. I have no given information about what their lengths might end up being, so they come from two distinct families. Would it be acceptable to call the…
corsiKa
  • 423
  • 1
  • 3
  • 11
19
votes
2 answers

What is this fraction-like "discrete mathematics"–style notation used for formal rules?

In the paper "A Conflict-Free Replicated JSON Datatype", I encountered this notation for formally defining "rules": What is this notation called? How do I read it? For example: the DOC rule doesn't have anything in its "numerator" — why not? the…
17
votes
2 answers

What is the origin of λ for empty string?

I usually use the symbol $\varepsilon$ for empty string (empty word or null string). But I know some people use $\lambda$ instead of $\varepsilon$. I think $\varepsilon$ is derived from the word "Empty". However I don't know what's the origin of…
14
votes
5 answers

What is the difference between $\log^2(n)$, $\log(n)^2$, $(\log n)^2$, $\log (n^2)$ and $\log \log n$?

In research articles (e.g. this one's abstract), I often see the complexity of an algorithm expressed using a somewhat ambiguous notation: $\log^2(n) = ?$ $\log(n)^2 = ?$ $(\log n)^2 = (\log(n)) \times (\log(n))$ $\log(n^2) =…
Suzanne Soy
  • 251
  • 1
  • 2
  • 5
12
votes
3 answers

Is Big-Theta a more accurate description of worst case run time than Big-O?

Question I was asked: Does it make a difference if I say "The worst case run time is $O(n^2)$ vs the worst case run time is $\Theta(n^2)$?" To me, the only difference is that when we say $O(n^2)$, the function may also be $O(n)$, we do not know. But…
9
votes
1 answer

What does up arrow ($\uparrow$) mean in pseudocode?

I'm learning vantage point trees, and I met this while reading the paper Data Structures and Algorithms for Nearest Neighbor Search in General Metric Spaces by Peter Yianilos (Proceedings of SODA 1993, SIAM, pages 311–321; PDF). The following…
QhelDIV
  • 93
  • 4
8
votes
2 answers

Double exponentials vs single exponentials

Here are four tenets I cannot reconcile: Double exponential time algorithms run in $O(2^{2^{n^k}})$ time with $k \in \mathbb{N}$ constant Exponential time algorithms run in $O(2^{n^k})$ with $k \in \mathbb{N}$ constant The former bound grows…
badroit
  • 727
  • 4
  • 14
8
votes
4 answers

Arrow notation?

can someone explain what the following notation is? For j <- 1 to n Legal <- True I've seen these in various places, including wikipedia articles. It seems to be a specific notation, but I don't know the name and can't find much of anything on…
Daniel
  • 200
  • 1
  • 7
7
votes
3 answers

Help understand the notation

I'm reading a computer science paper, this one: https://arxiv.org/abs/1608.03960. It uses certain notation in one of the illustrations (Figure 9, page 8 in the PDF version) that I don't understand how to interpret. Attaching here as well for better…
Haspemulator
  • 173
  • 5
7
votes
1 answer

type theory notation troubles

I'm working through "Types and Programming Languages" by Benjamin Pierce and I don't quite understand the notation. Particularly on Page 106, (chapter 9 Simply Typed Lambda-Calculus) there is a lemma (9.3.7): $$ \text{If } \Gamma \vdash t:T \text{…
1
2 3
13 14