Question: I was just thinking what can be the last atomic number that can exist within the range of permissible radioactivity limit and considering all other factors in quantum physics and chemical factors.

Nobody really knows. Using the naive Bohr model of the atom, we run into trouble around $Z=137$ as the innermost electrons would have to be moving above the speed of light. This result is because the Bohr model doesn't take into account relativity. Solving the Dirac equation, which comes from relativistic quantum mechanics, and taking into account that the nucleus is not a point particle, then there seems to be no real issue with arbitrarily high atomic numbers, although unusual effects start happening above $Z \approx 173$. These results may be overturned by an even deeper analysis with current quantum electrodynamics theory, or a new theory altogether.
As far as we can tell, however, we will never get anywhere close to such atomic numbers. Very heavy elements are extremely unstable with respect to radioactive decay into lighter elements. Our current method of producing superheavy elements is based on accelerating a certain isotope of an relatively light element and hitting a target made of an isotope of a much heavier element. This process is extremely inefficient, and it takes many months to produce significant amounts of material. For the heaviest elements, it takes years to detect even a handful of atoms. The very short lifetime of the heaviest targets and the very low collision efficiency between projectile and target mean that it will be extremely difficult to go much further than the current 118 elements. It is possible that we may find somewhat more stable superheavy isotopes in the islands of stability around $Z=114$ and $Z=126$, but the predicted most stable isotopes (which even then are not expect to last more than a few minutes) have such a huge amount of neutrons in their nuclei that we have no idea how to produce them; we may be condemned to merely skirt the shores of the islands of stability, while never climbing them.
EDIT: Note that the best calculation presented above is based on quantum electrodynamics alone, i.e. only electromagnetic forces are taken into account. Obviously, to predict how nuclei will behave (and therefore how many protons you can stuff into a nucleus before it's impossible to go any further), one needs detailed knowledge of the strong and weak nuclear forces. Unfortunately, the mathematical description of nuclear forces is still an incredibly tough problem in physics today, so no one can hope to provide a rigorous answer from that angle.
There must be some limit, as the residual nuclear forces are very short-ranged. At some point there will be so many protons and neutrons in the nucleus (and the resulting nucleus will have become so large) that the diametrically opposite parts of the nucleus won't be able to "detect" each other, as they are too far away. Each additional proton or neutron produces a weaker stabilization via the strong nuclear force. Meanwhile, the electrical repulsion between protons has infinite range, so every additional proton will contribute repulsively just the same. This is why heavier elements need higher and higher neutron-to-proton ratios to remain stable.
Thus, at some atomic number, possibly not much higher than our current record of $Z=118$, the electrical repulsion of the protons will always win against the strong nuclear attractions of protons and neutrons, no matter the configuration of the nucleus. Hence, all sufficiently heavy atomic nuclei will suffer spontaneously fission almost immediately after coming into existence, or all the valid reaction pathways to reach an element will require events which are so fantastically unlikely that if even all the nucleons in the entire observable Universe were being collided with each other since the Big Bang in an attempt to synthesize the heaviest element possible, we would statistically expect some sufficiently heavy atom to not have been produced even once.


Question:
This question is based on a discussion with a 10-year old. So if it is not clear how to interpret certain details, imagine how a 10-year old would interpret them.
This 10-year old does not know about relativistic issues, so assume that we are living in a Newtonian universe.
In this model, our universe is homogenous and isotropic, with properties such as we see around us. Specifically, the density and size distribution of stars is what the current models say they are.
This universe has the same size as our observable universe, around 45 billion light years.
If we froze time, and took a plane through this universe, would this plane go through a star?
I cannot figure out if the chance of this happening is close to zero or close to one. I know that distances between stars are very big, so the plane is much more likely to be outside a star than inside a star, so my intuition wants to say that the chance is very small. But on the other hand, this plane will be very big... So based on that, my intuition says that the chance is close to one. I expect the chance to be one of these extremes, I would be very surprised if the chance were close to 50%...
Clearly, my intuition fails here. And I don't know how to approach this problem better (generating entire universes of stars and calculating if a plane intersects one of the stars takes too much time...).
Rough estimates are perfectly acceptable, I only want to know if the chance is close to zero or close to one!

Edit: Reading the comments/answers, I noticed that my reference to the 10-year old did not have the intended effect.
Some of the answers/comments focussed on how an answer to the title question could be explained to a 10-year old. That was not my question, and I was a bit surprised to see several people interpreting it that way. My question is the one summarized in the title.
And some of the comments were about the definition of observable universe, and that it necessarily would slice through earth because earth is in the center of our observable universe. I added the reference of the 10-year old to avoid such loopholes...
Rob Jeffries' and Accumulation's interpretation of the question was exactly what I meant, so their answers satisfied me.

There are about $10^{23}$ stars in the observable universe. Thanks to the expansion of the universe, those stars are currently spread over a sphere that is about $d=2.8\times 10^{10}$ parsecs across.
Of course some stars will have died whilst their light has been travelling towards us, but others will have been born, so I am going to ignore that complication.
If we imagine the stars uniformly spread through this volume$^{*}$, they have a number density of $n=3 \times 10^{-58}$ m$^{-3}$ (or $\sim 10^{-8}$ pc$^{-3}$). If we then define an average radius for a star $R$ we can ask how many stars lie within $R$ of a plane that goes through the Earth. The volume occupied by this slice is $2\pi d^2 R/4$ and the number of stars within that volume is
$$N = \pi d^2 R n/2.$$
If $R \sim 1 R_{\odot}$ (many stars are much bigger, most stars are a bit smaller), then $N \sim 2\times 10^5$. So my surprising conclusion (to me anyway) is that many stars would be "sliced" by a plane going through the entire observable universe.
$*$ NB: Stars are not distributed uniformly - they are concentrated in galaxies and those galaxies are organised into groups, clusters and filamentary superstructures. However, on the largest scales the universe is rather homogeneous (see the cosmic microwave background) and so to first order the smaller-scale non-uniformity will not affect an estimate of the average total number of "sliced" stars across the observable universe, but may mean there is a larger variance in the answer than simple Poissonian statistics would suggest.
Could the clustering of stars affect the conclusion? It could if the clustering is strong enough that the median number of stars within $R$ of the plane becomes $<1$, but with the mean number unchanged. As an example consider an extreme bimodal model where all stars are found in galaxies of $N_*$ stars, where the average density is   $n_*$. The "structure" of the universe could then be characterised by uniformly distributed galactic "cubes" of side $L = (N_*/n_*)^{1/3}$ and of voids with side $(n_*/n)^{1/3} L = (N_g/n)^{1/3}$. The number density of galaxies is the number of galaxies divided by the volume of the observable universe $n_g = (10^{23}/N_*)/(\pi d^3/6)$
The number of galaxies intersected by the plane will be
$$ N_g \sim \left(\frac{6\times 10^{23}}{\pi d^3 N_*}\right)\left(\frac{\pi d^2}{4}\right) L  = 1.5 \times 10^{23} \left(\frac{L}{N_* d}\right)$$
and in each of those galaxies there will be $\sim L^2 R n_* = R N_*/L$ intersections with a star.
If we let $n_*= 0.1$ pc$^{-3}$ (the local stellar density in our Galaxy) and $N_* =10^{11}$ (the size of our Galaxy), then $L= 10^4$ pc, $N_g = 5\times 10^{5}$ and the number of stellar intersections per galaxy will be about 0.25. thus the average number of intersections will be about the same (by design) but the variance won't be much different either.
I think the only way density contrasts could give an appreciable chance of no intersection is if $N_g<1$, and thus $L/N_* < 2 \times 10^{-13}$ - i.e. if galaxies/structures contain lots more stars and are very dense so that there is a good chance that the plane will not intersect a single "galaxy". For example if $N_* = 10^{21}$ and $n_* = 10^3$ pc$^{-3}$, then $L= 10^6$ pc and $N_g \sim 0.05$. In this circumstance (which looks nothing like our universe) there is a high chance that the plane would not intersect one of the 100 big "galaxies", but if it did there would be about $10^7$ stellar intersections.


Question:
Is a stochastic process completely described by its autocorrelation function?
If not, which additional properties would be needed?

What is meant by a complete description of a stochastic process?  Well, mathematically, a stochastic process is a collection $\{X(t) \colon t \in {\mathbb T}\}$ of random variables, one for each time instant $t$ in an index set $\mathbb T$, where usually $\mathbb T$ is the entire real line or the positive real line, and a complete description means that for each integer $n \geq 1$ and $n$ time instants $t_1, t_2, \ldots, t_n \in \mathbb T$, we know the (joint) distributions of the $n$ random variables $X(t_1)$, $X(t_2)$, $\ldots, X(t_n)$.  This is an enormous amount of information:  we need to know the CDF of $X(t)$ for each time instant $t$, the (two-dimensional) joint CDF of $X(t_1)$ and $X(t_2)$ for all choices of time instants $t_1$ and $t_2$, the (three-dimensional) CDFs of $X(t_1)$, $X(t_2)$, and $X(t_3)$, etc. etc. etc.
So naturally people have looked about for simpler descriptions and more restrictive models.  One simplification occurs when the process is invariant to a change in the time origin.  What this means is that

All the random variables in the process have identical CDFs: $F_{X(t_1)}(x) = F_{X(t_2)}(x)$ for all $t_1, t_2$.
Any two random variables separated by some specified amount of time have the same joint CDF as any other pair of random variables separated by the same amount of time.  For example, the random variables $X(t_1)$ and $X(t_1 + \tau)$ are separated by $\tau$ seconds, as are the random variables $X(t_2)$ and $X(t_2 + \tau)$, and thus $F_{X(t_1), X(t_1 + \tau)}(x,y) = F_{X(t_2), X(t_2 + \tau)}(x,y)$
Any three random variables $X(t_1)$, $X(t_1 + \tau_1)$, $X(t_1 + \tau_1 + \tau_2)$ spaced $\tau_1$ and $\tau_2$ apart have the same joint CDF as $X(t_2)$, $X(t_2 + \tau_1)$, $X(t_2 + \tau_1 + \tau_2)$ which as also spaced $\tau_1$ and $\tau_2$ apart. Equivalently, the joint CDF of $X(t_1), X(t_2), X(t_3)$ is the same as the joint CDF of $X(t_1+\tau), X(t_2+\tau), X(t_3+\tau)$
and similarly for all multidimensional CDFs.

Effectively, the probabilistic descriptions of the random process do not depend on what we choose to call the origin on the time axis: shifting all time instants $t_1, t_2, \ldots, t_n$ by some fixed amount $\tau$ to $t_1 + \tau, t_2 + \tau, \ldots, t_n + \tau$ gives the same probabilistic description of the random variables.   This property is called strict-sense stationarity and a random process that enjoys this property is
called a strictly stationary random process or, more simply, a stationary random process. Be aware that in some of the statistics literature (especially the parts related to econometrics and time-series analysis), stationary processes are defined somewhat differently; in fact as what are described later in this answer as wide-sense stationary processes.

Note that strict stationarity by itself does not require any particular form of CDF.  For example, it does not say that all the variables are Gaussian.

The adjective strictly suggests that  is possible to define a looser form of stationarity. If the $N^{\text{th}}$-order joint CDF of
$X(t_1), X(t_2), \ldots, X(t_N)$ is the same as the $N^{\text{th}}$-order joint CDF of $X(t_1+\tau), X(t_2+\tau), \ldots, X(t_N +\tau)$ for all
choices of $t_1,t_2, \ldots, t_N$ and $\tau$, then the random process
is said to be stationary to order $N$ and is referred to as a $N^{\text{th}}$-order stationary random process. Note that a
$N^{\text{th}}$-order stationary random process is also stationary
to order $n$ for each positive $n < N$. (This is because the $n^{\text{th}}$-order joint CDF is the limit of the $N^{\text{th}}$-order CDF as $N-n$ of the arguments approach $\infty$: a generalization of  $F_X(x) = \lim_{y\to\infty}F_{X,Y}(x,y)$). A strictly stationary random
process then is a random process that is stationary to all orders $N$.
If a random process is stationary to (at least) order $1$, then all the $X(t)$'s have the same distribution and so, assuming the mean exists, $E[X(t)] = \mu$ is the same for all $t$.  Similarly,
$E[(X(t))^2]$ is the same for all $t$, and is referred to as the power of the process.
All physical processes have finite power and so it is common to assume that
$E[(X(t))^2] < \infty$ in which case, and especially in the older engineering
literature, the process is called a second-order process. The choice
of name is unfortunate because it invites confusion with second-order
stationarity (cf. this answer of mine on stats.SE), and so here we will call
a process for which $E[(X(t))^2]$ is finite for all $t$ (whether or
not $E[(X(t))^2]$ is a constant) as a finite-power process and avoid this confusion.
But note again that

a first-order stationary process need not be a finite-power process.

Consider a random process that is stationary to order $2$. Now, since the joint distribution of $X(t_1)$ and $X(t_1 + \tau)$ is the same as the joint distribution function of $X(t_2)$ and $X(t_2 + \tau)$, $E[X(t_1)X(t_1 + \tau)] = E[X(t_2)X(t_2 + \tau)]$ and the value depends only on $\tau$.  These expectations are finite
for a finite-power process and their value is called the autocorrelation function of the process: $R_X(\tau) = E[X(t)X(t+\tau)]$ is a function of $\tau$, the time separation of the random variables $X(t)$ and $X(t+\tau)$, and does not depend on $t$ at all.  Note also that
$$E[X(t)X(t+\tau)] = E[X(t+\tau)X(t)] = E[X(t+\tau)X(t + \tau - \tau)] = R_X(-\tau),$$ and so
the autocorrelation function is an even function of its argument.

A finite-power second-order stationary random process has the properties that

Its mean $E[X(t)]$ is a constant
Its autocorrelation function $R_X(\tau) = E[X(t)X(t+\tau)]$ is a function of $\tau$, the time separation of the random variables $X(t)$ and $X(t+\tau)$, and does not depend on $t$ at all.

The assumption of stationarity simplifies the description of a random process to some extent but, for engineers and statisticians interested in building models from experimental data, estimating all those CDFs is a nontrivial task, particularly when there is only a segment of one sample path (or realization) $x(t)$ on which measurements can be made. Two measurements
that are relatively easy to make (because the engineer already has the necessary instruments on his workbench (or programs in MATLAB/Python/Octave/C++ in his software library) are the DC value
$\frac 1T\int_0^T x(t)\,\mathrm dt$ of $x(t)$ and the autocorrelation function $R_x(\tau) = \frac 1T\int_0^T x(t)x(t+\tau)\,\mathrm dt$ (or its Fourier transform, the power spectrum of $x(t)$). Taking these measurements as estimates of the mean and the autocorrelation function of a finite-power
process leads to a very useful model that we discuss next.

A finite-power random process is called a wide-sense-stationary (WSS) process (also weakly stationary stochastic process which fortunately also
has the same initialism WSS) if it has a constant mean and its autocorrelation function $R_X(t_1, t_2) = E[X(t_1)X(t_2)]$ depends only on the time difference $t_1 - t_2$  (or $t_2 - t_1$).

Note that the definition says nothing about the CDFs of the random
variables comprising the process; it is entirely a constraint on the
first-order and second-order moments of the random variables. Of course, a finite-power second-order stationary (or $N^{\text{th}}$-order stationary (for $N>2$) or strictly stationary) random process is
a WSS process, but the converse need not be true.

A WSS process need not be stationary to any order.

Consider, for example, the random process
$\{X(t)\colon X(t)= \cos (t + \Theta), -\infty < t < \infty\}$
where $\Theta$ takes on four equally likely values $0, \pi/2, \pi$ and $3\pi/2$. (Do not be scared: the four possible sample paths of this random process are just the four signal waveforms of a QPSK signal).
Note that each $X(t)$ is a discrete random variable that, in general, takes on four equally likely values $\cos(t), \cos(t+\pi/2)=-\sin(t), \cos(t+\pi) = -\cos(t)$ and $\cos(t+3\pi/2)=\sin(t)$,  It is easy to see that in general $X(t)$ and $X(s)$ have different distributions, and so the process is not even first-order stationary. On the other hand,
$$E[X(t)] = \frac 14\cos(t)+
\frac 14(-\sin(t)) + \frac 14(-\cos(t))+\frac 14 \sin(t)  = 0$$ for every $t$ while
\begin{align}
E[X(t)X(s)]&= \left.\left.\frac 14\right[\cos(t)\cos(s) +  (-\cos(t))(-\cos(s)) + \sin(t)\sin(s) + (-\sin(t))(-\sin(s))\right]\\
&= \left.\left.\frac 12\right[\cos(t)\cos(s) + \sin(t)\sin(s)\right]\\
&= \frac 12 \cos(t-s).
\end{align}
In short, the process has zero mean and its autocorrelation function depends only on the time difference $t-s$, and so the process is wide sense stationary. But it is not first-order stationary and so cannot be
stationary to higher orders either.
Even for WSS processes that are second-order stationary (or strictly stationary) random processes, little can be
said about the specific forms of the distributions of the random variables.  In short,

A WSS process is not necessarily stationary (to any order), and the mean and autocorrelation function of
a WSS process is not enough to give a complete statistical description
of the process.

WSS processes are a subclass of what are called covariance-stationary random processes. Covariance-stationary processes have the property that the _covariance function of the process,
\begin{align}C_X(t_1,t_2) &= \operatorname{cov}(X(t_1), X(t_2))\\
&= E[(X(t_1)-\mu_X(t_1))(X(t_2)-\mu_X(t_2))]\\
&=E[X(t_1)X(t_2)]-\mu_X(t_1)\mu_X(t_2),\end{align} is a function only of $t_1-t_2$ and not of the individual values of $t_1$ and $t_2$. (Notice the absence of any claim that the mean is a constant). Since for a WSS process, $$C_X(t_1,t_2) = R_X(t_1,t_2)-\mu_X(t_1)\mu_X(t_2)=R_X(t_1-t_2)-\mu_X^2$$
is a function only of $t_1-t_2$, we see that every WSS process is a covariance-stationary process. In fact, the prototypical covariance-stationary process is of the form
$$\{X(t) \colon t \in {\mathbb T}\} = \{Y(t) + s(t)\colon t \in {\mathbb T}\}$$
where $\{Y(t)\colon t \in {\mathbb T}\}$ is a zero-mean WSS process. It is a model for a deterministic signal $s(t)$ observed in the noise $Y(t)$.
The verification of the claim that the prototypical process is indeed a covariance-stationary process is left as an exercise for the reader.

Finally, suppose that a stochastic process is assumed to be a Gaussian process ("proving" this with any reasonable degree of confidence is not a trivial task).
This means that for each $t$, $X(t)$ is a Gaussian random variable and for all positive integers $n \geq 2$ and choices of $n$ time instants $t_1$, $t_2$, $\ldots, t_n$, the $N$
random variables $X(t_1)$, $X(t_2)$, $\ldots, X(t_n)$ are jointly Gaussian random
variables.  Now a joint Gaussian density function is completely determined by the means $E[X(t_i)]= \mu_X(t_i)$, variances
\begin{align}\operatorname{var}(X(t_i)) &= E[(X(t_i)-\mu_X(t_i))^2]\\
&= E[(X(t_i)^2]-(\mu_X(t_i))^2\\&= R_X(t_i,t_i)-(\mu_X(t_i))^2,\end{align} and covariances
\begin{align}\operatorname{cov}(X(t_i),X(t_j)) &= E[(X(t_i)-\mu_X(t_i)])(X(t_j)-\mu_X(t_j))]\\&= E[X(t_i)X(t_j)]-\mu_X(t_i)\mu_X(t_j)\\
&=R_X(t_i,t_j)-\mu_X(t_i)\mu_X(t_j)\end{align}
of the random variables. Thus, knowing the mean function $\mu_X(t) = E[X(t)]$ (it need not be a constant as is required for wide-sense-stationarity) and the autocorrelation function $R_X(t_1, t_2) = E[X(t_1)X(t_2)]$ for all $t_1, t_2$ (it need not depend only on $t_1-t_2$ as is required for wide-sense-stationarity) is sufficient to determine the statistics of the process completely.
If a Gaussian process is a WSS process, then
it is also a strictly stationary Gaussian process.  Fortunately
for engineers and signal processors, many physical noise processes
can be well-modeled as WSS Gaussian processes (and therefore strictly
stationary processes), so that experimental observation of the
autocorrelation function readily provides all the joint distributions.
Furthermore since Gaussian processes retain their Gaussian character
as they pass through linear systems, and the output autocorrelation
function is related to th input autocorrelation function as
$$R_y = h*\tilde{h}*R_X$$
so that the output statistics can also be easily determined, WSS
process in general and WSS Gaussian processes in particular are
of great importance in engineering applications.


Question:
As an explanation of why a large gravitational field (such as a black hole) can bend light, I have heard that light has momentum. This is given as a solution to the problem of only massive objects being affected by gravity. However, momentum is the product of mass and velocity, so, by this definition, massless photons cannot have momentum.
How can photons have momentum?
How is this momentum defined (equations)?

The answer to this question is simple and requires only SR, not GR or quantum mechanics.
In units with $c=1$, we have $m^2=E^2-p^2$, where $m$ is the invariant mass, $E$ is the mass-energy, and $p$ is the momentum. In terms of logical foundations, there is a variety of ways to demonstrate this. One route starts with Einstein's 1905 paper "Does the inertia of a body depend upon its energy-content?" Another method is to start from the fact that a valid conservation law has to use a tensor, and show that the energy-momentum four-vector is the only tensor that goes over to Newtonian mechanics in the appropriate limit.
Once $m^2=E^2-p^2$ is established, it follows trivially that for a photon, with $m=0$, $E=|p|$, i.e., $p=E/c$ in units with $c \ne 1$.
A lot of the confusion on this topic seems to arise from people assuming that $p=m\gamma v$ should be the definition of momentum. It really isn't an appropriate definition of momentum, because in the case of $m=0$ and $v=c$, it gives an indeterminate form. The indeterminate form can, however, be evaluated as a limit in which $m$ approaches 0 and $E=m\gamma c^2$ is held fixed. The result is again $p=E/c$.


Question:
Are there some proofs that can only be shown by contradiction or can everything that can be shown by contradiction also be shown without contradiction? What are the advantages/disadvantages of proving by contradiction?
As an aside, how is proving by contradiction viewed in general by 'advanced' mathematicians. Is it a bit of an 'easy way out' when it comes to trying to show something or is it perfectly fine? I ask because one of our tutors said something to that effect and said that he isn't fond of proof by contradiction.

To determine what can and cannot be proved by contradiction, we have to formalize a notion of proof.  As a piece of notation, we let $\bot$ represent an identically false proposition. Then $\lnot A$, the negation of $A$, is equivalent to $A \to \bot$, and we take the latter to be the definition of the former in terms of $\bot$.
There are two key logical principles that express different parts of what we call "proof by contradiction":

The principle of explosion: for any statement $A$, we can take "$\bot$ implies $A$" as an axiom.  This is also called ex falso quodlibet.
The law of the excluded middle: for any statement $A$, we can take "$A$ or $\lnot A$" as an axiom.

In proof theory, there are three well known systems:

Minimal logic has neither of the two principles above, but it has basic proof rules for manipulating logical connectives (other than negation) and quantifiers. This system corresponds most closely to "direct proof", because it does not let us leverage a negation for any purpose.
Intuitionistic logic includes minimal logic and the principle of explosion
Classical logic includes intuitionistic logic and the law of the excluded middle

It is known that there are statements that are provable in intuitionistic logic but not in minimal logic, and there are statements that are provable in classical logic that are not provable in intuitionistic logic. In this sense, the principle of explosion allows us to prove things that would not be provable without it, and the law of the excluded middle allows us to prove things we could not prove even with the principle of explosion.  So there are statements that are provable by contradiction that are not provable directly.
The scheme "If $A$ implies a contradiction, then $\lnot A$ must hold" is true even in intuitionistic logic, because $\lnot A$ is just an abbreviation for $A \to \bot$, and so that scheme just says "if $A \to \bot$ then $A \to \bot$". But in intuitionistic logic, if we prove $\lnot A \to \bot$, this only shows that $\lnot \lnot A$ holds. The extra strength in classical logic is that the law of the excluded middle shows that $\lnot \lnot A$ implies $A$, which means that in classical logic if we can prove $\lnot A$ implies a contradiction then we know that $A$ holds. In other words: even in intuitionistic logic, if a statement implies a contradiction then the negation of the statement is true, but in classical logic we also have that if the negation of a statement implies a contradiction then the original statement is true, and the latter is not provable in intuitionistic logic, and in particular is not provable directly.


Question:
Since I'm not that good at (as I like to call it) 'die-hard-mathematics', I've always liked concepts like the golden ratio or the dragon curve, which are easy to understand and explain but are mathematically beautiful at the same time.
Do you know of any other concepts like these?

I think if you look at this animation and think about it long enough, you'll understand:

Why circles and right-angle triangles and angles are all related.
Why sine is "opposite over hypotenuse" and so on.
Why cosine is simply sine but offset by $\frac{\pi}{2}$ radians.


Question:
I've heard people say that plots produced by ORIGIN tend to look polished and "professional," whereas plots produced by Mathematica do not. However, most plot-creation programs are quite configurable and it stands to reason that with the right settings for things like tick location and labeling, font and color choices, label alignment, and so on, I should be able to make a figure with Mathematica/matplotlib/Gnuplot/etc. that looks as good as those that come from ORIGIN. But what does it mean for a figure to be "professional" in this context?
In other words, if my goal is to create the best looking figures possible for inclusion in a scientific paper, what design choices are generally recommended towards that goal? Obviously one has to choose the appropriate kind of plot, e.g. bar graph vs. scatter plot, and linear vs. logarithmic scale, but those are choices that we always think about regardless of which plotting program we are using. I'm more interested in the things we don't normally think about, which are normally set according to some plotting program's defaults, but which could be changed to improve the look of the plot.

There are a couple elements I look for when I consider something "publication-quality" in either my own work, or what I'm considering when looking at others. They are:

High resolution, and preferably vector-based. This one should be fairly obvious by now, but you'd be surprised.
A lack of clutter. I should be able to see what's happening in your figure, and see it quickly. There's few things I hate more than someone trying to take the "High Ink:Paper ratio" guidance and using it to try to cram an entire manuscript in a single figure.
Prints well. This is the one that's actually most important for me, and when I'm reviewing papers, one I always test. "Do the figures print?" More than once, I've hit figures whose points are completely obfuscated when printed in grayscale, which renders them worthless for my purposes (I don't read on screens).
Evidence that the creator knows how to use graphics settings. No odd-ball axis choices, tick marks in the right place, etc.
Combined with #2, a lack of "flourish" that's entirely graphical in nature. Shadows, needless 3-D, etc. that really do nothing but waste the readers time.

Most of those are honestly creator-specific, rather than program specific. I've seen terrible plots done in R, and excellent plots done in Excel.


Question:
Let's say I want to construct a phylogenetic tree based on orthologous nucleotide sequences; I do not want to use protein sequences to have a better resolution. These species have different GC-content.
If we use a straightforward approach like maximum likelihood with JC69 or any other classical nucleotide model, conserved protein coding sequences of distant species with similar GC-content will artificially cluster together. This will happen because GC-content will mainly affect wobbling codon positions, and they will look similar on the nucleotide level.
What are possible ways to overcome this? I considered the following options so far:

Using protein sequence. This is possible of course, but we lose a lot of information on the short distance. Not applicable to non-coding sequences.
Recoding. In this approach C and T can be combined into a single pyrimidine state Y (G and A could be also combined in some implementations). This sounds interesting, but, first, we also lose some information here. Mathematical properties of the resulting process are not clear. As a result, this approach is not widely used.
Excluding third codon position from the analysis. Losing some short-distance information again. Also, not all synonymous substitution are specific to the third codon positions, so we still expect to have some bias. Not applicable to non-coding sequence.

It should be possible in theory to have a model which allows shifts in GC-content. This will be a non time-reversible Markov process. As far as I understand there are some computational difficulties estimating likelihood for such models.

There are models that take into account compositional heterogeneity both under the maximum likelihood and Bayesian frameworks. Although the substitution process is not time-reversible, the computations are simplified by assuming that the instantaneous rate matrix can be decomposed into an "equilibrium frequency vector" (non-homogeneous) and a symmetric, constant exchange rate matrix.
I guess all your suggestions are also valid, and I remember recoding being used successfully to reduce the GC-content bias (examples in the references above and here).


Question: Simple enough question. Why not use a 741 op-amp in a target circuit or anyone's target circuit? What are the reasons not to use it? What might be the reasons to still choose this part?

There are many good reasons not to use the 1968-vintage LM741: -

Minimum recommended power supply rails are +/- 10 volts

Modern op-amps have power supplies that can be as low as 0.9 volts.

Input voltage range is typically from -Vs + 2 volt to +Vs - 2 volt

Modern op-amps can be chosen that are rail-to-rail

Input offset voltage is typically 1 mV (5 mV maximum)

Modern op-amps can easily be as low as a few micro volts and have low drift.

Input offset current is typically 20 nA (200 nA maximum)

Modern op-amps are commonly available that are less than 100 pA

Input bias current is typically 80 nA (500 nA maximum)

Modern op-amps are commonly less than 1 nA

Input resistance is typically 2 MΩ (300 kΩ minimum)

Modern input resistance starts at hundreds of MΩ

Typical output voltage swing is -Vs + 1 volt to +Vs - 1 volt

Many cheap rail-to-rail op-amps get to their supplies within a few mV

Guaranteed output voltage swing is -Vs + 3 volt to +Vs - 3 volt
Supply current is typically 1.7 mA (2.8 mA maximum)

Modern op-amps with this current consumption are ten times faster and better in many other ways too.

Noise is 60 nV/sqrt(Hz) for LM348 (quad version of 741)
GBWP is 1 MHz with a slew rate of 0.5 V/us

The LM741A is slightly better but still a dinosaur in most areas.
Things of importance that the 741 data sheet does not appear to list (and that may depend on the age and manufacturer): -

Input offset voltage drift versus temperature
Input offset current drift versus temperature
Common mode rejection ratio versus frequency
Output resistance (closed or open loop)
Phase margin
likeliness of latchup (and gain reversal)

I can't think of any valid reasons to use the 741 other than "that's all I will ever have or own". Common reasons why they are still used in actual devices appear to be: -

Someone had a design that they didn't want to change from the 70s
Someone had millions of them lying around and wanted to put them to use
Someone actually determined that all the parameters are fine for their design, and at that moment the 741 was the cheapest to acquire and in millions of units it saved a few thousand dollars in total.

I've been an electronics designer since 1980 and I have never used or specified a 741 in any design I've been associated with. Maybe I'm missing out on something?


Question:
You need to check that your friend, Bob, has your correct phone number, but you cannot ask him directly. You must write the question on a card which and give it to Eve who will take the card to Bob and return the answer to you. What must you write on the card, besides the question, to ensure Bob can encode the message so that Eve cannot read your phone number?
Note: This question is on a list of "google interview questions". As a result, there are tons of versions of this question on the web, and many of them don't have clear, or even correct answers.
Note 2: The snarky answer to this question is that Bob should write "call me". Yes, that's very clever, 'outside the box' and everything, but doesn't use any techniques that field of CS where we call our hero "Bob" and his eavesdropping adversary "Eve".
Update:
Bonus points for an algorithm that you and Bob could both reasonably complete by hand.
Update 2:
Note that Bob doesn't have to send you any arbitrary message, but only confirm that he has your correct phone number without Eve being able to decode it, which may or may not lead to simpler solutions.

First we must assume that Eve is only passive. By this, I mean that she truthfully sends the card to Bob, and whatever she brings back to Alice is indeed Bob's response. If Eve can alter the data in either or both directions (and her action remains undetected) then anything goes.
(To honour long-standing traditions, the two honest parties involved in the conversation are called Alice and Bob. In your text, you said "you". My real name is not "Alice", but I will respond just as if you wrote that Alice wants to verify Bob's phone number.)
The simple (but weak) answer is to use a hash function. Alice writes on the card: "return to me the SHA-256 hash of your phone number". SHA-256 is a cryptographic hash function which is believed to be secure, as far as hash functions go. Computing it by hand would be tedious but still doable (that's about 2500 32-bit operations, where each operation is an addition, a word shift or rotate, or a bitwise combination of bits; Bob should be able to do it in a day or so).
Now what's weak about that ? SHA-256, being a cryptographic hash function, is resistant to "preimages": this means that given a hash output, it is very hard to recover a corresponding input (that's the problem that Eve faces). However, "very hard" means "the easiest method is brute force: trying possible inputs until a match is found". Trouble is that brute force is easy here: there are not so many possible phone numbers (in North America, that's 10 digits, i.e. a mere 10 billions). Bob wants to do things by hand, but we cannot assume that Eve is so limited. A basic PC can try a few millions SHA-256 hashes per second so Eve will be done in less than one hour (less than 5 minutes if she uses a GPU).
This is a generic issue: if Bob is deterministic (i.e. for a given message from Alice, he would always return the same response), Eve can simulate him. Namely, Eve knows everything about Bob except the phone number, so she virtually runs 10 billions of Bobs, who differ only by their assumed phone number; and she waits for one of the virtual Bobs to return whatever the real Bob actually returned. The flaw affects many kinds of "smart" solutions involving random nonces and symmetric encryption and whatsnot. It is a strong flaw, and its root lies in the huge difference in computing power between Eve and Bob (now, if Bob also had a computer as big as Eve's, then he could use a slow hash function through the use of many iterations; that's more or less what password hashing is about, with the phone number in lieu of the password; see bcrypt and also this answer).
Hence, a non-weak solution must involve some randomness on Bob's part: Bob must flip a coin or throw dice repeatedly, and inject the values in his computations. Moreover, Eve must not be able to unravel what Bob did, but Alice must be able to, so some information is confidentialy conveyed from Bob to Alice. This is called asymmetric encryption or, at least, asymmetric key agreement. The simplest algorithm of that class to compute, but still reasonably secure, is then RSA with the PKCS#1 v1.5 padding. RSA can use $e = 3$ as public exponent. So the protocol goes thus:

Alice generates a big integer $n = pq$ where $p$ and $q$ are similarly-sized prime integer, such that the size of $n$ is sufficient to ensure security (i.e. at least 1024 bits, as of 2012). Also, Alice must arrange for $p-1$ and $q-1$ not to be multiples of 3.
Alice writes $n$ on the card.
Bob first pads his phone number into a byte sequence as long as $n$, as described by PKCS#1 (this means: 00 02 xx xx ... xx 00 bb bb .. bb, where 'bb' are the ten bytes which encode the phone number, and the 'xx' are random non-zero byte values, for a total length of 128 bytes if $n$ is a 1024-bit integer).
Bob interprets his byte sequence as a big integer value $m$ (big-endian encoding) and computes $m^3 \mathrm{\ mod\ } n$ (so that's a couple of multiplications with very big integers, then a division, the result being the remainder of the division). That's still doable by hand (but, there again, it will probably take the better part of a day). The result is what Bob sends back to Alice.
Alice uses her knowledge of $p$ and $q$ to recover $m$ from the $m^3 \mathrm{\ mod\ } n$ sent by Bob. The Wikipedia page on RSA has some reasonably clear explanations on that process. Once Alice has $m$, she can remove the padding (the 'xx' are non-zero, so the first 'bb' byte can be unambiguously located) and she then has the phone number, which she can compare with the one she had.

Alice's computation will require a computer (what a computer does is always elementary and doable by hand, but a computer is devilishly fast at it, so the "doable" might take too much time to do in practice; RSA decryption by hand would take many weeks).
(Actually we could have faster by-hand computation by using McEliece encryption, but then the public key -- what Alice writes on the card -- would be huge, and a card would simply not do; Eve would have to transport a full book of digits.)


Question:
Before, the concept of imaginary numbers, the number $i = \sqrt{-1}$ was shown to have no solution among the numbers that we had. So we declared $i$ to be a new type of number. How come we don't do the same for other "impossible" equations, such as
$x = x + 1$, or $x = 1/0$?
Edit:
OK, a lot of people have said that a number $x$ such that $x = x + 1$ would break the rule that $0 \neq 1$. However, let's look at the extension from whole numbers to include negative numbers (yes, I said that I wasn't going to include this) by defining $-1$ to be the number such that $-1 + 1 = 0$. Note that this breaks the "rule" that "if $x \leq y$, then $ax \leq ay$", which was true for all $a, x, y$ before the introduction of negative numbers. So I'm not convinced that "That would break some obvious truth about all numbers" is necessarily an argument against this sort of thing.

Here's one key difference between the cases.
Suppose we add to the reals an element $i$ such that $i^2 = -1$, and then include everything else you can get from $i$ by applying addition and multiplication, while still preserving the usual rules of addition and multiplication. Expanding the reals to the complex numbers in this way does not enable us to prove new equations among the original reals that are inconsistent with previously established equations.
Suppose by contrast we add to the reals a new element $k$ postulated to be such that $k + 1 = k$ and then also add every further element you can get by applying addition and multiplication to the reals and this new element $k$. Then we have, for example,  $k + 1 + 1 = k + 1$. Hence -- assuming that old and new elements together still obey the usual rules of arithmetic -- we can cheerfully subtract $k$ from each side to "prove" $2 = 1$. Ooops! Adding the postulated element $k$ enables us to prove new equations flatly inconsistent what we already know. Very bad news!
Now, we can in fact add an element like $k$ consistently if we are prepared to alter the usual rules of addition. That is to say, if we not only add new elements but also change the rules of arithmetic at the same time, then we can stay safe. This is, for example, exactly what happens when we augment the finite ordinals with infinite ordinals. We get a consistent theory at the cost e.g. of having cases such as  $\omega + 1 \neq 1 + \omega$ and $1 + 1 + \omega = 1 + \omega$.


Question:
I was comparing a few of my codes to "stock" MATLAB codes. I am surprised at the results.
I ran a sample code (Sparse Matrix)
n = 5000;
a = diag(rand(n,1));
b = rand(n,1);
disp('For a\b');
tic;a\b;toc;
disp('For LU');
tic;LULU;toc;
disp('For Conj Grad');
tic;conjgrad(a,b,1e-8);toc;
disp('Inv(A)*B');
tic;inv(a)*b;toc;

Results :
    For a\b
    Elapsed time is 0.052838 seconds.

    For LU
    Elapsed time is 7.441331 seconds.

    For Conj Grad
    Elapsed time is 3.819182 seconds.

    Inv(A)*B
    Elapsed time is 38.511110 seconds.

For Dense Matrix:
n = 2000;
a = rand(n,n);
b = rand(n,1);
disp('For a\b');
tic;a\b;toc;
disp('For LU');
tic;LULU;toc;
disp('For Conj Grad');
tic;conjgrad(a,b,1e-8);toc;
disp('For INV(A)*B');
tic;inv(a)*b;toc;

Results:
For a\b
Elapsed time is 0.575926 seconds.

For LU
Elapsed time is 0.654287 seconds.

For Conj Grad
Elapsed time is 9.875896 seconds.

Inv(A)*B
Elapsed time is 1.648074 seconds.

How the heck is a\b so awesome?

In Matlab, the ‘\’ command invokes an algorithm which depends upon the structure of the matrix A and includes checks (small overhead) on properties of A.

If A is sparse and banded, employ a banded solver.
If A is an upper or lower triangular matrix, employ a backward
substitution algorithm.
If A is symmetric and has real positive diagonal elements, attempt a
Cholesky factorization. If A is sparse, employ reordering first to minimize
fill-in.
If none of criteria above is fulfilled, do a general triangular factorization
using Gaussian elimination with partial pivoting.
If A is sparse, then employ the UMFPACK library.
If A is not square, employ algorithms based on QR factorization for
undetermined systems.

To reduce overhead it is possible to use the linsolve command in Matlab and select a suitable solver among these options yourself.


Question:
Spring cleaning, and I'm trying to get power supplies for all my devices with missing power supplies. They're all the typical barrel power connector, and I'm having a dickens of a time trying to figure out the pin/hole diameter.

I ordered the power supplies I needed based on outside diameter (e.g., 5.5mm in my example below) and was surprised to discover that while the jack fit, the center pin did NOT. How do I prevent this from happening in the future? Do they even make calipers that can get into the hole to measure the pin diameter?
Radio Shack has their little keyring behind the counter with every known tip size, but all they can get from that is which stock number fits on their universal wall wart. Personally, I think that these types of "universal" kits are the worst thing to happen to electronics in, like, FOREVER. Too many parts to misplace and the tip-to-cable connector is almost always proprietary.

If I try to pump them for information about what the outer and inner diameters are, they want to know if I'm happy with my current cellular provider. As you may surmise, I'm not a big fan of trusting my local Radio Shack for electronics guidance.
So...that leaves me with a bunch of power supplies that don't fit their devices, and me a little peeved that I have to deal with RMAs, return shipping, etc., especially when I really don't have a clue how to figure out what to order. That also begs the question about how to ensure that I buy the right jack when designing something that NEEDS wall wart power.
Where do I even start? Anyone have any ideas on how to finding the correct barrel & pin diameters when I don't have specs on the jack? Is it really trial and error? or is there some measurement device that's available to help?

Just look up a fractional inch to mm conversion chart.  Then break out the drill bits.
5/64 inch = 1.9844 mm
3/32 inch = 2.3813 mm
7/64 inch = 2.7781 mm
a 5/64 bit will fit the 2.1mm barrel but not a 3/32
a 3/32 bit will fit the 2.5mm barrel but not a 7/64


Question:
I hesitate to ask this question, but I read a lot of the career advice from MathOverflow and math.stackexchange, and I couldn't find anything similar.
Four years after the PhD, I am pretty sure that I am going to leave academia soon. I do enjoy teaching and research, but the alpha-maleness, massive egos and pressure to publish are really unappealing to me, and I have never felt that I had the mathematical power to prove interesting results. However, I am really having trouble thinking of anything else to do. Most people seem to think that the main careers open to mathematicians are in banking and finance. I really want to work in some field where I can use mathematics, but it is also important to me to feel like I am contributing something positive or at least not actively doing harm. For this reason, financial speculation is very unappealing to me, although I do find the underlying mathematics quite fascinating.
Here is my question: what careers which make a positive contribution to society
might be open to academic mathematicians who want to change careers?

If you are in the US, there are several thousand institutions of higher learning, and at many of them there is very little "pressure to publish". At others, the "pressure to publish" can be met by publishing a textbook or some work of scholarship that does not require proofs of interesting (original) results. High schools also need qualified Mathematics teachers. Consider staying in academia, just moving to a different part of it, as an option for using your powers to do good.
I suspect, but cannot be sure, that much of what I've written applies outside the US as well.


Question:
I did a big cleanup of my collection of parts today and I now have a big pile of parts on my desk (the majority of which is resistors). My previous method of finding the resistor value I wanted was to look through my little box and read the colour codes. Unfortunately I now have a  lot of resistors, making an individual search almost impossible. Instead of reinventing the wheel, I put it to you my fellow chiphackers: do you know of any efficient (as in fast recall) ways to store and categorise components ?
I understand you can get lots of small drawers but it seems like such a waste of space to put only a single resistor of an unusual value in its own drawer.

I keep resistors in drawers organized by the first digits of value.
R-1, R-12, R-15, R-18, R-22 and so on. (same for capacitors)
R-1 contains 100ohm, 1k, 10k...
R-22 contains 22ohm, 220ohm, 2.2k, 22k...


Question:
In Hofstadter's Gödel, Escher, Bach: An Eternal Golden Braid (GEB), the following claim appears:

...in the species Felis catus, deep probing has revealed that it is indeed possible to read the phenotype directly off the genotype. The reader will perhaps better appreciate this remarkable fact after directly examining the following typical section of the DNA of Felis catus:
...CATCATCATCATCATCATCAT...(OP note: truncated because, you get it)

Is this true? A cursory search for the DNA of Felis catus gives me this 1996 paper by Lopez, Cevario, and O'Brien and the given sequence does not appear – there are some instances of "CAT" but not repeated enough to make it as remarkable as claimed in GEB.
I don't know enough Biology to judge the veracity of this claim. Some points I am considering are:

GEB is full of wordplays. However, the tone of this part of the text does not sound like one to me.
GEB was written/published around 1978. The paper I linked to – which was cited by some 236 others according to Google – was published in 1996, way after GEB's time. If my impression that Lopez et al.'s work is significant because it is the first time Felis catus has been sequenced, then there is no way Hofstadter could've known of it when he wrote GEB. Then again, I don't know enough Biology that there might be some nuance to Lopez et al.'s paper that I'm missing (i.e., the results of the paper might not be mutually exclusive to the claim made in GEB).
GEB has reference notes and bibliography and there is no reference cited to back this claim. However, GEB does not attempt to be a rigorous academic thesis and the references is only called upon more when Hofstadter quotes other works directly while the bibliography is a list of readings which the reader may want to check out, regarding the main thesis of the book.

So are cats recursions with no base cases?

The Felis catus genome has been published, annotated, and updated quite a bit since 1996, including spans of so-called intergenic regions, which are basically scaffolding and other structures, along with perhaps some unidentified genes, pseudogenes, regulatory sequences, etc. Basically, pretty much the entire DNA sequence is available now, not just the gene sequence of the mitochondrial genome, which was what was published in the 1996 paper you referenced. Mitochondria are the power plants of the cell, but are just an organelle that happens to contain its own DNA; they are separate from the chromosomal DNA in the nucleus. All of this is available for free (if you know where to look) at the National Center for Biotechnology Information (NCBI), part of the National Library of Medicine (NLM) at the National Institutes of Health (NIH) in the United States. Other sites are also available, such as Ensembl, a joint project between the European Bioinformatics Institute (EMBL-EBI), part of the European Molecular Biology Laboratory (EMBL), and the Wellcome Trust Sanger Institute (WTSI). Both institutes are located on the Wellcome Trust Genome Campus in the United Kingdom.
So, to the genome. Genomic sequences can be searched in a couple of different ways, depending on what you're looking for, but the most common way is to use BLAST, the Basic Local Alignment and Search Tool. As the name implies, it takes sequences as input and searches one against the other, aligning the results as best as possible using certain algorithms that the user can define and tweak. The BLAST web interface to the cat genome is here. You don't need to worry about any of the other options here except the "Enter Query Sequence" box. FASTA format is just using the single-letter abbreviations for nucleotides (AGCT), all strung together.
The genome we're searching is of an Abyssinian cat named Cinnamon:

Cinnamon, the cat which was chosen to be the definitive genetic model for all cats in the feline genome project. Image courtesy of the College of Veterinary Medicine at the University of Missouri.
To start with, I typed in CATCATCATCAT and to my surprise got back over 200 hits, covering every chromosome the cat has. So, I doubled the length of the input to 8 CATs, and got back the same result set. Unfortunately, 12 CATs was too many (and really, it is too many), so I worked backwards.
The final results are here (sorry, link expires 10/13/16. To regenerate, go to BLAST link above and enter CATCATCATCATCATCATCATCATCATCAT). Apparently, popular wisdom is incorrect, and Felis catus chromosomes really contain 10 CATs each, one more than is needed for their 9 lives. No word yet as to why this may be, but scientists are presumably working on it.


Question:
This question got me thinking about amino acids and the ambiguity in the genetic code. With 4 nucleotides in RNA and 3 per codon, there are 64 codons. However, these 64 codons only code for 20 amino acids (or 22 if you include selenocysteine and pyrrolysine), so many of the amino acids are coded by multiple codons.
Is there any hypothesis as to why there are only 22 amino acids and not 64? Is it possible that there were 64 (or at least more than 22) at an earlier time?

Brian Hayes wrote a very interesting article from a mathematical point of view:

especially the "Reality intrudes" section. Basically people had created fancy mathematical reasons why it has to be exactly 20. Nature, being nature, does not follow the reasoning, but has its own ideas. In other words there was nothing especially special about 20. In fact there seems to be a slow grafting of a 21st amino acid, selenocysteine using the codon UGA. Also pyrrolysine is considered the 22nd. The last section suggests that the code was originally doublet, so coded for <16 amino acids. This can partly explain why the third base in each codon is not as discriminating.
So perhaps in the year 2002012 someone will be asking on biology.stackexchange why there are only 40 amino acids.


Question:
In most introductory algorithm classes, notations like $O$ (Big O) and $\Theta$ are introduced, and a student would typically learn to use one of these to find the time complexity.
However, there are other notations, such as $o$, $\Omega$ and $\omega$. Are there any specific scenarios where one notation would be preferable to another?

You are referring to the Landau notation. They are not different symbols for the same thing but have entirely different meanings. Which one is "preferable" depends entirely on the desired statement.
$f \in \cal{O}(g)$ means that $f$ grows at most as fast as $g$, asymptotically and up to a constant factor; think of it as a $\leq$. $f \in o(g)$ is the stricter form, i.e. $<$.
$f \in \Omega(g)$ has the symmetric meaning: $f$ grows at least as fast as $g$. $\omega$ is its stricter cousin. You can see that $f \in \Omega(g)$ is equivalent to $g \in \cal{O}(f)$.
$f \in \Theta(g)$ means that $f$ grows about as fast as $g$; formally $f \in \cal{O}(g) \cap \Omega(g)$. $f \sim g$ (asymptotic equality) is its stronger form. We often mean $\Theta$ when we use $\cal{O}$.
Note how $\cal{O}(g)$ and its siblings are function classes. It is important to be very aware of this and their precise definitions -- which can differ depending on who is talking -- when doing "arithmetics" with them.
When proving things, take care to work with your precise definition. There are many definitions for Landau symbols around (all with the same basic intuition), some of which are equivalent on some sets on functions but not on others.
Suggested reading:

What are the rules for equals signs with big-O and little-o?
Sorting functions by asymptotic growth
How do O and Ω relate to worst and best case?
Nested Big O-notation
Definition of $\Theta$ for negative functions
What is the meaning of $O(m+n)$?
Is O(mn) considered "linear" or "quadratic" growth?
Sums of Landau terms revisited
What does big O mean as a term of an approximation ratio?
Any other question about asymptotics and landau-notation as exercise.

If you are interested in using Landau notation in a rigorous and sound manner, you may be interested in recent work by Rutanen et al. [1]. They formulate necessary and sufficient criteria for asymptotic notation as we use them in algorithmics, show that the common definition fails to meet them and provide a (the, in fact) workable definition.

A general definition of the O-notation for algorithm analysis by K. Rutanen et al. (2015)


Question:
I was discussing this with my brother. I'm pretty sure I read somewhere that they can move.
Thanks
EDIT: By movement I mean long distance migration (preferably within the brain only).

The question is relatively broad and one should take into account that the brain not only consists of neurons, but also glial cells (supportive cells) and pre-mitotic neuronal stem cells. Furthermore, as critical fellow-scientists have indicated, developmental stage is very important, as the developing embryonic brain is very different from the adult brain.
However, after sifting through various publications, the answer to the question is actually remarkably simple: Yes, brain cells migrate.
In  the adult brain glial cells migrate in the brain (Klämbt, 2009). Glial cells are involved in a myriad of functions, but a notable example of migrating glial cells are the oligodendrocytes that migrate relative long distances to find their target axons onto which they wrap themselves to form the insulating myelin sheath (Tsai and Miller, 2002).
Neuronal stem cells migrate over long distances in response to injury (Imitola et al., 2004) and they migrate from specific stem-cell locations (e.g., hippocampus and subventricular zone) to other regions (Clarke, 2003).
Post-mitotic, but non-differentiated neurons have been shown to migrate in the adult brain in fish (Scott et al., 2012), and in mammals and non-human primates as well (Sawada et al., 2011).
Not surprisingly, glial cells, stem cells and neurons also migrate during embryonic development. Most notably, post-mitotic neurons destined to fulfill peripheral functions have to migrate over relatively long distances from the neural crest to their target locations (Neuroscience, 2nd ed, Neuronal Migration).


Question: Why does cutting onions cause tears? From a couple of sites, I found that it is because of sulfuric acid produced by onions. But I could not find more details. What is the biochemical pathway by which onions cause tears? Also, which compound is responsible for it? If it is enzyme-catalyzed reaction, can we just stop the production of this enzyme without causing any side-effects?

Interesting question! The cause of tears and itching is the chemicals produced by onion (Allium cepa). Lets go into some details.
Onions, coming from the family Liliaceae (also containing garlic, chives, scallions and leeks) store compounds known as amino acid sulfoxides, and the one we are talking about here is S-1-propenyl-L-cysteine sulfoxide (abbreviated as PRENCSO), also calles isoalliin (due to its similarity with alliin found in garlic). When onion is damaged (cut, chewed, etc.), an enzyme alliinase converts PRENCSO into 1-propenyl sulfenic acid. This compound is then converted into propanethial-S-oxide by an enzyme lachrymatory factor synthase (earlier this reaction was considered spontaneous). The reaction looks like this:

Propanethial-S-oxide is the major cause of the flavor and aroma of onion. However, it is a volatile compound i.e. vaporizes very quickly. When its vapors reach the eye, it causes tears because of being a lachrymator (aka tear gas) i.e. as soon as it comes in contact with cornea, it triggers a nervous response which leads to activation of lachrymal (tear) glands.
PS: when propanethial-S-oxide comes in contact with cornea, a small amount of it reacts with water to form sulfuric acid. This sulfuric acid is the cause of itching and irritation in eyes due to onion. Also, scientists are now trying to genetically either modify or stop the production of lachrymatory factor synthase enzyme to produce tearless onions. This (modification) has even been achieved to a high efficiency, as another answer discusses. However, making tearless onions could prove harmful to the crop in several ways, as discussed here.
EDIT: As asked in comments, I will add some details about how the sulfuric acid is produced from the reaction between propanethial-S-oxide and water.
The only resource I could find giving some details about this was Marta Corzo-Martínez, 2014. They summarize the complete pathway in the following diagram:

After applying some common chemistry principles, the concerned reaction turns out to be:
$\ce{4~C_3H_6SO~+~4~H_2O \rightarrow 4~C_3H_6O~+~H_2SO_4~+~3~H_2S}$
As you see, one of the products of hydrolysis of propanethial-S-oxide is hydrogen sulfide ($\ce{H_2S}$). Just like $\ce{H_2SO_4}$, $\ce{H_2S}$ also causes irritation in the eyes (its effect on eyes has been well documented, see Lambert et al, 2006 as an example). Thus, the produced $\ce{H_2S}$ only increases the irritation and itching in the eyes caused due to $\ce{H_2SO_4}$.
BONUS: Another interesting point here is runny nose. propanethial-S-oxide is actually the compound responsible for the smell and flavor of onions. But, it causes tears by exciting the lachrymal glands i.e. reflexive lachrymation. propanethial-S-oxide excites the trigeminal nerve (the fifth cranial nerve) causing activation of lachrymal glands. Interestingly, the nerve endings of trigeminal nerve are also present in the nose, along with the eyes. So, this compound can also activate the lachrymal glands from your nose, and since the lachrymal duct is joined from eyes to nose, you can also experience runny nose along with tears and irritation in eyes.
References:

Propanethial-S-oxide | University of Bristol
Alliin | Wikipedia
Tear Gas | Wikipedia
Timothy William Lambert, Verona Marie Goodwin, Dennis Stefani, Lisa Strosher, Hydrogen sulfide ($\ce{H_2S}$) and sour gas effects on the eye. A historical perspective, Science of The Total Environment, Volume 367, Issue 1, 15 August 2006, Pages 1-22, ISSN 0048-9697,
Encyclopedia of Perception, Volume 1 -
E. Bruce Goldstein,
SAGE, 2010
The Neurology of Lacrimation – How an Ear Infection Can Cause Dry Eye -
by Noelle La Croix, DVM, Dip. ACVO


Question:
Typically, people call viruses some kind of organic compounds that cannot reproduce autonomously and which lower the fitness of their hosts. Even the word "virus" means "venom" in Latin.
But from the perspective of natural selection, one would expect those organic compounds that cannot reproduce autonomously, but which would increase the fitness of their hosts, to be more widespread. One can see an analogy with bacteria: people are more aware of harmful bacteria and even such words as "microbe" are perceived as somewhat harmful (among non-biologists for sure). But we know that an animal body contains many more useful bacteria than harmful ones, and animals have their own microflora, which are necessary for survival.
The same must be true for viruses: those viruses which were useful (or at least unharmful) to their hosts would be passed more easily to other organisms since their hosts would have a selective advantage.
So, do such beneficial for their direct hosts viruses exist? If so, what are they called? What are the examples?

Do they exist? Yes
What are they called? Marilyn Roossinck calls them viral mutualistic symbiotes. She has an excellent review here.
What are some examples?
My personal favorite is GB-Virus C, or Hepatitis G, which appears to slow the progression of HIV using a number of different mechanisms:

Box 1. Summary of the effects of GBV-C infection in HIV-positive individuals

GBV-C infection downregulates HIV entry co-receptors CCR5 and CXCR4, and increases secretion of their ligands RANTES, MIP-1α, MIP-1β and SDF-1.
In vitro GBV-C NS5A and E2 proteins inhibit X4- and R5-tropic HIV replication, and NS5A protein downregulates CD4 and CXCR4 gene expression.
HIV-infected individuals positive for GBV-C E2 antibodies have survival benefit over HIV-infected individuals with neither GBV-C viremia nor E2 antibodies; in vitro GBV-C E2 antibodies immunoprecipitate HIV particles and inhibit X4- and R5-tropic HIV replication.
GBV-C induces activation of interferon-related genes and pDCs.
GBV-C promotes Th1 polarization and the NS5A protein contributes to this effect.
GBV-C infection reduces surface expression of activation markers on T lymphocytes, suggesting its role in T cell activation signaling pathways.
GBV-C protects the T cell from Fas-mediated apoptosis and as a result of its effect on immune activation may also play a role in protecting lymphocytes from activation-induced cell death.
GBV-C viremia reduces IL-2-mediated T cell proliferation suggesting a significant interaction between GBV-C, IL-2 and IL-2 signaling pathways.

Endogenous retroviruses
As @mbrig recalls in the comments, there are a number of retroviruses that have inserted themselves into the germ line. Those are called endogenous retroviruses, and they interact with the host genome in a number of ways. Some are even translated:

Proteins produced from ERV env genes have also been demonstrated to function as restriction factors against exogenous retroviral infection


Question: I know that bond angle decreases in the order $\ce{H2O}$, $\ce{H2S}$ and $\ce{H2Se}$. I wish to know the reason for this. I think this is because of the lone pair repulsion but how?

Here are the $\ce{H-X-H}$ bond angles and the $\ce{H-X}$ bond lengths:
\begin{array}{lcc}
\text{molecule} & \text{bond angle}/^\circ & \text{bond length}/\pu{pm}\\
\hline
\ce{H2O} & 104.5 &  96 \\
\ce{H2S} &  92.3 & 134 \\
\ce{H2Se}&  91.0 & 146 \\
\hline
\end{array}
The traditional textbook explanation would argue that the orbitals in the water molecule is close to being $\ce{sp^3}$ hybridized, but due to lone pair - lone pair electron repulsions, the lone pair-X-lone pair angle opens up slightly in order to reduce these repulsions, thereby forcing the $\ce{H-X-H}$ angle to contract slightly. So instead of the $\ce{H-O-H}$ angle being the perfect tetrahedral angle ($109.5^\circ$) it is slightly reduced to $104.5^\circ$.  On the other hand, both $\ce{H2S}$ and $\ce{H2Se}$ have no orbital hybridization.  That is, The $\ce{S-H}$ and $\ce{Se-H}$ bonds use pure $\ce{p}$-orbitals from sulfur and selenium respectively.  Two $\ce{p}$-orbitals are used, one for each of the two $\ce{X-H}$ bonds; this leaves another $\ce{p}$-orbital and an $\ce{s}$-orbital to hold the two lone pairs of electrons.  If the $\ce{S-H}$ and $\ce{Se-H}$ bonds used pure $\ce{p}$-orbitals we would expect an $\ce{H-X-H}$ interorbital angle of $90^\circ$.  We see from the above table that we are very close to the measured values.  We could fine tune our answer by saying that in order to reduce repulsion between the bonding electrons in the two $\ce{X-H}$ bonds the angle opens up a bit wider.  This explanation would be consistent with the $\ce{H-S-H}$ angle being slightly larger than the corresponding $\ce{H-Se-H}$ angle. Since the $\ce{H-Se}$ bond is longer then the $\ce{H-S}$ bond, the interorbital electron repulsions will be less in the $\ce{H2Se}$ case alleviating the need for the bond angle to open up as much as it did in the $\ce{H2S}$ case.
The only new twist on all of this that some universities are now teaching is that water is not really $\ce{sp^3}$ hybridized, the $\ce{sp^3}$ explanation does not fit with all of the experimentally observed data, most notably the photoelectron spectrum.  The basic concept introduced is that "orbitals only hybridize in response to bonding." So in water, the orbitals in the two $\ce{O-H}$ bonds are roughly $\ce{sp^3}$ hybridized, but one lone pair resides in a nearly pure p-orbital and the other lone pair is in a roughly $\ce{sp}$ hybridized orbital.


Question:
We learned about the class of context-free languages $\mathrm{CFL}$. It is characterised by both context-free grammars and pushdown automata so it is easy to show that a given language is context-free.
How do I show the opposite, though? My TA has been adamant that in order to do so, we would have to show for all grammars (or automata) that they can not describe the language at hand. This seems like a big task!
I have read about some pumping lemma but it looks really complicated.

To my knowledge the pumping lemma is by far the simplest and most-used technique. If you find it hard, try the regular version first, it's not that bad. There are some other means for languages that are far from context free. For example undecidable languages are trivially not context free.
That said, I am also interested in other techniques than the pumping lemma if there are any.
EDIT: Here is an example for the pumping lemma: suppose the language $L=\{ a^k \mid k ∈ P\}$ is context free ($P$ is the set of prime numbers). The pumping lemma has a lot of $∃/∀$ quantifiers, so I will make this a bit like a game:

The pumping lemma gives you a $p$
You give a word $s$ of the language of length at least $p$
The pumping lemma rewrites it like this: $s=uvxyz$ with some conditions ($|vxy|≤p$ and $|vy|≥1$)
You give an integer $n≥0$
If $uv^nxy^nz$ is not in $L$, you win, $L$ is not context free.

For this particular language for $s$ any $a^k$ (with $k≥p$ and $k$ is
a prime number) will do the trick. Then the pumping lemma gives you
$uvxyz$ with $|vy|≥1$. Do disprove the context-freeness, you need to
find $n$ such that $|uv^nxy^nz|$ is not a prime number.
$$|uv^nxy^nz|=|s|+(n-1)|vy|=k+(n-1)|vy|$$
And then $n=k+1$ will do: $k+k|vy|=k(1+|vy|)$ is not prime so $uv^nxy^nz\not\in L$. The pumping lemma can't be applied so $L$ is not context free.
A second example is the language $\{ww \mid w \in \{a,b\}^{\ast}\}$. We (of course) have to choose a string and show that there's no possible way it can be broken into those five parts and have every derived pumped string remain in the language.
The string $s=a^{p}b^{p}a^{p}b^{p}$ is a suitable choice for this proof. Now we just have to look at where $v$ and $y$ can be. The key parts are that $v$ or $y$ has to have something in it (perhaps both), and that both $v$ and $y$ (and $x$) are contained in a length $p$ substring - so they can't be too far apart.
This string has a number of possibilities for where $v$ and $y$ might be, but it turns out that several of the cases actually look pretty similar.

$vy \in a^{\ast}$ or $vy \in b^{\ast}$. So then they're both contained in one of the sections of continguous $a$s or $b$s. This is the relatively easy case to argue, as it kind of doesn't matter which they're in. Assume that $|vy| = k \leq p$.

If they're in the first section of $a$s, then when we pump, the first half of the new string is $a^{p+k}b^{p-k/2}$, and the second is $b^{k/2}a^{p}b^{p}$. Obviously this is not of the form $ww$.
The argument for any of the three other sections runs pretty much the same, it's just where the $k$ and $k/2$ ends up in the indices.

$vxy$ straddles two of the sections. In this case pumping down is your friend. Again there's several places where this can happen (3 to be exact), but I'll just do one illustrative one, and the rest should be easy to figure out from there.

Assume that $vxy$ straddles the border between the first $a$ section and the first $b$ section. Let $vy = a^{k_{1}}b^{k_{2}}$ (it doesn't matter precisely where the $a$s and $b$s are in $v$ and $y$, but we know that they're in order). Then when we pump down (i.e. the $i=0$ case), we get the new string $s'=a^{p-k_{1}}b^{p-k_{2}}a^{p}b^{p}$, but then if $s'$ could be split into $ww$, the midpoint must be somewhere in the second $a$ section, so the first half is $a^{p-k_{1}}b^{p-k_{2}}a^{(k_{1}+k_{2})/2}$, and the second half is $a^{p-(k_{1}+k_{2})/2}b^{p}$. Clearly these are not the same string, so we can't put $v$ and $y$ there.

The remaining cases should be fairly transparent from there - they're the same ideas, just putting $v$ and $y$ in the other 3 spots in the first instance, and 2 spots in the second instance. In all cases though, you can pump it in such a way that the ordering is clearly messed up when you split the string in half.


Question:
Principal component analysis (PCA) is usually explained via an eigen-decomposition of the covariance matrix. However, it can also be performed via singular value decomposition (SVD) of the data matrix $\mathbf X$. How does it work? What is the connection between these two approaches? What is the relationship between SVD and PCA?
Or in other words, how to use SVD of the data matrix to perform dimensionality reduction?

Let the real values data matrix $\mathbf X$ be of $n \times p$ size, where $n$ is the number of samples and $p$ is the number of variables. Let us assume that it is centered, i.e. column means have been subtracted and are now equal to zero.
Then the $p \times p$ covariance matrix $\mathbf C$ is given by $\mathbf C = \mathbf X^\top \mathbf X/(n-1)$. It is a symmetric matrix and so it can be diagonalized: $$\mathbf C = \mathbf V \mathbf L \mathbf V^\top,$$ where $\mathbf V$ is a matrix of eigenvectors (each column is an eigenvector) and $\mathbf L$ is a diagonal matrix with eigenvalues $\lambda_i$ in the decreasing order on the diagonal. The eigenvectors are called principal axes or principal directions of the data. Projections of the data on the principal axes  are called principal components, also known as PC scores; these can be seen as new, transformed, variables. The $j$-th principal component is given by $j$-th column of $\mathbf {XV}$. The coordinates of the $i$-th data point in the new PC space are given by the $i$-th row of $\mathbf{XV}$.
If we now perform singular value decomposition of $\mathbf X$, we obtain a decomposition $$\mathbf X = \mathbf U \mathbf S \mathbf V^\top,$$ where $\mathbf U$ is a unitary matrix (with columns called left singular vectors), $\mathbf S$ is the diagonal matrix of singular values $s_i$ and $\mathbf V$ columns are called right singular vectors. From here one can easily see that $$\mathbf C = \mathbf V \mathbf S \mathbf U^\top \mathbf U \mathbf S \mathbf V^\top /(n-1) = \mathbf V \frac{\mathbf S^2}{n-1}\mathbf V^\top,$$ meaning that right singular vectors $\mathbf V$ are principal directions (eigenvectors) and that singular values are related to the eigenvalues of covariance matrix via $\lambda_i = s_i^2/(n-1)$. Principal components are given by $\mathbf X \mathbf V = \mathbf U \mathbf S \mathbf V^\top \mathbf V = \mathbf U \mathbf S$.
To summarize:

If $\mathbf X = \mathbf U \mathbf S \mathbf V^\top$, then the columns of $\mathbf V$ are principal directions/axes (eigenvectors).
Columns of $\mathbf {US}$ are principal components ("scores").
Singular values are related to the eigenvalues of covariance matrix via $\lambda_i = s_i^2/(n-1)$. Eigenvalues $\lambda_i$ show variances of the respective PCs.
Standardized scores are given by columns of $\sqrt{n-1}\mathbf U$ and loadings are given by columns of $\mathbf V \mathbf S/\sqrt{n-1}$. See e.g. here and here for why "loadings" should not be confused with principal directions.
The above is correct only if $\mathbf X$ is centered. Only then is covariance matrix equal to $\mathbf X^\top \mathbf X/(n-1)$.
The above is correct only for $\mathbf X$ having samples in rows and variables in columns. If variables are in rows and samples in columns, then $\mathbf U$ and $\mathbf V$ exchange interpretations.
If one wants to perform PCA on a correlation matrix (instead of a covariance matrix), then columns of $\mathbf X$ should not only be centered, but standardized as well, i.e. divided by their standard deviations.
To reduce the dimensionality of the data from $p$ to $k<p$, select $k$ first columns of $\mathbf U$, and $k\times k$ upper-left part of $\mathbf S$. Their product $\mathbf U_k \mathbf S_k$ is the required $n \times k$ matrix containing first $k$ PCs.
Further multiplying the first $k$ PCs by the corresponding principal axes $\mathbf V_k^\top$ yields $\mathbf X_k = \mathbf U_k^\vphantom \top \mathbf S_k^\vphantom \top \mathbf V_k^\top$ matrix that has the original $n \times p$ size but is of lower rank (of rank $k$). This matrix $\mathbf X_k$ provides a reconstruction of the original data from the first $k$ PCs. It has the lowest possible reconstruction error, see my answer here.
Strictly speaking, $\mathbf U$ is of $n\times n$ size and $\mathbf V$ is of $p \times p$ size. However, if $n>p$ then the last $n-p$ columns of $\mathbf U$ are arbitrary (and corresponding rows of $\mathbf S$ are constant zero); one should therefore use an economy size (or thin) SVD that returns $\mathbf U$ of $n\times p$ size, dropping the useless columns. For large $n\gg p$ the matrix $\mathbf U$ would otherwise be unnecessarily huge. The same applies for an opposite situation of $n\ll p$.

Further links

What is the intuitive relationship between SVD and PCA -- a very popular and very similar thread on math.SE.

Why PCA of data by means of SVD of the data? -- a discussion of what are the benefits of performing PCA via SVD [short answer: numerical stability].

PCA and Correspondence analysis in their relation to Biplot -- PCA in the context of some congeneric techniques, all based on SVD.

Is there any advantage of SVD over PCA? -- a question asking if there any benefits in using SVD instead of PCA [short answer: ill-posed question].

Making sense of principal component analysis, eigenvectors & eigenvalues -- my answer giving a non-technical explanation of PCA. To draw attention, I reproduce one figure here:


Question: We touched on introns and exons in my bio class, but unfortunately we didn't really talk about why Eukaryotes have introns. It would seem they would have to have some purpose since prokaryotes do not have them and they evolved first chronologically, but I could easily be wrong. Did the junk sections of DNA just evolve there by some sort of randomness or necessity as opposed to an actual evolutionary advantage? Why hasn't evolution stopped us from having introns since they seem to be a 'waste' of time and DNA? Why do prokaryotes not have introns?

There is still a lot to be learned about the roles introns play in biological processes, but there are a couple of things that have been pretty well established.

Introns enable alternative splicing, which enables a single gene to encode multiple proteins that perform different functions under different conditions. For example, a signal the cell receives could cause an exon that is normally included to be skipped, or an intron that is normally spliced out to be left in for translation (the Wikipedia article on the subject has a basic overview of the possibilities). This would not be possible, or at least would be much more difficult, without the presence of introns.
In recent years, we have discovered that RNA molecules (especially small RNAs such as siRNAs and miRNAs) are much more involved in regulating gene expression than previously thought. Often the small regulatory RNAs are derived from spliced introns.

There is probably more, but essentially introns enable a finer level of regulatory control. Biological complexity is often not the result of having a larger complement of genes, but of having additional layers of regulation to turn genes on and off at the right times. Prokaryotic genes are often organized into operons, and a single polycistronic mRNA will often encode multiple proteins from multiple adjacent genes. Since the biological processes required to sustain microbial life are much less complicated than those required to sustain eukaryotic life, they can get away with much less regulatory control.


Question:
Setup:
The way a gecko's feet function has been a captivating but now relatively well understood phenomenon. They have many small spatula on the feet that exploit electromagnetic van-der-Waals forces on the walls to which they stick.
This concept has been developed in "nano-tape" a product which is adhesive the same way a gecko's feet are. And there has been no shortage of folks trying to create "spiderman gloves" to re-create this, one interesting example being this attempt by Elijah Animates to scale a flat rock climbing wall.
Elijah found that the nano-tape gloves were rendered ineffective by chalk dust on the wall which would coat the micro-structures and prevent them from sticking.
This leaves me very confused. I have often seen geckos when I travel to India in some extremely dusty conditions. For example, far MORE dusty than a well chalked climbing wall. Despite that, these geckos STILL stick perfectly well to all manner of surfaces, even glass walls.
Question:
What are gecko's feet doing that is fundamentally different than the nano-tape which allows them to operate in extremely dusty environments successfully? It clearly goes one step beyond merely exploiting the Van Der Waals forces but also somehow "removing any debris that is stuck".
This I also find hard to explain because I don't think I have ever seen a gecko "shake its legs off" similar to how a dog shakes water off. The mechanism of debris removal is probably subtler than that.

This is a very interesting question. Basically (and this is the short answer), geckos possess a unique self-cleaning mechanism in their feet which synthetic nano tapes do not have. This capability allows geckos to maintain their adhesive properties even in dusty environments.
Gecko Feet Mechanism
Gecko feet are covered with millions of microscopic hair-like structures called setae, which branch into thousands of even smaller spatulae. These structures allow geckos to adhere to surfaces through Van der Waals forces, which are weak intermolecular forces that become significant at the nanoscale. When a gecko walks, the lateral movement of its feet creates friction that dislodges larger dirt particles, while smaller particles fall into the folds of their skin, effectively cleaning the setae as they move. The self-cleaning ability of gecko feet is attributed to the hierarchical structure of the setae and spatulae, which allows them to dislodge contaminants efficiently. Experimental studies show that geckos can regain about 80% of their adhesive strength after just a few steps on contaminated surfaces, thanks to this mechanism (see references 1, 2 and 3 for more details).
Synthetic Nano-Tape Comparison
In contrast, synthetic nano-tapes inspired by gecko feet often lack the same level of self-cleaning efficiency. While they can mimic the adhesive properties of gecko feet, they typically do not perform well in dusty conditions. The synthetic versions may rely on larger microhairs that do not effectively roll off dirt particles, leading to a significant loss of adhesive strength after contact with contaminants. Moreover, many synthetic adhesives use glue, which can degrade over time and lose adhesion, unlike gecko feet that remain sticky without any additional substances. Although some synthetic tapes have been developed to replicate the self-cleaning effect, they have not yet matched the natural efficiency of gecko feet in real-world conditions.
Conclusion
In summary, the fundamental difference lies in the gecko's natural ability to maintain adhesion through a sophisticated self-cleaning mechanism facilitated by its unique micro- and nano-structured feet, whereas synthetic nano-tapes often struggle with dirt retention and adhesive longevity due to their reliance on larger structures and glue-based adhesion methods (see references 4 and 5 for more details).
References:

Robust self-cleaning and micromanipulation capabilities of gecko
spatulae and their bio-mimics
Gecko adhesion: evolutionary nanotechnology
Dynamic self-cleaning in gecko setae via digital hyperextension
Robust self-cleaning and micromanipulation capabilities of gecko
spatulae and their bio-mimics
Carbon nanotube-based synthetic gecko tapes


Question:
The video “How Far Can Legolas See?” by MinutePhysics recently went viral. The video states that although Legolas would in principle be able to count $105$ horsemen $24\text{ km}$ away, he shouldn't have been able to tell that their leader was very tall.

I understand that the main goal of MinutePhysics is mostly educational, and for that reason it assumes a simplified model for seeing. But if we consider a more detailed model for vision, it appears to me that even with human-size eyeballs and pupils$^\dagger$, one might actually be able to (in principle) distinguish smaller angles than the well known angular resolution:
$$\theta \approx 1.22 \frac \lambda D$$
So here's my question—using the facts that:

Elves have two eyes (which might be useful as in e.g. the Very Large Array).
Eyes can dynamically move and change the size of their pupils.

And assuming that:

Legolas could do intensive image processing.
The density of photoreceptor cells in Legolas's retina is not a limiting factor here.
Elves are pretty much limited to visible light just as humans are.
They had the cleanest air possible on Earth on that day.

How well could Legolas see those horsemen?

$^\dagger$ I'm not sure if this is an accurate description of elves in Tolkien's fantasy

Fun question!
As you pointed out,
$$\theta \approx 1.22\frac{\lambda}{D}$$
For a human-like eye, which has a maximum pupil diameter of about $9\ \mathrm{mm}$ and choosing the shortest wavelength in the visible spectrum of about $390\ \mathrm{nm}$, the angular resolution works out to about $5.3\times10^{-5}$ (radians, of course). At a distance of $24\ \mathrm{km}$, this corresponds to a linear resolution ($\theta d$, where $d$ is the distance) of about $1.2\ \mathrm m$. So counting mounted riders seems plausible since they are probably separated by one to a few times this resolution. Comparing their heights which are on the order of the resolution would be more difficult, but might still be possible with dithering. Does Legolas perhaps wiggle his head around a lot while he's counting? Dithering only helps when the image sampling (in this case, by elven photoreceptors) is worse than the resolution of the optics. Human eyes apparently have an equivalent pixel spacing of something like a few tenths of an arcminute, while the diffraction-limited resolution is about a tenth of an arcminute, so dithering or some other technique would be necessary to take full advantage of the optics.
An interferometer has an angular resolution equal to a telescope with a diameter equal to the separation between the two most widely separated detectors. Legolas has two detectors (eyeballs) separated by about 10 times the diameter of his pupils, $75\ \mathrm{mm}$ or so at most. This would give him a linear resolution of about $15\ \mathrm{cm}$ at a distance of $24\ \mathrm{km}$, probably sufficient to compare the heights of mounted riders.
However, interferometry is a bit more complicated than that. With only two detectors and a single fixed separation, only features with angular separations equal to the resolution are resolved, and direction is important as well. If Legolas' eyes are oriented horizontally, he won't be able to resolve structure in the vertical direction using interferometric techniques. So he'd at the very least need to tilt his head sideways, and probably also jiggle it around a lot (including some rotation) again to get decent sampling of different baseline orientations. Still, it seems like with a sufficiently sophisticated processor (elf brain?) he could achieve the reported observation.
Luboš Motl points out some other possible difficulties with interferometry in his answer, primarily that the combination of a polychromatic source and a detector spacing many times larger than the observed wavelength lead to no correlation in the phase of the light entering the two detectors. While true, Legolas may be able to get around this if his eyes (specifically the photoreceptors) are sufficiently sophisticated so as to act as a simultaneous high-resolution imaging spectrometer or integral field spectrograph and interferometer. This way he could pick out signals of a given wavelength and use them in his interferometric processing.
A couple of the other answers and comments mention the potential difficulty drawing a sight line to a point $24\rm km$ away due to the curvature of the Earth. As has been pointed out, Legolas just needs to have an advantage in elevation of about $90\ \mathrm m$ (the radial distance from a circle $6400\ \mathrm{km}$ in radius to a tangent $24\ \mathrm{km}$ along the circumference; Middle-Earth is apparently about Earth-sized, or may be Earth in the past, though I can't really nail this down with a canonical source after a quick search). He doesn't need to be on a mountaintop or anything, so it seems reasonable to just assume that the geography allows a line of sight.
Finally a bit about "clean air". In astronomy (if you haven't guessed my field yet, now you know.) we refer to distortions caused by the atmosphere as "seeing". Seeing is often measured in arcseconds ($3600'' = 60' = 1^\circ$), referring to the limit imposed on angular resolution by atmospheric distortions. The best seeing, achieved from mountaintops in perfect conditions, is about $1''$, or in radians $4.8\times10^{-6}$. This is about the same angular resolution as Legolas' amazing interferometric eyes. I'm not sure what seeing would be like horizontally across a distance of $24\ \mathrm{km}$. On the one hand there is a lot more air than looking up vertically; the atmosphere is thicker than $24\ \mathrm{km}$ but its density drops rapidly with altitude. On the other hand the relatively uniform density and temperature at fixed altitude would cause less variation in refractive index than in the vertical direction, which might improve seeing. If I had to guess, I'd say that for very still air at uniform temperature he might get seeing as good as $1\rm arcsec$, but with more realistic conditions with the Sun shining, mirage-like effects probably take over limiting the resolution that Legolas can achieve.


Question:
Converting regular expressions into (minimal) NFA that accept the same language is easy with standard algorithms, e.g. Thompson's algorithm. The other direction seems to be more tedious, though, and sometimes the resulting expressions are messy.
What algorithms are there for converting NFA into equivalent regular expressions? Are there advantages regarding time complexity or result size?
This is supposed to be a reference question. Please include a general decription of your method as well as a non-trivial example.

There are several methods to do the conversion from finite automata to regular expressions. Here I will describe the one usually taught in school which is very visual. I believe it is the most used in practice. However, writing the algorithm is not such a good idea.
State removal method
This algorithm is about handling the graph of the automaton and is thus not very suitable for algorithms since it needs graph primitives such as ... state removal. I will describe it using higher-level primitives.
The key idea
The idea is to consider regular expressions on edges and then removing intermediate states while keeping the edges labels consistent.
The main pattern can be seen in the following to figures. The first has labels between $p,q,r$ that are regular expressions $e,f,g,h,i$ and we want to remove $q$.

Once removed, we compose $e,f,g,h,i$ together (while preserving the other edges between $p$ and $r$ but this is not displayed on this):

Example
Using the same example as in Raphael's answer:

we successively remove $q_2$:

and then $q_3$:

then we still have to apply a star on the expression from $q_1$ to $q_1$. In this case, the final state is also initial so we really just need to add a star:
$$ (ab+(b+aa)(ba)^*(a+bb))^* $$
Algorithm
L[i,j] is the regexp of the language from $q_i$ to $q_j$. First, we remove all multi-edges:
for i = 1 to n:
  for j = 1 to n:
    if i == j then:
      L[i,j] := ε
    else:
      L[i,j] := ∅
    for a in Σ:
      if trans(i, a, j):
        L[i,j] := L[i,j] + a

Now, the state removal. Suppose we want to remove the state $q_k$:
remove(k):
  for i = 1 to n:
    for j = 1 to n:
      L[i,i] += L[i,k] . star(L[k,k]) . L[k,i]
      L[j,j] += L[j,k] . star(L[k,k]) . L[k,j]
      L[i,j] += L[i,k] . star(L[k,k]) . L[k,j]
      L[j,i] += L[j,k] . star(L[k,k]) . L[k,i]

Note that both with a pencil of paper and with an algorithm you should simplify expressions like star(ε)=ε, e.ε=e, ∅+e=e, ∅.e=∅ (By hand you just don't write the edge when it's not $∅$, or even $ε$ for a self-loop and you ignore when there is no transition between $q_i$ and $q_k$ or $q_j$ and $q_k$)
Now, how to use remove(k)? You should not remove final or initial states lightly, otherwise you will miss parts of the language.
for i = 1 to n:
  if not(final(i)) and not(initial(i)):
    remove(i)

If you have only one final state $q_f$ and one initial state $q_s$ then the final expression is:
e := star(L[s,s]) . L[s,f] . star(L[f,s] . star(L[s,s]) . L[s,f] + L[f,f])

If you have several final states (or even initial states) then there is no simple way of merging these ones, other than applying the transitive closure method. Usually this is not a problem by hand but this is awkward when writing the algorithm. A much simpler workaround is to enumerate all pairs $(s,f)$ and run the algorithm on the (already state-removed) graph to get all expressions $e_{s,f}$ supposing $s$ is the only initial state and $f$ is the only final state, then doing the union of all $e_{s,f}$.
This, and the fact that this is modifying languages more dynamically than the first method make it more error-prone when programming. I suggest using any other method.
Cons
There are a lot of cases in this algorithm, for example for choosing which node we should remove, the number of final states at the end, the fact that a final state can be initial, too etc.
Note that now that the algorithm is written, this is a lot like the transitive closure method. Only the context of the usage is different. I do not recommend implementing the algorithm, but using the method to do that by hand is a good idea.


Question:
I have a set of BAM files that are aligned using the NCBI GRCh37 human genome reference (with the chromosome names as NC_000001.10) but I want to analyze it using a BED file that has the UCSC hg19 chromosome names (e.g. chr1). I want to use bedtools to pull out all the on-target and off-target reads.

Are NCBI and UCSC directly comparable? Or do I need to re-align the BAM/lift-over the BED to the UCSC reference?
Should I convert the BED file or the BAM file? Everyone here uses the UCSC chromosome names/positions so I'll need to convert the eventual files to UCSC anyway.

You're the second person I have ever seen using NCBI "chromosome names" (they're more like supercontig IDs). Normally I would point you to a resource providing mappings between chromosome names, but since no one has added NCBI names (yet, maybe I'll add them now) you're currently out of luck there.
Anyway, the quickest way to do what you want is to samtools view -H foo.bam > header to get the BAM header and then change each NCBI "chromosome name" to its corresponding UCSC chromosome name. DO NOT REORDER THE LINES! You can then use samtools reheader and be done.
Why, you might ask, would this work? The answer is that chromosome/contig names in BAM files aren't stored in each alignment. Rather, the names are stored in a list in the header and each alignment just contains the integer index into that list (read group IDs are similar, for what it's worth). This also leads to the warning above against reordering entries, since that's a VERY convenient way to start swapping alignments between chromosomes.
As an aside, you'd be well served switching to Gencode or Ensembl chromosome names, they're rather more coherent than the something_random mess that's present in hg19 from UCSC.
Update: Because I'm nice, here is the conversion between NCBI and UCSC. Note that if you have any alignments to patches that there is simply no UCSC equivalent. One of the many reasons not to use UCSC (avoid their annotations too).