What is the meaning of $O(m+n)$?

Question: This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I keep seeing this notation, especially when discussing graph algorithms. For example, you routinely see: $O(|V| + |E|)$ (e.g. see here).
Comment: maybe $m$ depends on $n$
Answer: You are right. Notice that the term $O(n+m)$ slightly abuses the classical big-O Notation, which is defined for functions in one variable. However there is a natural extension for multiple variables.
Simply speaking, since
$$ \frac{1}{2}(m+n) \le \max\{m,n\} \le m+n \le 2 \max\{m,n\},$$
you can deduce that $O(n+m)$ and $O(\max\{m,n\})$ are equivalent asymptotic upper bounds.
On the other hand  $O(n+m)$ is different from $O(\min\{n,m\})$, since if you set $n=2^m$, you get $$O(2^m+m)=O(2^m) \supsetneq O(m)=O(\min\{2^m,m\}).$$
Comment: As a follow-up to my above comment, the recent article [A general definition of the O-notation for algorithm analysis](http://arxiv.org/abs/1309.3210) by K. Rutanen (2015) *does* show how to define meaningful O-notation for general sets, including $\mathbb{N}^2$.
Comment: I think it's noteworthy that they write in the abstract, "We show that it is impossible to define big-O notation for functions on more than one variable in a way that implies the properties commonly used in algorithm analysis. We also demonstrate that common definitions do not imply these properties even if the functions within the big-O notation are restricted to being strictly nondecreasing".
Answer: Believe it or not, it seems (in my experience) that many algorithms people have actually not thought about what the big O notation formally means, and when asked about it, you can get several different answers. Some issues are discussed in the paper On Asymptotic Notation with Multiple Variables by Rodney R. Howell.
Curiously, it also seems that most introductory algorithms courses spend lots of time being very formal about big O notation with a single variable, and then the next weeks happily use the notation for graph algorithms with several variables in a casual way, without discussing what the notation actually means.
Comment: @Raphael: The answer is not meant as a rant, but maybe it could have been phrased more precisely. The thing is, the question is basically, what is the meaning of big O with more than one parameter. The answer is, that it should mean whatever there is consensus about in the algorithms community, what is being taught in algorithms courses, etc. My point is, that there is seemingly not such a consensus about what the notation precisely means.
Comment: @A.Schulz: Indeed, I was typing my answer simultaneously to you.
Comment: I am a proponent of being careful with Landau terms so I agree, but this contains too much rant for a good answer.
Comment: The link in my answer refers to the article of Howell, which is indeed a nice treatment on this question.
Answer: Part 1
I'm going to do something I decided I wouldn't do: try to nutshell my research on this topic. I'll go over on how the algorithmic O-notation must be defined, why it is probably not what you've been taught, and what other misconceptions float around this topic. I wrote this in the form of an imaginary discussion.
The following discussion is based on the following papers:

O-notation in algorithm analysis, Doctoral Thesis, Tampere University of Technology, volume 1427, October 2016. This is my doctoral thesis. Among other things, it shows that there is exactly one definition of O-notation suitable for algorithm analysis.
Minimal characterization of O-notation in algorithm analysis, Theoretical Computer Science, Volume 713, pp. 31–41, February 2018. This is a follow-up to the thesis. It shows that the primitive properties provided in the thesis are not minimal, but if you remove locality, then they are.
A general definition of O-notation for algorithm analysis, Bulletin of EATCS 117, October 2015. This is the first publication on the topic. It is subsumed by the thesis.

Notation
We will the use the following notation:
$$
\newcommand{\TR}{\mathbb{R}}
\newcommand{\TN}{\mathbb{N}}
\newcommand{\subsets}[1]{\mathcal{P}(#1)}
\newcommand{\setb}[1]{\left\{#1\right\}}
\newcommand{\land}{\text{ and }}
\begin{aligned}
& \text{Symbol} && \text{Meaning} && \text{Example} \\
& \text{  } && \text{  } && \text{  } \\
& \TN && \text{Natural numbers} && 0, 1, 2, 3, \dots \\
& \TR && \text{Real numbers} && -3, 0, 1.5, \pi, \dots \\
& X \to Y && \text{Functions from set X to set Y} && \TR \to \TR \\
& \subsets{X} && \text{Subsets of set X} && \subsets{\setb{0, 1}} = \setb{\emptyset, \setb{0}, \setb{1}, \setb{0, 1}} \\
& R_X && \text{Cost functions in set X} && X \to \TR^{\geq 0} \\
& f|A && \text{Restriction of function f to set A}
\end{aligned}
$$
Cost-functions
A cost-function in a set $X$ is an element of the set
$$
R_X = X \to \TR^{\geq 0},
$$
the set of all functions from $X$ to non-negative real numbers. Consider an algorithm whose input-set is $X$. The resource-consumption of that algorithm, for a given resource, is a function $f \in R_X$, where $f(x)$ returns the amount of resources the algorithm spends on input $x \in X$.
For example, a graph algorithm may take a graph over a set $V$ as an input. Then the input-set $X$ is the set of all graphs over $V$, and $f(x)$ is the amount of resources the algorithm spends on graph $x \in X$.
Shouldn't the parameter of a cost-function be an input-size?
No. Input-size does not make sense as a general concept. The mapping from the input-set is the most detailed characterization of the resourse-consumption of an algorithm.
How do you obtain cost-functions?
To obtain a cost-function of an algorithm, you specify the model of computation --- e.g. an abstract state machine together with its atomic instructions --- and assign the atomic instructions their cost-functions. These atomic cost-functions imply a cost-function for each algorithm as a sum of the cost-functions of the instructions that are executed for a given input.
By assigning the atomic cost-functions, you are making a decision on what to measure. You may first analyze a specific resource, and later change the atomic cost-functions when you want to measure something else. Note that 0 is also a valid cost for a given input.
How do you work with cost-functions?
Let $f, g \in R_X$, and $c \in \TR^{> 0}$. We will be writing things such as $g \leq c f$. But what does this mean?
If $\ominus : \TR^{\geq 0} \to \TR^{\geq 0}$ is a unary function, we lift it to $R_X$ by
$$(\ominus f)(x) = \ominus f(x).$$
If $\odot : \TR^{\geq 0} \times \TR^{\geq 0} \to \TR^{\geq 0}$ is a binary function, we lift it to $R_X$ by
$$(f \odot g)(x) = \odot(f(x), g(x)) = f(x) \odot g(x).$$
If $\mathord{\sim} \subset \TR^{\geq 0} \times \TR^{\geq 0}$ is a relation in $\TR^{\geq 0}$, we lift it to $R_X$ by
$$f \sim g \iff \forall x \in X: f(x) \sim g(x).$$
To summarize, operations on $\TR^{\geq 0}$ are lifted to $R_X$ elementwise. We then have
$$f \leq c g \iff \forall x \in X : f(x) \leq c g(x).$$
How do you work with sets of cost-functions?
Let $F, G \subset R_X$. We lift the operations on $\TR^{\geq 0}$ to $\subsets{R_X}$ by
$$
\begin{aligned}
\ominus F & = \setb{\ominus f : f \in F}, \\
F \odot G & = \setb{f \odot g : f \in F \land g \in G}. \\
\end{aligned}
$$
Algorithmic O-notation
The algorithmic O-notation is the proper class of functions
$$O = \setb{O_X : R_X \to \subsets{R_X} : X \text{ is a set}},$$
where
$$O_X(f) = \setb{g \in R_X : \exists c \in \TR^{> 0} : g \leq c f}.$$
For the expression inside the set-builder notation, we say that $g$ is linearly dominated by $f$, or $f$ linearly dominates $g$. Correspondingly, algorithmic O-notation is also called linear dominance.
There is a separate $O_X$ for each input-set $X$?
Yes. And all of these infinite number of set-specific O-notations must be consistent with each other. The O-notation is the proper class of those set-specific O-notations, not just one specific $O_X$ for a single set $X$. Also, the domain-set $X$ is important; remove it and you may end up in incorrect conclusions because of confusing your domain.
This is not what I've been taught?
The books and courses are currently using an incorrect formalization of algorithmic O-notation; give it some time.
What do you mean by incorrect formalization?
In the same way that iceskaters have a strong idea about what iceskating should look like, computer scientists have a strong idea about what algorithmic O-notation should look like.
Current formalizations of algorithmic O-notation in books and courses conflict with that idea.
Can you give a concrete example of this?
Let
$$\mathcal{F} = \setb{\setb{x \in \TN^2 : x \geq x_0} : x_0 \in \TN^2}$$
Introduction to Algorithms, 2nd. ed, page 50, formalizes O-notation in $\TN^2$ as:
$$
f \in O'_{\TN^2}(g) \iff \exists c \in \TR^{>0}, \exists A \in \mathcal{F}: f|A \leq c(g|A).
$$
Let $f \in R_{\TN}$ be an arbitrary cost-function. Suppose $G : \TN^2 \to \TN$ is an algorithm with cost-function $g \in R_{\TN^2}$ such that $g(x, 0) = f(x)$, and $g(x, y) = 0$ when $y > 0$. Then $g \in O'_{\TN^2}(0)$; seems like a cheap algorithm to call. Create an algorithm $F: \TN \to \TN$ which computes $F(x) = G(x, 0)$ by calling $G$. Then $F$ has cost-function $f$. Hence, the O-set of $g$ does not tell you anything about how costly it is to call $G$.
How do you know that a formalization captures the idea of O-notation?
When the O-notation is formalized as linear dominance, you have a simple way to check whether a function is in an O-set. However, from this form it is hard to see whether it captures the right idea. Simply picking some version of local linear dominance as formalization is just guessing.
The solution is to approach formalization from a different viewpoint: simply write down the rules how you expect O-notation to work, and see what you get. A natural way to do this is to provide a set of equations which describe how O-notation preserves structure (see the cheat-sheet below).
After this is done, those equations are then up to discussion for the community: do they really capture the right idea? To facilitate this discussion, the equation-set is best made minimal, so that there are no redundant equations. For example, the cheat-sheet below is very redundant. However, they contain an equivalent minimal subset of 6 equations. Linear dominance falls out naturally from this equation-set. I'll come back to this.
Isn't some kind of asymptotic behavior essential to O-notation?
No. It is the scale-invariance ($c$) which in some cases allows to ignore a finite number of elements in the domain.
Isn't the O-notation used in mathematics defined differently?
Yes. There are multiple different concepts of O-notation, and each is used in a different context and different purpose. Most of them are a version of local linear dominance which we will come back to later. The O-notations most often seen in mathematics (e.g. series, approximation, convergence) localize to the neighorhoods of a single point, or to the neighborhoods of infinity. We concentrate on the algorithmic O-notation, which is used to analyze algorithms, and which does not use any localization. This is because in the context of algorithm analysis, every part of a cost-function is important!
Basic usage
Can I write $O_{\TN}(n^2)$?
Yes. It is clear what the implied function is.
Can I write $O(n^2)$?
No. It is not clear what the implied function is, because the domain is not known. For example, it could be any subset of integers, or even a subset of $\TN^2$. The domain matters.
Can I write $O_{\TN^2}(nm^2)$?
Yes, but with caution. In particular, you must first define an implicit ordering for the parameters; say an alphabetical order. Then $nm^2$ stands for $f \in R_{N^2}$ such that $f(m, n) = nm^2$, rather than $f(n, m) = nm^2$. These functions are different.
Can I write $O_{\TN^2}(n^2)$?
No. It is not clear whether $n$ refers to the first argument or the second argument. This case can be disambiguated by $O_{\TN^2}((m, n) \mapsto n^2)$.
Is $O_{\TN^2}((m, n) \mapsto n^2) = O_{\TN}(n^2)$?
No; the functions have different domains.
How do I use the O-notation?
Use the following cheat-sheet for the O-notation. It's like the rules for differentiation; you strive to develop a sufficiently large rule-set to avoid needing to use the definition directly ever again. Suppose $X$, $Y$, and $Z$ are sets, $\alpha, \beta \in \TR^{> 0}$, $f, g, u, v \in R_X$, $s : Y \to X$, and $C \subset \subsets{X}$ is a finite cover of $X$.
$$
\begin{aligned}
& \text{Property} && \text{Definition} \\
& \text{  } && \text{  } \\
& \text{Order-consistency} && f \leq g \implies f \in O_X(g) \\
& \text{Reflexivity} && f \in O_X(f) \\
& \text{Transitivity} && (f \in O_X(g) \land g \in O_X(h)) \implies f \in O_X(h) \\
& \text{Orderness} && f \in O_X(g) \iff O_X(f) \subset O_X(g) \\
& \text{Zero-separation} && 1 \not\in O_{\TN^{>0}}(0) \\
& \text{One-separation} && n \not\in O_{\TN^{>0}}(1) \\
& \text{Zero-triviality} && O_X(0) = \setb{0} \\
& \text{Scale-invariance} && O_X(\alpha f) = O_X(f) \\
& \text{Bounded translation invariance} && O_X(f + \beta + \alpha) = O_X(f + \beta) \\
& \text{Power-homogeneity} && O_X(f)^{\alpha} = O_X(f^{\alpha}) \\
& \text{Additive consistency} && u O_X(f) + v O_X(f) = (u + v)O_X(f) \\
& \text{Multiplicative consistency} && O_X(f)^u O_X(f)^v = O_X(f)^{u + v} \\
& \text{Locality} && (\forall D \in C : (f|D) \in O_D(g|D)) \implies f \in O_X(g) \\
& \text{Scalar homogeneity} && \alpha O_X(f) = O_X(\alpha f) \\
& \text{Homogeneity} && u O_X(f) = O_X(u f) \\
& \text{Multiplicativity} && O_X(f) O_X(g) = O_X(fg) \\
& \text{Restrictability} && O_X(f)|D = O_D(f|D) \\
& \text{Additivity} && O_X(f) + O_X(g) = O_X(f + g) \\
& \text{Summation rule} && O_X(f + g) = O_X(\max(f, g)) \\
& \text{Maximum rule} && \max(O_X(f), O_X(g)) = O_X(\max(f, g)) \\
& \text{Maximum-sum rule} && \max(O_X(f), O_X(g)) = O_X(f) + O_X(g) \\
& \text{Sub-composability} && O_X(f) \circ s \subset O_Y(f \circ s) \\
& \text{Injective super-composability} && O_X(f) \circ s \supset O_Y(f \circ s) (s \text{ injective})
\end{aligned}
$$
Shouldn't translation invariance hold also when $\beta = 0$?
No. Otherwise it would be possible for a cost-function $f \in R_X$ with $f(x) = 0$ for some $x \in X$ to be equivalent to another cost-function $f' \in R_X$ with $f'(x) \neq 0$. For example, we would have $O(1) = O(0)$ which are fundamentally different classes of cost-functions.
Why would this formalization be correct?
Perhaps because you can prove that the algorithmic O-notation is exactly the proper class of functions $\setb{O_X : R_X \to \subsets{R_X} : X \text{ is a set}}$ which satisfy the following properties:

Order-consistency
Transitivity
One-separation
Scale-invariance
Sub-composability
Sub-homogeneity (it's the same as homogeneity but with $\subset$ rather than $=$)

Questioning the validity of the formalization is equivalent to questioning the validity of these properties. Let's go over them.
The first two properties --- order-consistency and transitivity --- state that $f \in O_X(g)$ is a preorder relation which is consistent with pointwise comparison. One-separation says that not every function can be equivalent. Scale-invariance is the very reason you are defining the O-notation in the first place; acceleration by a constant is algorithmically boring. No-one probably objects to these; they are at the core of any formalization of O-notation in any context.
The last two --- sub-composability and sub-homogeneity --- are what makes this O-notation algorithmic. Sub-composability says that the O-notation preserves composition, which means that things still work even if you refactor a part of your algorithm to a sub-algorithm. Sub-homogeneity says that the O-notation preserves repetition, which means that things still work even if you repeat things in a loop.
Anything else to say about those properties?
There are no other formalizations of O-notation which satisfy the listed properties; algorithmic O-notation is uniquely defined. It can also be proved that the property-set above is minimal; for any of these properties, there exists an "O-notation" which breaks exactly that property and satisfies the others. Since the algorithmic O-notation satisfies these properties, they are not inconsistent either.
Any other ways to characterize linear dominance?
Linear dominance is the only formalization of O-notation which has the property that the following two modes of analysis always produce the same result:

Carry out the cost-analysis exactly by performing a sequence of structure-preserving operations on cost-functions. Then compute the O-set of the final result. Matrix algorithms are often analyzed this way.
Compute the O-sets of the atomic cost-functions, and carry out the cost-analysis of an algorithm purely in terms of O-sets, performing exactly the same operations to the O-sets as in the exact case. This is the usual way of analyzing algorithms.

Given any other formalization, it is possible to construct an instance of analysis where the two modes do not produce the same result.
Related notations
The related notations are
$$
\begin{aligned}
o_X(f) & = \setb{g \in R_X : g \in O_X(f) \land f \not\in O_X(g)}, \\
\Omega_X(f) & = \setb{g \in R_X : f \in O_X(g) }, \\
\omega_X(f) & = \setb{g \in R_X : f \in O_X(g) \land g \not\in O_X(f)}, \\
\Theta_X(f) & = \setb{g \in R_X : g \in O_X(f) \land f \in O_X(g)}.
\end{aligned}
$$
Notice how the O-notation determines them all.
How do I use the related notations?
Convert back and forth between the O-notation and them using the above definitions, and derive analogous cheat-sheets for them. Left as an exercise!
Limit form
The notations can also be given in the following limit form. Let
$$
\begin{aligned}
F & = \setb{x \in X : f(x) > 0}, \\
G & = \setb{x \in X : g(x) > 0}.
\end{aligned}
$$
Then
$$
\begin{aligned}
f \in O_X(g) & \iff \sup \frac{f|F}{g|F} < \infty, \\
f \in o_X(g) & \iff \sup \frac{f|F}{g|F} < \infty \land \inf \frac{f|G}{g|G} = 0, \\
f \in \Omega_X(g) & \iff \inf \frac{f|G}{g|G} > 0, \\
f \in \omega_X(g) & \iff \inf \frac{f|G}{g|G} > 0 \land \sup \frac{f|F}{g|F} = \infty, \\
f \in \Theta_X(g) & \iff \sup \frac{f|F}{g|F} < \infty \land \inf \frac{f|G}{g|G} > 0.
\end{aligned}
$$
Here we use the convention that $x/0 = \infty$ for each $x \in \TR^{> 0}$. The restrictions are needed to avoid the case $0/0$.
Where is the limit in that?
I'll get back to this.
The definitions for $o$ and $\omega$ do not look familiar?
The formalizations of the $\omega$ and $o$-notations are also currently incorrect in books and courses; any other choice than the above is inconsistent with the O-notation.
This sufficient condition for $o$ might look more familiar:
$$
\begin{aligned}
{} & \forall c \in \TR^{>0}: f \leq cg \\
\iff & \sup \frac{f|F}{g|F} = 0 \\
\implies & f \in o_X(g).
\end{aligned}
$$
Similarly for $\omega$:
$$
\begin{aligned}
{} & \forall c \in \TR^{>0}: g \leq cf \\
\iff & \inf \frac{f|G}{g|G} = \infty \\
\implies & f \in \omega_X(g).
\end{aligned}
$$
Preorders
Let
$$f \preceq_X g \iff f \in O_X(g).$$
Then $\preceq_X$ is a preorder in $R_X$; i.e. a reflexive and transitive relation in $R_X$. A preorder generalizes a partial order in that there can be multiple elements equivalent to each other. The notations then become
$$O_X(f) = \setb{g \in R_X : g \preceq_X f },$$
$$o_X(f) = \setb{g \in R_X : g \prec_X f },$$
$$\Omega_X(f) = \setb{g \in R_X : g \succeq_X f },$$
$$\omega_X(f) = \setb{g \in R_X : g \succ_X f },$$
$$\Theta_X(f) = \setb{g \in R_X : g \approx_X f }.$$
That is, we may as well define the O-notation in a set $X$ as a preorder.
I've seen this analogue before!
Right, but it is not merely an analogue; it is an exact correspondence; an alternative view. It is possible to go back and reframe all of the discussion this far in terms of preorders, rather than O-notation. In terms of the preorders, $O_X(f)$ is a principal down-set of $\preceq_X$. Conversion of the cheat-sheet to preorder-form is left as an exercise.
Perhaps non-principal down-sets of $\preceq_X$ are relevant too?
That's right. I'll get back to this.
Worst/best/average case analysis
A grouping of set $X$ is a function $g : X \to Z$, where $Z$ is a set. For example, if your input-set $X$ is the set of all graphs over set $V$, you may take a function $g : X \to \TN^2$ which maps each graph $x \in X$ to a pair of integers $(n, m) \in \TN^2$, denoting the number of vertices and edges in that graph.
Why is it called a grouping?
The preimage $g^{-1}(\setb{z})$, where $z \in g(X)$, gives all the input-elements $x \in X$ which $g$ maps to the same property $z$; these preimages partition, or group, the input-set $X$. For the graph grouping example, $g^{-1}(\setb{(n, m)})$ gives all the graphs with $n$ vertices and $m$ edges.
Shouldn't a grouping be defined as surjective?
You could do that, but that definition would be harder to use (in my opinion). For example, in the graph grouping example, I could simply map to $\TN^2$, even if the graph-set does not contain graphs with all combinations of vertices and edges.
What is an extended cost-function?
An extended cost-function in a set $X$ is an element of $R^{\infty}_X = X \to (\TR^{\geq 0} \cup \setb{\infty})$.
What is worst-case analysis?
A worst-case analysis of $f \in R_X$ over a grouping $g : X \to Z$ is the study of $f^* \in R^{\infty}_{g(X)}$ such that $f^*(z) = \sup f(g^{-1}(\setb{z}))$, or some $O$-set which contains it.
What is a case?
A case over a grouping $g : X \to Z$ is a right-inverse of $g$. That is, a function $s : g(X) \to X$ such that $g \circ s = id_{g(X)}$.
What is a worst case?
A case $s : g(X) \to X$ over a grouping $g : X \to Z$ is called worst of $f \in R_X$, if
$$(f \circ s)(z) = \sup f(g^{-1}(\setb{z})).$$
A worst case may not exist. If it does though, then the worst-case analysis of $f$ over $g$ is essentially about studying the cost-function of an auxiliary algorithm which, given $(n, m)$, forwards the worst case $s(n, m)$ to the original algorithm.
For the graph grouping example, the worst case of $f$ over $g$ exists because the preimages (groups) are finite (assuming finite $V$).
What is best-case analysis and a best case?
The terms best-case analysis, and best case, are defined otherwise exactly as the worst case, but supremum is replaced with infimum, and $O$-set is replaced with $\Omega$-set.
What is average-case analysis?
Left as an exercise:p
Due to character count limitation, we'll continue in another answer...
Comment: @D.W. Thanks for the feedback! I replaced definition with formalization and added some discussion about that.
Comment: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/117768/discussion-between-mo-b-and-kaba).
Comment: Thanks for this detailed exposition!  I imagine that took a lot of work to write out, and I'm finding it helpful to learn about it!  A nitpick: "The books and courses are currently using an incorrect definition." - I don't think a definition can be incorrect.  It might be more useful or less useful, or a good idea or a bad idea, but I don't know what it would mean to call a definition incorrect.  Perhaps it's possible to make a more precise statement about what you mean?
Comment: Sorry, I don't think that addresses the point.  I think that has the same problem.  In what sense do you claim that the textbook formulation is "incorrect"?  Your formulation might have important advantages, but that doesn't mean the standard one is "incorrect".  There are no accepted criteria for what would count as "correct" or "incorrect" here.
Comment: As a concrete example, take Introduction to Algorithms, 2nd. ed. (!), page 50. Then you can show that there exists an unbounded constant-complexity cost-function over $\mathbb{N}^2$, which is to say that that constant-complexity doesn't guarantee you anything. More formally, notice that linear dominance is equivalent to the minimal set of 6 properties. Hence, given any other formalization, you'll break one of these 6 properties. If you accept that the 6 properties correctly capture what algorithmic O-notation means, then you also have to accept that the other formalizations are incorrect.
Comment: I added a concrete example of incorrectness for the formalization given in Introduction to Algorithms, 2nd ed.
Comment: Fascinating, great answer! I have a few comments/questions: (1) in your example of an incorrect formalization, shouldn't it read "g|A <= c(f|A)"? (2) Do I understand it correctly that with your formalization, f(n) = n+1 would not be in O(n²)? (Omitting the O-subscript for brevity.) (3) The Wikipedia article cites the definition from Cormen et al., ed. 3, which is subtly different from the definition from ed. 2 that you cite. It seems that your counter example doesn't work in that case. But which of the 6 essential properties would you lose with that definition (ed. 3)?
Comment: Yep, f and g were swapped in multiple places; I tried to fixed them. Well spotted!
Comment: Whether $n + 1 \in O_X(n^2)$ depends on the set $X$. If $X$ is say non-negative integers, then the expression is false. If $X$ is positive integers, then the expression is true.
Comment: Indeed, Cormen et al 3rd ed. contains another definition which I call "coasymptotic". When restricted to subsets of $\mathbb{N}^d$, it is equivalent to cofinite linear dominance (cofinite filter sets), and hence is equal to linear dominance on positive functions (as explained in Part 2). On general sets, all three are different.
Comment: Coasymptotic linear dominance fails several properties. Appendix G in my linked thesis is dedicated to the question of which notations fail which properties. Of particular interest is the table on page 155. From left to right, the notations are linear (algorithmic), cofinite (cofinite filter sets), coasymptotic (like Cormen et al. 3rd ed.), asymptotic (like Cormen et al. 2nd ed.), and affine (like algorithmic but with additional offset).
Comment: Aside, it may be interesting to look at theorem D.41 on page 123 in thesis which shows that linear dominance is the only non-trivial version of local linear dominance which satisfies subcomposability. It is like a lite version of the general uniqueness theorem.
Comment: Also aside, the counter-example can be generalized to any local linear dominance which has at least one filter-set which misses an infinite set.
Comment: @kaba Thanks for the answers, really interesting! As a practitioner, I like the simplicity of your definition, which gets rid of the tedious $\exists n_0 \forall n > n_0 ...$. I am a bit concerned about $n+1 \notin O_{\mathbb{N_0}}(n^2)$ since that seems a breaking change even in the univariate case. In the analysis of algorithms, you often have $T(0) = 1$ as base case for a recurrence relation, so the domain includes 0, and the value at 0 is greater than 0. All the "old" results would no longer hold. Instead, we'd have to write stuff like $O(n^2 + 1)$. Do you have any comment on this issue?
Comment: @kaba Another question I have is what kind of feedback/criticism have you received so far from the academic community. My impression as a working programmer is that the univariate case works fine so far, but the multivariate case is a mess. Any chance to convince the "mainstream" (e.g. Wikipedia) to adopt your version?
Answer: Part 2
$$
\newcommand{\TR}{\mathbb{R}}
\newcommand{\TN}{\mathbb{N}}
\newcommand{\subsets}[1]{\mathcal{P}(#1)}
\newcommand{\setb}[1]{\left\{#1\right\}}
\newcommand{\land}{\text{ and }}
$$
Algorithms
Are there cases where existing intuition on O-notation may not hold?
You may find that your existing intuition does not hold when the input-set is something else than a subset of $\TN^d$; say, a subset of $\TR^d$ instead. A cost-function can then be unbounded in a bounded set. However, if you keep modifying the O-notation in terms of the rules given in the cheat-sheet, you'll be fine.
Why would I use real numbers as inputs to my algorithms?
Hopefully because it is natural to your problem domain. Algorithms are not limited to those which a Turing machine can run. To truly understand what an algorithm is, you need to look at abstract state machines.
What do you mean "truly understand"?
I'll use an analogy.
Topology (continuous functions, limits, open sets, etc.) can be studied at various levels, starting from $\TR$, to $\TR^d$, to metric spaces and to topological spaces. At each level, the next level of abstraction subsumes the results from the previous level of abstraction without changing the flavor of the topic. The definition of a topological space is so simple that it is hard to imagine there being a more generalized structure for studying topology. Although I cannot claim that topological spaces encapsulate the "most abstract" version of topology, the more abstract and simpler the structure, the closer you are to truly understanding topology. That's because then you cannot rely on various other properties that happen to hold in your specific space.
Abstract state machines are to algorithms as topological spaces are to topology. Turing machines (and equivalents) encapsulate only a small subset of all algorithms.
Why would I be interested in algorithms which can never be implemented on actual computers?
Look at any book on computational geometry (which deals with problems such as finding a convex hull of points, or triangulation of a polygon). Those algorithms are defined in terms of real numbers (a large part of geometry can be said to study subsets of $\TR^d$). While real-world computers do not work with real numbers, it does not make these algorithms useless. They do encapsulate practical ideas. It is simply that, by the real number abstraction, you get to concentrate on what is essential, instead of getting bogged down to the details of floating point numbers. While it is an essential problem that the floating point numbers do not work like real numbers, that problem can now be dealt with separately.
Newton's method is also an algorithm under abstract state machines. And it takes as input a differentiable function, which is even more abstract than just real numbers. Want to approximate that algorithm in real-world computers stably using floating point numbers? Welcome to numerical mathematics.
The same thing can be said about matrix decompositions. Here too you want to separate the algorithm of, say, LU-decomposition, from how it can be implemented stably numerically.
Master theorems
Master theorems are a collection of theorems which provide a shortcut for computing the O-set (or related notation) of a cost-function of certain kinds of recursive algorithms.
Do Master theorems work for the algorithmic O-notation?
Yes. With the welcome change that you no longer need to care about "regularity" properties, which you may have seen. Things just work.
Master theorem over integers
Let $a \in \TR^{\geq 1}$, $b \in \TR^{\geq 2}$, $d \in \TR^{> 0}$, and $F \in R_{\TN^{\geq 1}}$. A Master function over integers is a function $T \in R_{\TN^{\geq 1}}$ defined by the recurrence equation
$$
T(n) =
\begin{cases}
a T(\lceil n/b \rceil) + F(n), & n \geq b, \\
d, & n < b.
\end{cases}
$$
The set of such functions is denoted by $M_I(a, b, d, F)$.
Theorem
Let $T \in M_I(a, b, d, F)$, and $F \in O_{\TN^{\geq 1}}(n^c)$, where $c \in R^{\geq 0}$. Then
$$
\begin{aligned}
\log_b(a) < c & \implies T \in O_{\TN^{\geq 1}}(n^c), \\
\log_b(a) = c & \implies T \in O_{\TN^{\geq 1}}(n^c \log_b(bn)), \\
\log_b(a) > c & \implies T \in O_{\TN^{\geq 1}}(n^{\log_b(a)}).
\end{aligned}
$$
If $F \in \Theta_{\TN^{\geq 1}}(n^c)$, then each $O_{\TN^{\geq 1}}$ can be replaced with $\Theta_{\TN^{\geq 1}}$.
Master theorem over reals
Let $a \in \TR^{\geq 1}$, $b \in \TR^{> 1}$, $d \in \TR^{> 0}$, and $f \in R_{\TR^{\geq 1}}$. A Master function over reals is a function $t \in R_{\TR^{\geq 1}}$ defined by the recurrence equation
$$
t(x) =
\begin{cases}
a t(x / b) + f(x), & x \geq b, \\
d, & x < b.
\end{cases}
$$
The set of such functions is denoted by $M_R(a, b, d, f)$.
Theorem
Let $T \in M_R(a, b, d, f)$, and $f \in O_{\TR^{\geq 1}}(x^c)$, where $c \in \TR^{\geq 0}$. Then
$$
\begin{aligned}
\log_b(a) < c & \implies t \in O_{\TR^{\geq 1}}(x^c), \\
\log_b(a) = c & \implies t \in O_{\TR^{\geq 1}}(x^c \log_b(bx)), \\
\log_b(a) > c & \implies t \in O_{\TR^{\geq 1}}(x^{\log_b(a)}).
\end{aligned}
$$
If $F \in \Theta_{\TR^{\geq 1}}(x^c)$, then each $O_{\TR^{\geq 1}}$ can be replaced with $\Theta_{\TR^{\geq 1}}$.
Local linear dominance
What is a filter basis?
A filter basis in a set $X$ is set of subsets $\mathcal{F} \subset \subsets{X}$ such that for each $A, B \in \mathcal{F}$ there exists $C \in \mathcal{F}$ such that $C \subset A \cap B$. A filter basis is the smallest amount of information you need to be able to make sense of limits, or more generally of limit inferior and limit superior. Let $f \in R_X$. Then
$$\limsup_{\mathcal{F}} f = \inf \setb{\sup f(A) : A \in \mathcal{F}},$$
$$\liminf_{\mathcal{F}} f = \sup \setb{\inf f(A) : A \in \mathcal{F}}.$$
Note that $\liminf$ and $\limsup$ always exist as numbers in $\TR^{\geq 0} \cup \setb{\infty}$, since $\inf$ and $\sup$ do by the completeness of $\TR^{\geq 0} \cup \setb{\infty}$. This is in contrast to the concept of a limit $\lim$, which is the number that is equal to both $\liminf$ and $\limsup$. Because of this conditional existence, limits are less useful for the current discussion.
What is local linear dominance?
Let $\mathcal{F}(X) \subset \subsets{X}$ be a filter basis for each set $X$. Suppose further that these filter bases are related by
$$\mathcal{F}(X') = \setb{F \cap X' : F \in \mathcal{F}}$$
for each $X' \subset X$. Then $\mathcal{F}$-local linear dominance is given by
$$O_X^{\mathcal{F}}(f) = \setb{g \in R_X : \exists c \in \TR^{> 0}, A \in \mathcal{F}(X) : (g|A) \leq c (f|A) }.$$
Local linear dominance has the same related notations as linear dominance, defined analogously.
How is linear dominance related to local linear dominance?
Linear dominance is $\mathcal{F}$-local linear dominance when $\mathcal{F}(X) = \setb{X}$ for each set $X$.
Limit forms
Local linear dominance can also be given in the following limit form. Let
$$
\begin{aligned}
F & = \setb{x \in X : f(x) > 0}, \\
G & = \setb{x \in X : g(x) > 0}.
\end{aligned}
$$
Then
$$
\begin{aligned}
f \in O^{\mathcal{F}}_X(g) & \iff \limsup_{\mathcal{F}(F)} \frac{f|F}{g|F} < \infty, \\
f \in o^{\mathcal{F}}_X(g) & \iff \limsup_{\mathcal{F}(F)} \frac{f|F}{g|F} < \infty \land \liminf_{\mathcal{F}(G)} \frac{f|G}{g|G} = 0, \\
f \in \Omega^{\mathcal{F}}_X(g) & \iff \liminf_{\mathcal{F}(G)} \frac{f|G}{g|G} > 0, \\
f \in \omega^{\mathcal{F}}_X(g) & \iff \liminf_{\mathcal{F}(G)} \frac{f|G}{g|G} > 0 \land \limsup_{\mathcal{F}(F)} \frac{f|F}{g|F} = \infty, \\
f \in \Theta^{\mathcal{F}}_X(g) & \iff \limsup_{\mathcal{F}(F)} \frac{f|F}{g|F} < \infty \land \liminf_{\mathcal{F}(G)} \frac{f|G}{g|G} > 0.
\end{aligned}
$$
For linear dominance, limit inferior and limit superior reduce to infimum and supremum, respectively. This explains the name of the limit form we used previously for linear dominance.
Definitions of $o$ and $\omega$ do not look familiar?
This sufficient condition for $o$ might look more familiar:
$$
\begin{aligned}
{} & \forall c \in \TR^{>0}: \exists A \in \mathcal{F}(X): (f|A) \leq c(g|A) \\
\iff & \limsup_{\mathcal{F}(F)} \frac{f|F}{g|F} = 0 \\
\implies & f \in o^{\mathcal{F}}_X(g).
\end{aligned}
$$
Similarly for $\omega$:
$$
\begin{aligned}
{} & \forall c \in \TR^{>0}: \exists A \in \mathcal{F}(X): (g|A) \leq c(f|A) \\
\iff & \liminf_{\mathcal{F}(G)} \frac{f|G}{g|G} = \infty \\
\implies & f \in \omega^{\mathcal{F}}_X(g).
\end{aligned}
$$
The $o^{\mathcal{F}}$ and $\omega^{\mathcal{F}}$ notations (in $X = \TN$) have been defined in books and courses this way, however, as definitions they are incorrect in the sense that they do not quite represent the strict versions of $O^{\mathcal{F}}$ and $\Omega^{\mathcal{F}}$.
Can I use local linear dominance to analyze algorithms?
No; simply because if I say anything else I'll be interpreted incorrectly. At any time during your analysis, you are to remain in the realms of the algorithmic $O$-notation.
After that disclaimer, a careful yes. Some versions of local linear dominance, under suitable conditions, imply linear dominance. In particular, this is the case when the cost-functions are positive and the filter-sets are cofinite. After checking that such conditions hold, you may use local linear dominance (e.g. limit forms) to deduce containment in linear dominance $O$-set. Note the difference in mind-set; local linear dominances are tools which you may or may not be able to apply in your specific case, and those tools are only meant to help you deduce containment of a function $g \in R_X$ in $O_X(f)$, not to be used in analysis themselves.
Can you give an example of that?
Particularly interesting for this discussion is the filter basis
$$\mathcal{F}(X) = \setb{X \setminus X^{< n} : n \in \TN},$$
whenever $X \subset \TN^d$ for some $d \in \TN$. In the thesis, I call the corresponding local linear dominance coasymptotic (although I'm not too happy about that name). The sets in these filter bases are cofinite. Especially the case $d = 1$ should look familiar; then $X \setminus X^{< n} = X^{\geq n}$.
Let $f \in R_{\TN^{>0}}$ be such that
$$f(n) = n^2 \lvert\sin(n)\rvert + n + 3.$$
Since $f > 0$, and
$$\limsup_{\mathcal{F}(\TN^{>0})} \frac{f(n)}{n^2} = 1 < \infty,$$
we have that $f \in O_{\TN^{>0}}^{\mathcal{F}}(n^2)$. Since the filter-sets are cofinite and $n^2 > 0$, we have that $f \in O_{\TN^{>0}}(n^2)$. The potential payoff here was that we got to compute the limit rather than finding a suitable $c \in \TR^{>0}$ for linear dominance. Here we used local linear dominance as a tool to deduce $f \in O_{\TN^{>0}}(n^2)$.
How would you have done that directly?
Perhaps like this:
$$n^2 \lvert\sin(n)\rvert + n + 3 \leq n^2 + n^2 + 3n^2 = 5n^2.$$
Well, not particularly hard either. Perhaps someone could find an example where finding $c$ is hard but computing the limit is easy?
Why did you study local linear dominance?
Three reasons.
First, in analogue to software development, they were my unit tests. If linear dominance really is the only suitable algorithmic O-notation, then any other candidate should fail in some way. I wanted to see exactly which properties each definition failed.
Second, as already discussed, they can sometimes by used as tool to deduce containment in an $O$-set.
Third, some of them are needed to show the minimality of the property-set I gave above.
Anything else about local linear dominance?
Local linear dominance can be generalized to cost-functions which are eventually non-negative, meaning $f : X \to \TR$ for which there exists $A \in \mathcal{F}(X)$ such that $f\|A \geq 0$. In the case of linear dominance, eventually non-negative functions are exactly the cost-functions (which are non-negative), so this generalization does not bring us anything new.
Multivariate notation
It seems we now also have a multivariate algorithmic O-notation?
If by multivariate you mean an algoritmic O-notation on the domain $\TN^d$, then yes, O-notation is also defined on that set, as it is in any set.
But I read a paper which proves that there cannot exist a multivariate algorithmic O-notation?
You are referring to

On Asymptotic Notation with Multiple Variables, Rodney R. Howell, Technical Report 2007-4, 2008.

The content in that paper is fine, but its conclusion is incorrect. The abstract properties of O-notation given in that paper, together with scale-invariance, are in fact equivalent to asymptotic linear dominance (local linear dominance on $\TN^d$ where the filter-sets are of the form $x \geq n$). Hence, the paper only shows that asymptotic linear dominance is not suitable as an algorithmic O-notation, not that there cannot be any suitable definition of an algoritmic O-notation.
Algorithmic O-notation revisited
The O-notation is actually a bit more general than how I defined it at the beginning. Some people use expressions such as $2^{O_{\TN}(n)}$, and we need to resolve what that means.
How is the algorithmic O-notation really defined?
The algorithmic O-notation is the proper class of functions
$$O = \setb{O_X : P(R_X) \to \subsets{R_X} : X \text{ is a set}},$$
where
$$O_X(F) = \setb{g \in R_X : \exists f \in F, c \in \TR^{> 0} : g \leq c f}.$$
The difference is that, in all its generality, the set-specific O-notation $O_X$ takes in a set of functions $F \subset R_X$, and returns all functions $g \in R_X$ which are linearly dominated by at least one function $f \in F$. In the terminology of preorders, an O-set $O_X(F)$ is a down-set of the underlying preorder. In terms of the principal down-sets,
$$O_X(F) = \bigcup \setb{O_X(\setb{f}) : f \in F}.$$
If we introduce the abuse of notation $O_X(f) = O_X(\setb{f})$ for $f \in R_X$, then you'll see that before this section we studied an important special case of the O-notation.
So what does $2^{O_{\TN}(n)}$ mean?
Literally taken,
$$2^{O_{\TN}(n)} = \setb{2^f : f \in O_{\TN(n)}}.$$
However, when written in research papers, it is an abuse of notation for $O_{\TN}(2^{O_{\TN}(n)})$. The convention is: if there is an expression which contains O-notation, then the whole-thing is to be wrapped in O-notation. Similarly for the related notations.
To avoid ambiguity, I think it is be better to wrap these kinds of expressions inside explicit O-notations instead (or whatever notation is needed).
What does $\Omega_{\TN}(n)^{O_{\TN}(n)}$ mean?
Literally taken, the function-set
$$\setb{f^g : f \in \Omega_{\TN}(n) \land g \in O_{\TN}(n)}.$$
In contrast to the previous example, this time there is no reinterpretation as an O-set or $\Omega$-set based on convention, because the expression uses two different types of notations.
But $O_{\TN}(\Omega_{\TN}(n)^{O_{\TN}(n)})$ is unambiguous, right?
Yes.
Cheat-sheet revisited
Using our new understanding of O-notation, we are now able to prove new properties for our cheat-sheet:
$$
\begin{aligned}
& \text{Property} && \text{Definition} \\
& \text{   } && \text{   } \\
& \text{Idempotence} && O(O(f)) = O(f), \\
& \text{Composability} && O(O(f) \circ s) = O(f \circ s).
\end{aligned}
$$
In addition, the cheat-sheet can be in the most part be generalized simply by replacing $f, g, h \in R_X$ with $F, G, H \subset R_X$, and $\in$ with $\subset$. Left as an exercise.

What is the meaning of $O(m+n)$?


MAMP PRO - "Network Error (dns_server_failure)" when setting up VHosts

Question: I'm trying to set up a virtual host locally on MAMP PRO; I've done this before on other machines and it worked like a charm. This time, however, when I try to point my browser to the path defined in MAMP PRO, I get a "dns_server_failure". I feel like I've tried everything, but I still can't get it to work. Help!
Answer: Address of your DNS resolver doesn't know about your newly created virtual hosts. You need to set proper DNS records or use DynamicDNS if it's appropriate. You can find more info here:
http://documentation.mamp.info/en/mamp-pro/server/dynamic-dns


Little and big endianness in games

Question: Do we have to worry about byte orders in the process of programming a game? Do game consoles use different byte orders?
Comment: If you are worried about this I really recommend [Rob Pike's _The byte order fallacy_](http://commandcenter.blogspot.de/2012/04/byte-order-fallacy.html) - trying to worry about byte order often gets you into more trouble than just ignoring it and writing truly endian-independent code.
Comment: Are you concerned about a specific project you are working on right now or just in general? Mostly, if you are writing a game for a console, you will likely be using some well documented set of tools like XNA and input and output will be covered in its document.
Comment: It's a good read, but Rob is showing that you can get simplified reads at the expense of needing more complex writes. If you're not the one doing the writes, great!
Answer: If you're writing networking code, this often is something you have to deal with, yes.
Also it's possible that the byte ordering in a file format is not what your platform uses, so sometimes it matters there too.
Answer: Do you have to worry about it? Likely not. A vast majority of game programming is going to be at such a level that the endianness is abstracted away. Even in networking, you're almost certainly going to be using a library for networking protocols. It's good that you're aware of it, but I doubt you'd run into an issue with it.
Answer: Most of the time, no.
Endianess is usually abstracted away in the high level modules of a game engine, and you don't have to worry about it on a daily basis. If it isn't abstracted, then the engine has a serious issue and should be fixed, because this isn't the kind of details you should be worrying about when making a game.
However if you're working on some low-level parts of a C/C++ multi-platform engine, you might have to deal with it. All three current-gen consoles use a PowerPC architecture, which is big-endian, whereas the x86 architecture used on PC is little-endian. So if you're working on some code that reads raw bytes from somewhere to put them in data structures (binary serialization, networking...), yes you will have to deal with it.
For instance, in C/C++, it's common to see this kind of byte swapping in action (not tested, welcoming corrections):
<code>// Assume bytes comes ordered as big-endian
u16 u16FromBytes(void* data)
{
#if BIG_ENDIAN
    return (u16(data[0]) << 8) + u16(data[1]);
#else // LITTLE_ENDIAN
    return (u16(data[1]) << 8) + u16(data[0]);
#endif
}
</code>
Once again, this is OK in low-level code, but this shouldn't be something used everywhere.
Answer: It depends on the platforms you're targetting.  For example, I believe that the PS3 is big-endien so if that's one of your targets then it's something you need to be aware of, yes.
In the home computer space the "Big 3" (Windows, Linux, Mac) are all exclusively, or all but excelusively, on Intel x86/x64 architectures these days, so endienness concerns are no longer relevant.
Comment: No longer relevant?  In my experience (2-3 games across a couple companies and 7 years, both MMOs... so anecdotal rather than statistically valid) each of the PS and Xbox markets are about double the size of the windows market, Macs were a small fraction of windows, and Linux was noticeably smaller than that.  Unless your game simply cannot work on a console, you're leaving 80% of your profit on the ground by sticking to PCs.  Cross-endian code also means your servers can be on completely different machines than your clients (ex: every client-server console game ever).
Comment: @MarkStorer - I think you need to re-read what I actually wrote.

Little and big endianness in games


How to avoid plagiarism when you come up with an argument for a class paper and later discover that another author has the same argument?

Question: I am a graduate student in English working on my final paper for a class. I was assigned a particular author to write on, but about halfway through the semester another student wanted to write on that author so I agreed to write on a different author. I had already read some articles on this second author so I thought I would be able to come up with a good paper topic. I thought I had come up with a good idea for a thesis, but as I did my research, I found that my thesis contained essentially the same idea as a supporting argument expressed in one of the articles I had read. I expressed my concern to my professor as I began working on my paper; he read the first few pages and said he did not see a problem. I have cited the author's statements and ideas that I feel coincide with mine, but I still have a troubled conscience -- I feel that my ideas are not sufficiently my own and that my thesis is far too similar to the arguments in this article. It is too late for me to start on another paper, but I'm not sure that I can in good conscience turn in this paper. If anyone has any advice, I would appreciate it.
Comment: If this is a paper for a class, then the requirements for originality are not as strict as they might be for a graduate thesis or dissertation. Are you sure you're not mixing apples and oranges here? Especially if your professor doesn't see a problem. If it's not a problem, then write the paper, and turn it in in good conscience. You don't sound like you've "stolen" any ideas, or passed them off as completely your own.
Comment: Is it possible for you to present your paper as a review/critique of the author you feel you are plagiarizing?
Answer: From your description, it doesn't sound like a question of plagiarism (you say you're referencing the relevant paper, and I assume you're either paraphrasing it or using quotation marks as appropriate), but a possible lack of novelty. Lack of novelty is more of an issue when you're trying to publish in a journal or present at a conference. Usually class assignments don't have to be novel; they just have to reflect your own work. If your professor is satisfied, I don't think you have a problem. I would do my best to extend the ideas from the other paper, i.e. add something to their analysis.
Comment: For a class essay, as long as you have discovered the idea on your own, and you link to existing literature you know about, I do not see much of a problem. "Lack of novelty" would be a killer if you, say, work for 4 years on a proof for your PhD and then discover that someone else proved it earlier. But, you may still be saved if your proof is different/simpler/more general. I remember an anecdote that Wielandt's thesis was only 3 pages long, proving an already proven theorem, nevertheless, a "summa", the top mark for a thesis in Germany. Why? The previously known proof was 50 pages.
Answer: I think your concern reflects well on you (as does agreeing to let someone else take your first choice), but the way I read your question is that (1) you formed an opinion what to write, then (2) discovered in other secondary literature that someone else agrees with you, and had already made supporting arguments similar to yours.
That's not plagiarism. It just means that your work is less novel than you'd probably hoped. As your professor considers it adequate for purposes of your class, you should be fine.
I'd shy away from reading more of that source though to make it less likely to be subconsciously influenced by their reasoning.
Comment: Meta joke: while typing my answer on my phone, someone posted a very similar answer, which I discovered after I committed my answer. :)
Comment: It seems the OP read the article previously, then wrote their piece, then discovered that what they were writing was very similar to what they had previously read: *"I had already read some articles on this second author...as I did my research, I found that my thesis contained essentially the same idea ... in one of the articles I had read."* So if your answer that this isn't plagiarism is founded on the sequence you illustrate then you might need to reconsider your answer.
Comment: @Adam: You are correct, that is essentially the sequence. I (1) was assigned an author to write on; (2) read an article on another author as part of a class assignment; (3) agreed to write on this second author; (4) formed a thesis; (5) reread the article and discovered the similarities. There were several weeks between steps 2 and 4, so I had pretty much forgotten what this article said. As I stated in my original question, though, my professor apparently did not see enough similarities to consider it an issue, so I have been moving forward with my paper, but I need to have this resolved.
Answer: I know this paper probably does not have the rigor of an academic journal publication but in many disciplines it is common to include a section reviewing relevant publications and how they relate to your work.
Perhaps you could include a small section in your paper reviewing other papers and highlighting the difference between those papers and yours (even if the differences may be small) or how your work builds and improves upon the other papers.


Reliability of normalized cross-correlation with high lags

Question: Say you have two signals with 100 data points in each signal. Then there are 20 time lags where the computation of the normalized cross-correlation between those signals only considers 10 or less pairs of data points. It seems like the normalized cross-correlation is less meaningful at these lags because it is computed from less data. My question is, is there a general way of accounting for the uncertainty introduced when we look at the correlation with higher lags? Or does that vary too much based on the context?
Answer: Describing "correlation" as just a sample by sample multiplication and then a sum of the products of your two data sets [note that I am calling them data sets, not signals to avoid later confusion], correlated components will increase in magnitude at rate N (20Log N in dB), while independent components will increase in magnitude at the square root of N (10Log N  in dB). If we consider the correlated components as the "Signal" of interest and the independent components as noise, we can see that we get a 20Log N - 10Log N = 10LogN increase in SNR due to the process of correlating.
With that in mind, consider your example if the first data set is a signal of interest "buried" in noise. Let's say it is a pseudo-random sequence, which is nice for this explanation in that we will get a sharp correlation at one delay and minimum correlation elsewhere. The second data set is the pseudo-random sequence itself. We correlate to find the presence of the sequence in the noisy data set, along with the delay (the lag where we get maximum correlation). Now here you should see the answer to your question in light of my description above:
Assume the sequences are completely aligned in the two 100 sample datasets (lag=0), in this case we get 100 samples where the signal accumulates in the correlation, to 100x= 40 dB, while the noise component accumulates to sqrt(100x) = 20dB, and therefore you got a 20 dB net processing gain in SNR due to your 100 samples (important! Assuming here the noise from sample to sample in the first data set is independent, meaning white in frequency).
Now consider if the sequences were not aligned until you are at a lag of 90 samples, such that only 10 samples really are multiplied and then summed. In this case the signal accumulates by 10x or 20dB and the noise accumulates by sqrt(10) = 10dB for a net processing gain in SNR of 10 dB.
Comment: .' That was really interesting to read your correlation description because correlation for statisticians is not really viewed that way (AFAIK ? ). I'm new to DSP ( I think I'm gonna be new forever but that's ok with me ) and I'm not claiming to understand everything you said but do you know of "signal processing books" that speak your correlation language. it's definitely not stat language !!!!!! My guess  is the Stephen Kay text because I see that recommended or mentioned a lot. I don't have it but I guess it would be my next step after I get the basic DSP stuff down.Thanks.
Comment: Hi @markleeds ! Thanks for your comment. Yes this is clearly from the signal processing view and specifically the wireless communication field that I am from. Lookup the formula for the Pearson Correlation Coefficient which is likely closer to your recollection: https://en.wikipedia.org/wiki/Pearson_correlation_coefficient , (specifically the final formula given for r). The "multiply and sum" which is the correlation process I speak of is given there.
Comment: The rest is subtracting out the mean and then dividing by the product of the standard deviations which serves to normalize the result to be within [-1, +1].  As for signal processing implementations of "correlators", it is often just simply the sample by sample sum of the products between the two sequences that are being correlated (usually a noisy input and a known clean reference signal). The result is a scaled correlation magnitude along the lines of what I describe. Hope this helped! This may also help: http://astronomy.swin.edu.au/cosmos/C/Correlator
Comment: HI Dan: Yes, the pearson correlation part is definitely familar to me. Thanks for the info that  the field is wireless communication and I'll check out the link. also.


Difference between Computational science and Computational X (X = some natural science or discipline)

Question: Where is the divide between a computational scientist and a computational X (X = some natural science or discipline)? What questions could someone ask themself to decide which is the best route for them?
Comment: related: http://scicomp.stackexchange.com/a/4703/1804
Answer: Your question implies that there is a firm line between them, but this is far from the case.  I will be answering from my own position, where I see myself as a computational scientist, but I work in computational plasmas.  Hopefully the difference I draw between them will be insightful.
As a computational scientist, I enjoy the mathematics and methodology behind solving the many equations that appear in my field (Poisson's eq, compressible N-S, Boltzmann eq, etc.).  My advisor, on the other hand, couldn't really care less how the equations are solved, only that the solutions are found quickly and are "correct".
From this, the main difference I see between the two groups is whether the application or the methodology is the focus.  I personally see the methodology as my focus, since after graduating with my PhD, I likely won't stay in plasmas.  It is really more of a spectrum, with CS/Mathematics on one end, next to computational science, followed by computational X, and then the pure X, whatever that may be.
Answer: There is only an artificial difference. Computational X solves problems in X, i. e. physics.
Most often, you specialize later in Computational science, so you get an X, lately. Computational science without the X doesn't make much sense, so you would have to study computer science or mathematics, to get the pure math or the pure informatics.
Answer: I've given an answer to this question here:
  Does Computational Science involve programming?
I still think it to be true :-)


What's a good strategy for Endurance in Gemcraft Labyrinth?

Question: What's a good strategy to get max score from Endurance modes in Gemcraft Labyrinth?
Comment: I didn't know that they created a new gemcraft. Noooooooooooo!!! I don't have time to waste on this new chapter.
Answer: I was one of the first people to beat endurance mode (level 1337) on Armor Games' leaderboards. It's not that hard once you have it set up right.
I'll re-paste the mini-guide I posted on JIG here:
The first key is to get a gem that is Yellow-Orange-Lime... in a trap. You'll have to 8x-Amp a single tower for a while before you have a high enough gem, but once your YOL gem is about grade 12 or 13 you can put it in front of the entrance and instantly fill your mana bar with dead monsters.
The second key is to use Giants Only and summon as many as you can handle each wave while you're still setting up. For me, it was 1 gem grade per 10 waves, so 1-10 is a grade 1 gem, 11-20 is grade 2, etc. You make a huge profit by doing this, since the giants are worth so much per kill. Do not summon after 160 or so, since the natural HP of the creeps quickly starts to climb to 3.33 billion. The nice thing about this is that the max natural creep HP stays at 3.33 billion for the rest of the game.
Other important tips:

Put a blue/purple trap before your YOL trap until you're comfortable that your YOL can kill anything (grade 20-21 or so).
Remember: Don't summon after round 160 or so. You've been warned.
Get your amulets done early on in the battle. For example, it takes about 4-6 grade 19s in a shrine to kill off a monster with 3 billion HP, so save yourself the trouble.

I did this for the first time on H11, and ended up with a total multiplier of 7583.
Comment: Why do you want a yellow gem? Does orange's mana return act as a function of damage done?
Comment: Yellow scales up very well for damage. Without Yellow and Lime, you'll have to have a MUCH higher level gem to do the same amount of damage
Comment: Wow, Great tip! I played a game with this strategy. I removed all my gems. My mana was stillclimbing very fast even if many monsters were banished. I would have to wait a couple of hours if I didn't waste my mana for bombimg monsters.
Comment: Why use the trap and not a tower?
Comment: Traps trade damage for increasing the "bonus" effect of the gem. The damage multiplication effect of the Yellow and Lime components are much more valuable when combined in a trap, especially since the Orange mana drain applies to all hits on all targets.
Comment: What is the makeup of the YOL gem? Is it grade X yellow, grade X orange and grade X lime?
Comment: Just found this link, for those needing more details: http://armorgames.com/community/thread/7215173/i-beat-endurance-mode-1337-waves-on-the-hardest-settings/page/3
Comment: How long does this take?  Does your machine ever start crawling/crashing when there are too many monsters on the board?
Answer: When I play all armored endurance, I get 3 areas set up:
Mana farm: a line of amped traps with orange - lime - blue, ususally level x orange, level (x-1) lime and (x-1) blue, mix the lime blue then mix into the orange. (ex. mix a lime 2 with blue 2, making a l3, mix with an orange3 to make a OLB4. This chain hits mana gain while holding them there for a while. It will not do much damage later on, but that's not it's main function (to gather mana).
The Killzone: a line of towers with amps on both sides. the gems are yellow x with lime (x-1) (ex yellow 3 with a lime 2). They do high damage (with the multiplier) to several monsters at once (with chain). Place this far enough away from the mana farm that upgraded levels won't fire into your farm.
the Hadron wall: a line of traps with amps on the sides at the end (but within range of kill towers) with yellow(x) lime(x-1) blue(x-1) or yellow(x) lime(x-1) cyan(x-1) (shock) gems. This is a stiff wall that holds any leakers while it burns them down and also gives the killtowers more time to pound on them. I have had wave 1000+ groups summoned with a lvl20 gem hit the wall and burn up before getting past the first trap.
Why traps for the farm and wall? They give much higher special bonus.
The problem is to get everything working, you generally need to be about level 50 to have enough skill points for all the bonuses, but once you can get 20/20 on mana, crit, chain, and slow, you should be able to start pwning endurance. Once you get 1 endurance past wave 1337 with the endurance multiplier and all the add on's (build 10+ towers, build 10+ shrines....) you can earn 6 to 10 levels (and the pile of skill points that go with it) and defeat your next map on endurance.
One admission is once I get all 3 areas set and running right (around wave 300) I use a bent paper clip to hold down the "n" button (send Next wave) and burn right through to the last wave (1337).
Answer: I used this setup with 6 amplifiers and a row of 5 towers, when I was level 40, and managed to score 16,000 points on F3 (and gain 3 levels!):
Answer: The accepted answer is good, but only late in the game; you need a lot of skill points to fight all giant monster waves. Early on it's better to face all armored; they're almost as slow and not nearly as tough to kill. I used G12 and then B12 as the first fields for levelling up in endurance.
Answer: Chain hit + orange + shock = best mana farm.
Chain hits in traps on a single target will count as separate hits, making the mana farm incredible. Make sure you always have at least one monster in the trap by gem bombing enough. I got a 1M exp score at Wizard level 30 and immediately leveled me to 300+ish.
As damage gem, use green/yellow/anything.
Answer: My preferred gem would be yellow/red/lime, I have just one of these on the map, but it's 20th grade + 8 amplifiers around. I start off with just red when they're still weak then combine with other colors. it deals about 100k-300k damage now, +100x damage multiplier, 110% bloodbound and chain hit 8 targets. While I haven't beaten Endurance yet, I should be all done by evening, I hope.
Comment: I am normally a big fan of bloodbound gems, but not in endurance. Even with 1000 kills and a 200% bloodbound modifier, your base damage goes up by 2000. So your tower that avarages 200k dmg gets a 1% boost indamage for all those kills. Meanwhile, that 3rd color knocked down the %'s for both crit damage and chain. IMO, you are much better off mixing in mana or slow than bloodbound if you to mix anything into your kill towers.
Answer: The first time I won endurance was when I was level 23. I just wanted to try, so I used 2,7x battle settings. My mana farm got worthy at wave 40-50 and I was able to craft grade 32 gems by wave 300. I got nearly 700,000 XP and leveled up from 23 to 77. The next endurance I tried was with 11,5x battle settings. I went from level 94 to 311. And later, I won with all settings (no shadow clash) and got 35 million experience. I went from level ~330 to ~700 and got ~4,000 skill points xD.
I used yellow-lime for killing and orange-lime-cyan as farm.
Stats of the Killer got lost but were something like:
Gem - grade 36
dual yellow lime
damage: I think 11,000,000-66,000,000 (I'm not sure)
100% chance to deal 35,000x damage
100% chance to hit 200 targets
Stats of the mana farming gem:
Gem - grade 33
orange-lime-cyan
100% chance to hit 214 targets
94% chance to hit 215 targets
28,494.7 * 311,386.25 mana gain per hit (My mana pool extended more than 6 million times)
786% chance to shock (stuns a wave for up to 5 minutes)
That was awesome. I got more than 1 million max mana per frame xD.


What is the ruling of touching the logos (slogan) of Allah's names? (Like on the flags)

Question: As you can see, there are some logos (slogans) of the word Allah (and other Allah's names) on many things such as flags. For instance there is a slogan of it on the flag of Islamic Republic of Iran. I wonder if it is Halal if we touch it without Wudhu (ablution)?
Comment: salam on alaykom.
it's not differnce between name of God in flags or else. [http://farsi.khamenei.ir/treatise-content?id=14&tid=-1](http://farsi.khamenei.ir/treatise-content?id=14&tid=-1)
Answer: Touching of the word Allah in different matters apparently has the ruling of it on the papers. Then, touching this word would be haram without Wudhu.
But this could be considered from another aspect. Actually according to the Fatwa of Ayatollah Khamenei as a Marja al taqlid of Shiite:

Touching this logo (slogan of Iran) without wudhu would be haram in
  case it is considered as Esma-al-Jalalah from the Uruf, otherwise no
  problem. However it is better ignore touching it without wudu
  according to the precaution.

Reference:
farsi.khamenei.ir
Answer: Peace be upon you
In the start, touching the flag of Allah's names without ablution is not forbidden and also touching of Quran without ablution is not forbidden but the better ablution before touching the Quran.


What is this game with cards you describe, draw, or act out, decided by an electronic unit?

Question: Can anyone help me remember the name of this game? We played it around 2005. It was an electronic game with a purple (I think) unit. There were no teams. Each player chose a color. All the participating colors checked in on the unit to start the game. There was no game board. The game then chose a color to take a turn. You would select a card and insert it into the unit. The game then decided if you had to describe it, draw it, or act it out. The game also chose which color you would be doing the card with. It was all completely random. The game unit kept up with the score and at the end announced how many points each color had earned. I think there were two electronic hosts, one male and one female. I distinctly remember the female voice slowly saying, "Maybe you should try to act", slowly sounding out each letter in the word 'act'.
Comment: Perhaps you should edit your title so that it is other users coming across the question know what it is about. I suggest something like "What is this game where players describe, draw, or act out things from coloured cars to an electronic host?" or something like that. "I need your help!" is not a very good title for this site format :)
Comment: It's not Cranium Hoopla is it?
Answer: I remember playing this game as a kid! I believe it was called "Express Yourself". Hope I helped in some way!
Comment: That's it! I can't believe I'm just seeing this. I just ordered it. THANK YOU!!!
Comment: Here's the [BGG link for Express Yourself](https://boardgamegeek.com/boardgame/7321/express-yourself); it seems to match the description perfectly. Thanks for your answer!
Answer: Could this be Cranium Turbo Edition?

It has an electronic purple unit and 4 different types of activities: Data head (fun facts), Star performer (act & hum), Creative cat (sketch & sculpt), and Word worm (word puzzles).
Comment: No, there was no game board. But thanks for the response!
Comment: @csanlee keep in mind, that most games of this type can be played without a board as well.
Answer: Your description reminded me of Taboo. Therefore, I googled for an electronic version of the game and got two hits.

Taboo Buzz'd
Electronic Taboo (Platinum Edition)

I do not know these versions so I do not know if they match the rest of your description but I hope one of these two is the game you are looking for.
Comment: These aren't what I'm looking for but I like the Electronic Taboo. I think that will be my next game purchase. Thanks for the tip!
Answer: It could be Pictionary. Although this does have a board, maybe you have a different version. But in pictionary, you do have 2 different coloured cards and you have to draw what card comes up. The "unit" that you are talking about might be an electronic version of Pictionary where the "unit" gives out a random card.


Improving English for research

Question: I'm going to start my PhD in an English-speaking country. I would like to improve my English for research (fro writing and speaking). Could you let me know any good ways to do that?
Comment: Start reading English articles/news/books/etc.   You can start reading research papers or any materials related to your interests/hobbies.  As for speaking that'll be harder unless you have friends who speak English well.  Good news is that you pick up English quick after spending a few months in an English speaking country. This assumes you make an conscious effort to practice speaking; e.g., staying with an English speaking family will help heaps.
Comment: Read books. Writers know how to write, but many scientific papers are not well-written.
Comment: Read books specifically about writing. For computer science, I can highly recommend Justin Zobel's "Writing for Computer Science".
Comment: In most universities there a classes you can take on writing, rethorics, academic writing. Research your opinions once you are there.
Comment: If you are getting roommates, try to get native English speaking roommates. Engage with them as much as possible. In my experience, non-native English speakers thought their English was worse than I thought it was. They doubted themselves and would retreat and not talk as much in public which was unnecessary and ultimately hurt their English acquisition. Immerse yourself in English. Best of luck!!!
Answer: As someone in the U.S. currently teaching a class of mostly international graduate students, I've noticed various specific skills non-native English speakers sometimes have trouble with:

Following spoken English, as during a lecture.
Speaking English comfortably enough to ask questions (or later go on a job interview)
Writing English, first for homework assignments and then eventually for papers.

Before you head to your graduate program, some ways you can work on these skills:

Try sitting in on a course given in English, preferably one given in your field and by a native English speaker.  If you don't have a formal opportunity to do so at your university, then try free online courses with video content.  Coursera, for example, has free course content (as long as you don't want credit for the course) from many big name American universities.
Participate in an English language practice group, to give yourself a chance to feel comfortable speaking before you are in the middle of a class wanting to ask a question.
If you choose to brush up on your language writing skills, focus more on grammar and punctuation than on technical writing.  Almost none of my students show up good at technical writing, whether or not they are native English speakers, and I view it as part of my job to teach them.  Grammar and punctuation, however, although they mostly seem like a distraction when I'm grading exams, can make a difference in whether your future papers or job applications are taken as seriously as they deserve to be.

Finally, a few suggestions for after you get to grad school:

If there is any chance you will ever want to use your English professionally, strongly consider living with a native English speaker, and do your best to find a peer group that is not just international students, especially not just those that speak your native tongue.  Total immersion is a much faster way to learn English then just speaking it in class and my students who seek out chances to speak achieve greater mastery.
If your new school offers ESL (English as a second language) classes, take them.
When submitting papers or job applications (anything official that is leaving your school) take particular care to ask an English speaker to check your English (separately from any technical/content advice.)
Most importantly, if someone asks you to repeat something you say in English, don't apologise or let it fluster you; just repeat it calmly and as clearly as you can.  Keep in mind most of us not only want to understand you, we're in awe of your bravery setting out on a new adventure in a new language.

Best of luck!
Comment: Of course (bad autocorrect).  Thanks @DanielR.Collins.
Comment: Good advice for anyone who wants to do academic work in any second language, although English resources are much easier to come by.
Answer: Try to find Internet sources that explain the specific sounds and words in English that are difficult for speakers of your native language. For example I quite often use wordpanda dictionary for that purpose and read its blog here. You can also listen to ted talks and read the transcript and, of course, attend the speaking clubs and talk to native speakers! Good luck!

Improving English for research


Why is app incompatible with my phone?

Question: Why is Work Item Studio app incompatible with my Lumia 920? OS version is Lumia Denim 8.10.14234.375. Is there any way to install this app. In history i have installed this app but now i can't.
Answer: In the phone
Check that the date and time of the phone are correct.

Select Settings> Date / Time & Language> Date & Time
(Lumia with Windows Phone 8: Settings> Date & Time).
Set Set date and time automatically to Off and manually set the
current date, time, and time zone.

Go to the Store and check if there are any unsuccessful download apps or games, cancel all pending downloads, restart your phone, and then manually search for app or game updates in the Store. Keep your phone connected to a charger and a Wi-Fi network while looking for app updates.

Select Store> Menu> Downloads and Updates (Lumia with
Windows Phone 8: Store> ...> Download) or tap the icon that
indicates the number of pending downloads.
If an error is displayed, view details, and then touch for more
information. To delete an app from the queue, touch the app and
touch X to stop the download and remove it from the queue. Lumia
with Windows Phone 8: If Attention message appears, touch for more
information. To delete an app from the queue, hold down and then
select Cancel download.
Lumia with Windows 10: Check that there is no pending software
update in your phone, going to Settings> Upgrade & Security>
Updates.
Restart your phone and start manual search for app updates. Go to
Store> Menu> Downloads and Updates (Lumia with Windows Phone 8: Store> ...> Settings, touch Search Updates). At
the bottom of the screen you will see Check for Updates. After
checking for updates, select Update All at the top of the
screen.
Keep your phone connected to a charger and a Wi-Fi network and wait
for the download of app updates.
Comment: I have switched timezone to settings to manual, restarted phone, no store and system updates but app is still shown as incompatible.
Comment: Try to installing the app via PC:  1. Access Windows Phone Store from PC  2. Search your app and click on the "Download and install manually" item on the sidebar, under the app's info  3. Connect your Windows Phone 8.1 device to your PC via USB cable and then move (or copy) the downloaded XAP to the "download" folder in your phone's memory  4. Unplug the device from the PC and open the client for access to the Windows Phone Store and from the options (the three dots) select the item "install local apps"  5. Select the downloaded app and start the installation process.
Comment: I have no `install local apps` is store. There are only my apps, downloads and settings.

Why is app incompatible with my phone?


Yahoo Email Autofill

Question: When using yahoo's email service, I found that it will autofill emails of people not in my contacts list, and moreover people I've never even contacted. I know that I can remove these individually these emails, but I was wondering if there was an easier way to just restrict the autofill to my contacts, and what the cause of these spurious addresses might be.
Answer: From looking around my own Yahoo mail account, I see that

The suggestions are coming from email that you have received in which the email addresses are mentioned in not only the from field, but also the CC field. So, if I send an email to you and to five other people as well via the CC field, the email addresses of those 5 other people will appear as suggestions when you are filling in the To field to compose an email address.
There seems to be no way to turn off this functionality.

Yahoo Email Autofill


Stabilizing steel table legs for dining table

Question: I had two steel table legs fabricated for a dining table. It is made from flat steel of size 80mm x 8mm (3.15in x 0.3in).  It looks like a rounded square and the size of each leg is 700mm x 700mm (27.5in x 27.5in) . When I tried to attach a wooden table top, I noticed a bit of wobble. The wooden table top is around 1500mm x 800mm x 50mm  (59 x 31 x 2 in)and weighs around 30kg (66lbs). I was thinking of adding three cross supports to prevent this wobble. Would this be a way to do it? Or can someone perhaps suggest a better type of support for connecting both legs? Many thanks!
Comment: Have you determined if it's the fabrication of the legs which is at fault or if your wooden table-top is a little warped?
Comment: Hi, the table top is air dried cedar which to the best of my knowledge is straight (sighted down the edge). The legs seem to be welded well on visual inspection, but beyond that I dont know how to determine if they are faulty. Perhaps I needed a more thicker bar (12mm or 16mm)?
Answer: You have to think in terms of triangles when resolving issues like this. The upper inside corners of your leg frames want triangle type corner braces. You also want to have triangle braces from each leg frame up to the underside of the table. Done properly this will eliminate all of the wobble.
Comment: L brackets would work, or a shelf bracket, depends on how you want it to look.
Comment: L Brackets are crap and are NOT triangular like what is needed here.
Comment: Depends on your L bracket. Heavy gauge steel, bolted 3 on each leg and table top would prevent to table from wobbling. And an L bracket would create an open triangle. Yes still a triangle just with 2 sides.
Answer: This might upset your design, but if you skewed the legs a small amount (say, +10 degrees, -10 degrees) off of perpendicular, it might provide enough triangulation to prevent the wobble. (This assumes the wobble is in the long direction...)


Alternative to Toilet Paper?

Question: Are there any sustainable alternatives for toilet paper? This could either be done by recycled paper (if such exists), but perhaps some other creative solution could be interesting.
Comment: You can certainly buy toilet paper made from recycled paper.
Comment: funny question to any Indian as it was never really a problem for us
Comment: Well, you have some articles online such as: ["What Was Used Before Toilet Paper?"](http://scotduke.com/2010/10/14/what-was-used-before-toilet-paper/).
Comment: Which solutions work with composting toilets is also important, I think. The water ones require either an anaerobic (pit or septic tank) system or a sewage connection.
Comment: Different answer to the underlying issue: we bought a composting toilet, so instead of 5-10 litres a day for flushing, we use none. And the toilet paper partly offsets the dry matter we need to add to keep the compost process going, and it all then becomes compost for our garden. Toilet paper is obviously not as good as the sugar cane mulch we use, but it's not so much worse that it makes a big difference IMO. We do use FSC certified, mostly recycled, toilet paper.
Answer: In India you have to look hard to find toilet paper and if you do it is expensive. They wash themselves after each time the use the toilet (longer). For this purpose, public toilets (train stations, hotels, restaurants) in India sometimes have a (fairly high-power) shower head installed next to them. If you use shower gel for your washing process, the result is much like what you have when you get out of the shower. (In India, of course, this is why they only eat and shake hands with the right hand... In case they didn't have any shower gel.)
Personally, I think I would prefer the recycled paper way to this, though.
A small diversion: In terms of sustainability, one should really use a compost toilet, though. Most mammals know better than to poison their water supply with feces. A marvellous DIY system has been used (and made available online for free) by the "Humanure" Guy. I would argue that composting your waste material promotes healthy growth of plants, which is a good counter-weight to global warming (if that is what you're looking for).
Comment: _For this purpose, most toilets in India have a (fairly high-power) shower head installed next to them._ Where in India did you go? A huge chunk of the population doesn't have any sanitary facilities, and most homes don't have a bidet or a "shower-head" in the toilet. Most use a mug and wash their hands later.
Comment: The "bucket of water by the toilet" is possibly more common, IME. Since we have a washbasin in our toilet I use that a lot of the time. Less than a litre of water vs three sheets of toilet paper, though, I'm not sure which is better. If we had the "washbasin in lid of cistern" thing that might work, but it would wash faeces into the cistern which isn't good.
Comment: @elssar Of course you are right. I was in Karnataka and by "most" I mean public toilets I used in train stations, hotels, restaurants, etc. It must be very different in the many private houses or huts, most of which probably don't even have a toilet.
Comment: The hose-by-the-toilet method is common in large parts of the Middle East as well. Whether it is more sustainable, though, would depend on the abundance of water in the region.
Comment: In Indonesia, you have something similar.
Answer: I started using a toilet paper alternative about nine months ago. I was tired of the old plumbing in the house clogging up, and knowing that toilet paper is a cut down tree used so I can wipe my ass, felt very wasteful.
At the same time, we're living in a modern society. I'm a software engineer by trade, so I prefer using technology when I can.
I found that the quick-dry camping towels you might find at REI works very well. You wet them a bit and wipe. It is the same idea as using a wash rag. To clean it, I use soap. I use Dr. Bronner's castille soap, and pump it from a foaming pump container (which are reusable). Occasionally, I fill a bucket with water and borax and let it soak.
I have never had to do more than three wipes. Most of what comes out are water-soluble, so wetting the towel before wiping helps tremendously.
The quick-dry towel dries up fast so it does not collect mold or mildew.
The color matters because you want to know how clean it is. I was unable to find a white quick-dry towel for some reason. I currently use a blue one. The shit-brown color shows up well against the blue (sometimes turning it green). I am not color-blind, so your mileage may vary.
Comment: +1 for trying hard on sustainable alternatives. Are you living alone?
Comment: @donschoe Thanks. And yep, and living by myself makes it easier. The brief time I have roomed with other people, the other folk saw it as another wash rag. Eyes tend to glaze over it and not look at it too hard. I hang it with my clothes -- I have also reduced my entire wardrobe to three sets of wool base layers (plus pants and jackets), the kind you can wash quickly by hand and leave it hanging somewhere to dry in about four or five hours. That reduces a lot of laundry too. The bigger thing is relief from not having so much clutter.
Answer: Yes, there are plenty of suppliers, at least in the UK, that use recycled materials to make their toilet paper.
You could also look for accreditation for sustainable sourcing: there are schemes such as the Forest Stewarship Council that accredit suppliers that meet their criteria for sustainability. Note that some of these accreditation schemes are controversial, and some criteria are disputed as to just how sustainable they are; and/or how well-enforced they are.  Your mileage may vary.
One alternative is to use soap and water.
Answer: To add to Terry and Darren's suggestions, I wanted to insist on the fact that modern bidet attachments are available and easily installable on a sitting water toilet without major modification.
This one I found at a "culturally aware" place in Brisbane, Australia (sorry about the bad quality of the photo):

This kind of compact electronic attachment might be more hygienic than hand-held showers, as there is less risk of splash-back.
About the environmental impact, there are a number of things to consider:

The amount of water coming out of those devices is fairly small compared to the toilet flush.
The device involves building materials like plastic, different kinds
of metal for parts and extra bit of plumbing... and some wiring + the
use of electricity in case of electronics.
Does the device include an air-drying function, that would use more energy but could completely remove toilet paper form the bathroom? Will you be using a reusable towel to dry yourself, or will you still use some toilet paper?
What kind of paper are you
using currently? Is it already post-consumer recycled paper? Or
FSC certified? Was the wood pulp
bleached? Where does the raw material come from, and where is it transformed?
What is your local waste water treatment plant process, i.e. what is the effect of toilet paper in the treatment or disposal of sewerage water locally? Or do you use a septic tank?
etc.

All those parameters will influence the comparison between the two methods.
Mother Nature News says that bidets would be more environmentally friendly than just paper, because they'd (counter-intuitively) save water (paper production is water-intensive, even for recycled paper), and because the mill's organic pollution would be mostly avoided.
American Scientist lists the tree, water, electricity and chlorine savings that would be made if Americans gave toilet paper up, and agrees that the amount of water used by the bidet is negligible compared to the amount of water used in the paper production.
The benefit of a completely separate bidet unit would be to have a dry composting toilet and reduce significantly the amount of water used in the bathroom altogether.
Comment: @Pacerier : meaning that the place is an organisation focused on multi-cultural matters and therefore has bathrooms that take into account various cultural practices.
Comment: Re "culturally aware"; meaning?
Answer: Try planting mullein (verbascum thapsus). It is a pioneer species that will grow in the worst soil conditions and improve the soil over time. It's leaves are large, thick and covered in a soft fuzz which gives them the feel of a high quality 3-ply TP. It also has a number of medicinal uses outside of hygiene. (I would advise against reusing "soiled" leaves for medicinal purposes ;-) )
One thing to note. Some that have tried it claim the "hairs" on the leaves are an irritant. So if you have sensitive skin you may want to seek an alternative.
Comment: V. thapsis is one of the alternative remedies I find effective in controlling my asthma btw.  Obviously one would use different leaves for medicine than the other sorts of uses one can think of (toilet paper, lamp wicks,etc)
Answer: I am surprised no-one has mentioned bidets yet, which in Japan is your high-tech toilet.  (Though, it sounds like in India it is a shower!)
The "eco sums" will get quite complicated, as you are trading some electricity and water to save a few sheets of paper. If you reduce from say 8 sheets of 1-ply down to 2 sheets, I imagine that is an overall saving: less paper in the waste, meaning you need less water for the flush (?) and lower water treatment energy needed (?).
There is also an advantage to sensitive skin, where rubbing and scrubbing is much worse than simply dabbing (to dry). :-)
As this site is all about the holistic viewpoint, it is worth mentioning the effect of diet. As a side-effect of our hedonistic Western lifestyle, we've all had good days and bad days... but a bit more fibre, and a few spoonfuls of yoghurt, could save a few sheets each day!
Answer: The Romans of antiquity used a sponge on a stick. The sponge can be washed in a bucket with water and soap or eco friendly detergent.
Answer: Females can certainly reduce their TP use by using cut up cloth to wipe after #1. Using the cut off tops of old cotton socks works really well too. They have a good amount of thickness for absorption. Small cotton cloths & sock tops take up hardly any space in a load of laundry and can be reused over and over. Reduce your use of precious tree fibres, and save $, girls!
Comment: Only to get it right, females are the only human being who have old clothes they can use for wiping?
Comment: @user933, Re "tops"; meaning?
Answer: When my daughter was in diapers, we used cloth wipes for her. I bought them online, but pretty much any small piece of cloth will do. I would wet it with a spray bottle of water or a wipes solution to keep her skin clean and free of any rashes. The only thing I didn't like about it was having to using a diaper sprayer/bidet to rinse solid waste before putting them in the washer. Since I was already doing this with her cloth diapers anyway, it wasn't really as bad comparatively. Solid waste is not disolvable with the washer so it has to be removed before washing (unless you have a different method of clothes washing.)
I looked into using this method for myself and my husband (probably without the wipes solution for simplicity sake). I found some good info/idea from this article and I liked the bulleted pro/con list. Ultimately, we decided against this method for our family. But I'm so glad you posted this question because the other answers given are very insightful and have given me a lot to consider!
I hope you find (or have found) a good solution for your family.
Answer: I live in Korea and we have a bidet toilet seat. I was wary at first, but now I'm a complete convert. Paper just cannot clean as well. There are a few varieties of bidet toilet attachments, but they basically fall into the categories of mechanical and electrical. The mechanical ones are of course the most environmentally friendly, and I personally don't like using a bidet with anything hotter than lukewarm water, but each to their own.
How Mechanical Bidets Work
How Electrical Bidets Work
Comment: Nice post, but I wonder if the impact of a bidet (construction, delivery, installation) plus the extra water use, would really be lower than that of toilet paper.
Answer: In more outhouse oriented times, folk would use old corn cobs. Giving us the expression 'corn-hole'
Answer: A much better solution is to get a hand bidet sprayer and wash with water. Cleaner, greener, healthier, saves money and you never run out!
Comment: Doesn't work with [dry toilet](https://en.wikipedia.org/wiki/Dry_toilet), though. More water use.
Answer: After much experimentation and financial, environmental and hygienic considerations, I have found that, for my use, Skoy cloths make the best alternative to toilet paper.  They are the right size, absorbent, easily and thoroughly washable, wring out almost dry, dry quickly and last a long time.  I feel clean and pleased to help the planet.  Of course, I do leave Seventh Generation toilet paper out for my guests.
Answer: I know of some people (mainly older generation) who would use cut up newspaper stripes. I've never actually tried it myself though. The problem I see is that you'd have to flush more often because newspaper may clog your toilet. This would of course then offset much of the potential ecological gain.
Comment: Heard that too. But to me it seems this was used for non-sewered, septic tank type toilets in rural areas (here, rural Germany, 1950s). Makes sense, as toilet paper is made to quickly break down in contact with water, while newspaper will keep its structure much longer and clog the pipe.
Answer: From an article about the traditional composting toilet system in Kabul:

Sunni people use soil for anal cleansing, maintaining a largely dry latrine.

I have no more information about what kind of soil and how to use it, though. I can see the benefit for a combination with urine separating dry toilets though, as it will help dry the feces instead of adding water to it. That helps to lower the humidity to a point where the aerobic digestion (=composting) process can start. Usually this is achieved with litter like sawdust or leaves, but soil would also work.

Alternative to Toilet Paper?


Flavoring Cider at bottling

Question: The general caution I read when I started this batch of cider was to not do flavoring during fermentation as to avoid off taste weirdness. So my cider is now fermented and I'd like to keep it dry but would like to add some flavoring. Potentially ginger.
I have carbonation drops that I plan to use for carbonation, I figure these will impart some sweetness by themselves whether I like it or not. But in terms of adding flavoring, what are my options?  To do ginger at this point my only idea is to gri her ginger and steep it like a tea to make some sort of ginger flavored water, then add some to each bottle right as I bottle. But I would guess That ginger will naturally have some sugar in it(?) so I fear that might screw things up.
This is all an experiment and a small batch but hoping someone might have some advice.
Comment: I wouldn't worry too much about adding sugar to the cider - if your concern is carbonation, at least. Cider doesn't ever effervesce that much. I am afraid I can't speak to adding flavors after fermentation.
Answer: Are you making still cider or sparkling cider? If you are making sparkling cider than your plan should work since the amount of sugar is negligible. If you are making still cider, you might get a slight effervesce if anything at all. What I suggest is to add some ginger to the cider now as chunks or something like that and let it age for a couple of weeks to impart the ginger flavor, then bottle after any chance of fermentation has passed.
Comment: It will be sparkling so I'm ok on a little added sugar. Like your idea of doing it pre-bottling though. Thanks for the tip, I'll give it a run.
Answer: The advice given to me by a professional cider brewer was to put the fruit flavouring in at the last possible moment i.e. At bottling. Use natural fruit pressed and filtered. I have put a small amount i.e. About a teaspoon of fruit pulp to 1ltr still cider and that is sufficient for a very nice blackberry blush which doesn't overpower the cider and isn't too sweet. The small amount has added very little sparkle.
Hope this helps

Flavoring Cider at bottling