Question: While hiking on the northern Idaho-Montana border, I encountered a large area where virtually every tree is bent at the base in the downhill direction.  Only the very largest and very smallest trees are straight.  What could cause this?

The phenomenon in question is probably related to geotropism.
If the hill soil is "on the move" it will cause the bend on the trees -

If the soil in a slope is moving downward, the trees on this slope
  will tip downward.  As the tree continues to try to grow upward, the
  trunk will show a curve. The degree of bending could indicate the rate
  or amount of movement of the soil.

source


Question:
I got a bunch of vcf files (v4.1) with structural variations of bunch of non-model organisms (i.e. there are no known variants). I found there are quite a some tools to manipulate vcf files like VCFtools, R package vcfR or python library PyVCF. However none of them seems to provide a quick summary, something like (preferably categorised by size as well):
type    count
DEL     x
INS     y
INV     z
....

Is there any tool or a function I overlooked that produces summaries of this style?
I know that vcf file is just a plain text file and if I will dissect REF and ALT columns I should be able to write a script that will do the job, but I hoped that I could avoid to write my own parser.
--- edit ---
So far it seems that only tool that aims to do summaries (@gringer answer) is not working on vcf v4.1. Other tools would provide just partial solution by filtering certain variant type. Therefore I accept my own parser perl/R solutions, till there will be a working tool for stats of vcf with structural variants.

According to the bcftools man page, it is able to produce statistics using the command bcftools stats. Running this myself, the statistics look like what you're asking for:
# This file was produced by bcftools stats (1.2-187-g1a55e45+htslib-1.2.1-256-ga356746) and can be plotted using plot-vcfstats.
# The command line was: bcftools stats  OVLNormalised_STARout_KCCG_called.vcf.gz
#
# Definition of sets:
# ID    [2]id   [3]tab-separated file names
ID  0   OVLNormalised_STARout_KCCG_called.vcf.gz
# SN, Summary numbers:
# SN    [2]id   [3]key  [4]value
SN  0   number of samples:  108
SN  0   number of records:  333
SN  0   number of no-ALTs:  0
SN  0   number of SNPs: 313
SN  0   number of MNPs: 0
SN  0   number of indels:   20
SN  0   number of others:   0
SN  0   number of multiallelic sites:   0
SN  0   number of multiallelic SNP sites:   0
# TSTV, transitions/transversions:
# TSTV  [2]id   [3]ts   [4]tv   [5]ts/tv    [6]ts (1st ALT) [7]tv (1st ALT) [8]ts/tv (1st ALT)
TSTV    0   302 11  27.45   302 11  27.45
# SiS, Singleton stats:
...
# IDD, InDel distribution:
# IDD   [2]id   [3]length (deletions negative)  [4]count
IDD 0   -9  1
IDD 0   -2  4
IDD 0   -1  6
IDD 0   1   4
IDD 0   2   1
IDD 0   3   3
IDD 0   4   1
# ST, Substitution types:
# ST    [2]id   [3]type [4]count
ST  0   A>C 2
ST  0   A>G 78
ST  0   A>T 2
ST  0   C>A 5
ST  0   C>G 0
ST  0   C>T 66
ST  0   G>A 67
ST  0   G>C 0
ST  0   G>T 1
ST  0   T>A 1
ST  0   T>C 91
ST  0   T>G 0
# DP, Depth distribution
# DP    [2]id   [3]bin  [4]number of genotypes  [5]fraction of genotypes (%)    [6]number of sites  [7]fraction of sites (%)
DP  0   >500    0   0.000000    333 100.000000

This is annotating what is explicitly in the VCF file, and that's SNVs (and INDELs). If you want a structural variant analysis (i.e. on a larger scale than single nucleotides), then you'll need to use something that does more than a summary of the VCF file.
While Inversions, large-scale deletions, and breakpoints are part of the 4.1 specifications, they are unfortunately not currently supported by bcftools.


Question:
To find the median of an unsorted array, we can make a min-heap in $O(n\log n)$ time for $n$ elements, and then we can extract one by one $n/2$ elements to get the median. But this approach would take $O(n \log n)$ time.
Can we do the same by some method in $O(n)$ time? If we can, then how?

This is a special case of a selection algorithm that can find the $k$th smallest element of an array with $k$ is the half of the size of the array. There is an implementation that is linear in the worst case.
Generic selection algorithm
First let's see an algorithm find-kth that finds the $k$th smallest element of an array:
find-kth(A, k)
  pivot = random element of A
  (L, R) = split(A, pivot)
  if k = |L|+1, return pivot
  if k ≤ |L|  , return find-kth(L, k)
  if k > |L|+1, return find-kth(R, k-(|L|+1))

The function split(A, pivot) returns L,R such that all elements in R are greater than pivot and L all the others (minus one occurrence of pivot). Then all is done recursively.
This is $O(n)$ in average but $O(n^2)$ in the worst case.
Linear worst case: the median-of-medians algorithm
A better pivot is the median of all the medians of sub arrays of A of size 5, by using calling the procedure on the array of these medians.
find-kth(A, k)
  B = [median(A[1], .., A[5]), median(A[6], .., A[10]), ..]
  pivot = find-kth(B, |B|/2)
  ...

This guarantees $O(n)$ in all cases. It is not that obvious. These powerpoint slides are helpful both at explaining the algorithm and the complexity.
Note that most of the time using a random pivot is faster.


Question:
Biopython's .count() methods, like Python's str.count(), perform a non-overlapping count, how can I do an overlapping one?
For example, these code snippets return 2, but I want the answer 3:
>>> from Bio.Seq import Seq
>>> Seq('AAAA').count('AA')
2
>>> 'AAAA'.count('AA')
2

For Biopython 1.70, there is a new Seq.count_overlap() method, which includes optional start and end arguments:
>>> from Bio.Seq import Seq
>>> Seq('AAAA').count_overlap('AA')
3
>>> Seq('AAAA').count_overlap('AA', 1, 4)
2

This method is also implemented for the MutableSeq and UnknownSeq classes:
>>> from Bio.Seq import MutableSeq, UnknownSeq
>>> MutableSeq('AAAA').count_overlap('AA')
3
>>> UnknownSeq(4, character='A').count_overlap('AA')
3

Disclaimer: I co-contributed the .count_overlap() methods with Peter Cock, see 97709cc


Question:
What are common cost functions used in evaluating the performance of neural networks?
Details
(feel free to skip the rest of this question, my intent here is simply to provide clarification on notation that answers may use to help them be more understandable to the general reader)
I think it would be useful to have a list of common cost functions, alongside a few ways that they have been used in practice. So if others are interested in this I think a community wiki is probably the best approach, or we can take it down if it's off topic.
Notation
So to start, I'd like to define a notation that we all use when describing these, so the answers fit well with each other.
This notation is from Neilsen's book.
A Feedforward Neural Network is a many layers of neurons connected together. Then it takes in an input, that input "trickles" through the network and then the neural network returns an output vector.
More formally, call $a^i_j$ the activation (aka output) of the $j^{th}$ neuron in the $i^{th}$ layer, where $a^1_j$ is the $j^{th}$ element in the input vector.
Then we can relate the next layer's input to it's previous via the following relation:
$a^i_j = \sigma(\sum\limits_k (w^i_{jk} \cdot a^{i-1}_k) + b^i_j)$
where
$\sigma$ is the activation function,
$w^i_{jk}$ is the weight from the $k^{th}$ neuron in the $(i-1)^{th}$ layer to the $j^{th}$ neuron in the $i^{th}$ layer,
$b^i_j$ is the bias of the $j^{th}$ neuron in the $i^{th}$ layer, and
$a^i_j$ represents the activation value of the $j^{th}$ neuron in the $i^{th}$ layer.
Sometimes we write $z^i_j$ to represent $\sum\limits_k (w^i_{jk} \cdot a^{i-1}_k) + b^i_j$, in other words, the activation value of a neuron before applying the activation function.

For more concise notation we can write
$a^i = \sigma(w^i \times a^{i-1} + b^i)$
To use this formula to compute the output of a feedforward network for some input $I \in \mathbb{R}^n$, set $a^1 = I$, then compute $a^2$, $a^3$, ...,$a^m$, where m is the number of layers.
Introduction
A cost function is a measure of "how good" a neural network did with respect to it's given training sample and the expected output. It also may depend on variables such as weights and biases.
A cost function is a single value, not a vector, because it rates how good the neural network did as a whole.
Specifically, a cost function is of the form
$$C(W, B, S^r, E^r)$$
where $W$ is our neural network's weights, $B$ is our neural network's biases, $S^r$ is the input of a single training sample, and $E^r$ is the desired output of that training sample. Note this function can also potentially be dependent on $y^i_j$ and $z^i_j$ for any neuron $j$ in layer $i$, because those values are dependent on $W$, $B$, and $S^r$.
In backpropagation, the cost function is used to compute the error of our output layer, $\delta^L$, via
$$\delta^L_j = \frac{\partial C}{\partial a^L_j} \sigma^{ \prime}(z^i_j)$$.
Which can also be written as a vector via
$$\delta^L = \nabla_a C \odot \sigma^{ \prime}(z^i)$$.
We will provide the gradient of the cost functions in terms of the second equation, but if one wants to prove these results themselves, using the first equation is recommended because it's easier to work with.
Cost function requirements
To be used in backpropagation, a cost function must satisfy two properties:
1: The cost function $C$ must be able to be written as an average
$$C=\frac{1}{n} \sum\limits_x C_x$$
over cost functions $C_x$ for individual training examples, $x$.
This is so it allows us to compute the gradient (with respect to weights and biases) for a single training example, and run Gradient Descent.
2: The cost function $C$ must not be dependent on any activation values of a neural network besides the output values $a^L$.
Technically a cost function can be dependent on any $a^i_j$ or $z^i_j$. We just make this restriction so we can backpropagte, because the equation for finding the gradient of the last layer is the only one that is dependent on the cost function (the rest are dependent on the next layer). If the cost function is dependent on other activation layers besides the output one, backpropagation will be invalid because the idea of "trickling backwards" no longer works.
Also, activation functions are required to have an output $0\leq a^L_j \leq 1$ for all $j$. Thus these cost functions need to only be defined within that range (for example, $\sqrt{a^L_j}$ is valid since we are guaranteed $a^L_j \geq 0$).

Here are those I understand so far. Most of these work best when given values between 0 and 1.
Quadratic cost
Also known as mean squared error, this is defined as:
$$C_{MST}(W, B, S^r, E^r) = 0.5\sum\limits_j (a^L_j - E^r_j)^2$$
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C_{MST} = (a^L - E^r)$$
Cross-entropy cost
Also known as Bernoulli negative log-likelihood and Binary Cross-Entropy
$$C_{CE}(W, B, S^r, E^r) = -\sum\limits_j [E^r_j \text{ ln } a^L_j + (1 - E^r_j) \text{ ln }(1-a^L_j)]$$
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C_{CE} = \frac{(a^L - E^r)}{(1-a^L)(a^L)}$$
Exponentional cost
This requires choosing some parameter $\tau$ that you think will give you the behavior you want. Typically you'll just need to play with this until things work good.
$$C_{EXP}(W, B, S^r, E^r) = \tau\text{ }\exp(\frac{1}{\tau} \sum\limits_j (a^L_j - E^r_j)^2)$$
where $\text{exp}(x)$ is simply shorthand for $e^x$.
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C = \frac{2}{\tau}(a^L- E^r)C_{EXP}(W, B, S^r, E^r)$$
I could rewrite out $C_{EXP}$, but that seems redundant. Point is the gradient computes a vector and then multiplies it by $C_{EXP}$.
Hellinger distance
$$C_{HD}(W, B, S^r, E^r) = \frac{1}{\sqrt{2}}\sum\limits_j(\sqrt{a^L_j}-\sqrt{E^r_j})^2$$
You can find more about this here. This needs to have positive values, and ideally values between $0$ and $1$. The same is true for the following divergences.
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C = \frac{\sqrt{a^L}-\sqrt{E^r}}{\sqrt{2}\sqrt{a^L}}$$
Kullback–Leibler divergence
Also known as Information Divergence, Information Gain, Relative entropy, KLIC, or KL Divergence (See here).
Kullback–Leibler divergence is typically denoted $$D_{\mathrm{KL}}(P\|Q) = \sum_i P(i) \, \ln\frac{P(i)}{Q(i)}$$,
where $D_{\mathrm{KL}}(P\|Q)$ is a measure of the information lost when $Q$ is used to approximate $P$. Thus we want to set $P=E^i$ and $Q=a^L$, because we want to measure how much information is lost when we use $a^i_j$ to approximate $E^i_j$. This gives us
$$C_{KL}(W, B, S^r, E^r)=\sum\limits_jE^r_j \log \frac{E^r_j}{a^L_j}$$
The other divergences here use this same idea of setting $P=E^i$ and $Q=a^L$.
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C = -\frac{E^r}{a^L}$$
Generalized Kullback–Leibler divergence
From here.
$$C_{GKL}(W, B, S^r, E^r)=\sum\limits_j E^r_j \log \frac{E^r_j}{a^L_j} -\sum\limits_j(E^r_j) + \sum\limits_j(a^L_j)$$
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C = \frac{a^L-E^r}{a^L}$$
Itakura–Saito distance
Also from here.
$$C_{GKL}(W, B, S^r, E^r)= \sum_j \left(\frac {E^r_j}{a^L_j} - \log \frac{E^r_j}{a^L_j} - 1 \right)$$
The gradient of this cost function with respect to the output of a neural network and some sample $r$ is:
$$\nabla_a C = \frac{a^L-E^r}{\left(a^L\right)^2}$$
Where $\left(\left(a^L\right)^2\right)_j = a^L_j \cdot a^L_j$. In other words, $\left( a^L\right) ^2$ is simply equal to squaring each element of $a^L$.


Question:
Fortran has a special place in numerical programming. You can certainly make good and fast software in other languages, but Fortran keeps performing very well despite its age. Moreover, it's easier to make fast programs in Fortran. I've made fast programs in C++, but you have to be more careful about things like pointer aliasing. So, there has to be a reason for this, and a very technical one. Is it because the compiler can optimize more? I would really like to know technical details, so if I use another language I can take these things into consideration.
For example, I know -or so I think- that one thing is that the standard specifies that pointers are contiguous in memory always which means faster memory access. I believe you can do this in C++ by giving a flag to the compiler. In this way it helps to know what Fortran does good, so that if using another language we can imitate this.

Language designers face many choices.  Ken Kennedy emphasized two: (1) better abstractions and (2) higher- or lower-level (less or more machine-like) code.  While functional languages like Haskell and Scheme focus on the former, traditional scientific-computing languages like Fortran and C/C++ focused on the latter.  Saying that one language is faster than another is usually quite misleading: each language has a problem domain for which it excels. Fortran fares better in the domain of array-based numerical codes than other languages for two basic reasons: its array model and its explicitness.
Array Model
Fortran programmers largely do array manipulations. For that, Fortran facilitates several compiler optimizations that are not available in other languages. The best example is vectorization: knowing the data layout enables the compiler to invoke assembly-level intrinsics over the array.
Language Explicitness
While it seems that a simpler language should compile "better" than a more complex one, that really isn't the case.  When one writes in an assembly language, there isn't much a compiler can do: all it sees are very-fine-grained instructions. Fortran requires explicitness (thus, more work by the programmer) only in cases that yield real rewards for array-based computing. Fortran uses simple data types, basic control flow, and limited namespaces; by contrast, it does not tell the computer how to load registers (which might be necessary for real-time).  Where Fortran is explicit, it enables things like complete type inference, which helps novices to get started.  It also avoids one thing that often makes C slow: opaque pointers.
Fortran Can Be Slow
Fortran is not fast for every task: that's why not many people use it for building GUIs or even for highly unstructured scientific computing.  Once you leave the world of arrays for graphs, decision trees, and other realms, this speed advantage quickly goes away.  See the computer language benchmarks for some examples and numbers.


Question:
I have a dataset and would like to figure out which distribution fits my data best.
I used the fitdistr() function to estimate the necessary parameters to describe the assumed distribution (i.e. Weibull, Cauchy, Normal). Using those parameters I can conduct a Kolmogorov-Smirnov Test to estimate whether my sample data is from the same distribution as my assumed distribution.
If the p-value is > 0.05 I can assume that the sample data is drawn from the same distribution. But the p-value doesn't provide any information about the godness of fit, isn't it?
So in case the p-value of my sample data is > 0.05 for a normal distribution as well as a weibull distribution, how can I know which distribution fits my data better?
This is basically the what I have done:
> mydata
 [1] 37.50 46.79 48.30 46.04 43.40 39.25 38.49 49.51 40.38 36.98 40.00
[12] 38.49 37.74 47.92 44.53 44.91 44.91 40.00 41.51 47.92 36.98 43.40
[23] 42.26 41.89 38.87 43.02 39.25 40.38 42.64 36.98 44.15 44.91 43.40
[34] 49.81 38.87 40.00 52.45 53.13 47.92 52.45 44.91 29.54 27.13 35.60
[45] 45.34 43.37 54.15 42.77 42.88 44.26 27.14 39.31 24.80 16.62 30.30
[56] 36.39 28.60 28.53 35.84 31.10 34.55 52.65 48.81 43.42 52.49 38.00
[67] 38.65 34.54 37.70 38.11 43.05 29.95 32.48 24.63 35.33 41.34

# estimate shape and scale to perform KS-test for weibull distribution
> fitdistr(mydata, "weibull")
     shape        scale
   6.4632971   43.2474500
 ( 0.5800149) ( 0.8073102)

# KS-test for weibull distribution
> ks.test(mydata, "pweibull", scale=43.2474500, shape=6.4632971)

        One-sample Kolmogorov-Smirnov test

data:  mydata
D = 0.0686, p-value = 0.8669
alternative hypothesis: two-sided

# KS-test for normal distribution
> ks.test(mydata, "pnorm", mean=mean(mydata), sd=sd(mydata))

        One-sample Kolmogorov-Smirnov test

data:  mydata
D = 0.0912, p-value = 0.5522
alternative hypothesis: two-sided

The p-values are 0.8669 for the Weibull distribution, and 0.5522 for the normal distribution. Thus I can assume that my data follows a Weibull as well as a normal distribution. But which distribution function describes my data better?

Referring to elevendollar I found the following code, but don't know how to interpret the results:
fits <- list(no = fitdistr(mydata, "normal"),
             we = fitdistr(mydata, "weibull"))
sapply(fits, function(i) i$loglik)
       no        we
-259.6540 -257.9268

First, here are some quick comments:

The $p$-values of a Kolmogorov-Smirnov-Test (KS-Test) with estimated parameters can be quite wrong because the p-value does not take the uncertainty of the estimation into account. So unfortunately, you can't just fit a distribution and then use the estimated parameters in a Kolmogorov-Smirnov-Test to test your sample. There is a normality test called Lilliefors test which is a modified version of the KS-Test that allows for estimated parameters.
Your sample will never follow a specific distribution exactly. So even if your $p$-values from the KS-Test would be valid and $>0.05$, it would just mean that you can't rule out that your data follow this specific distribution. Another formulation would be that your sample is compatible with a certain distribution. But the answer to the question "Does my data follow the distribution xy exactly?" is always no.
The goal here cannot be to determine with certainty what distribution your sample follows. The goal is what @whuber (in the comments) calls parsimonious approximate descriptions of the data. Having a specific parametric distribution can be useful as a model of the data (such as the model "earth is a sphere" can be useful).

But let's do some exploration. I will use the excellent fitdistrplus package which offers some nice functions for distribution fitting. We will use the functiondescdist to gain some ideas about possible candidate distributions.
library(fitdistrplus)
library(logspline)

x <- c(37.50,46.79,48.30,46.04,43.40,39.25,38.49,49.51,40.38,36.98,40.00,
38.49,37.74,47.92,44.53,44.91,44.91,40.00,41.51,47.92,36.98,43.40,
42.26,41.89,38.87,43.02,39.25,40.38,42.64,36.98,44.15,44.91,43.40,
49.81,38.87,40.00,52.45,53.13,47.92,52.45,44.91,29.54,27.13,35.60,
45.34,43.37,54.15,42.77,42.88,44.26,27.14,39.31,24.80,16.62,30.30,
36.39,28.60,28.53,35.84,31.10,34.55,52.65,48.81,43.42,52.49,38.00,
38.65,34.54,37.70,38.11,43.05,29.95,32.48,24.63,35.33,41.34)

Now let's use descdist:
descdist(x, discrete = FALSE)

The kurtosis and squared skewness of your sample are plotted as a blue point named "Observation". It seems that possible distributions include the Weibull, Lognormal and possibly the Gamma distribution.
Let's fit a Weibull distribution and a normal distribution:
fit.weibull <- fitdist(x, "weibull")
fit.norm <- fitdist(x, "norm")

Now inspect the fit for the normal:
plot(fit.norm)

And for the Weibull fit:
plot(fit.weibull)

Both look good but judged by the QQ-Plot, the Weibull maybe looks a bit better, especially in the tails. Correspondingly, the AIC of the Weibull fit is lower compared with the normal fit:
fit.weibull$aic
[1] 519.8537

fit.norm$aic
[1] 523.3079

Kolmogorov-Smirnov test simulation
I will use @Aksakal's procedure explained here to simulate the KS-statistic under the null.
n.sims <- 5e4

stats <- replicate(n.sims, {
  r <- rweibull(n = length(x)
                , shape= fit.weibull$estimate["shape"]
                , scale = fit.weibull$estimate["scale"]
  )
  estfit.weibull <- fitdist(r, "weibull") # added to account for the estimated parameters
  as.numeric(ks.test(r
                     , "pweibull"
                     , shape= estfit.weibull$estimate["shape"]
                     , scale = estfit.weibull$estimate["scale"])$statistic
  )
})

The ECDF of the simulated KS-statistics looks as follows:
plot(ecdf(stats), las = 1, main = "KS-test statistic simulation (CDF)", col = "darkorange", lwd = 1.7)
grid()

Finally, our $p$-value using the simulated null distribution of the KS-statistics is:
fit <- logspline(stats)

1 - plogspline(ks.test(x
                       , "pweibull"
                       , shape= fit.weibull$estimate["shape"]
                       , scale = fit.weibull$estimate["scale"])$statistic
               , fit
)

[1] 0.4889511

This confirms our graphical conclusion that the sample is compatible with a Weibull distribution.
As explained here, we can use bootstrapping to add pointwise confidence intervals to the estimated Weibull PDF or CDF:
xs <- seq(10, 65, len=500)

true.weibull <- rweibull(1e6, shape= fit.weibull$estimate["shape"]
                         , scale = fit.weibull$estimate["scale"])

boot.pdf <- sapply(1:1000, function(i) {
  xi <- sample(x, size=length(x), replace=TRUE)
  MLE.est <- suppressWarnings(fitdist(xi, distr="weibull"))
  dweibull(xs, shape=MLE.est$estimate["shape"],  scale = MLE.est$estimate["scale"])
}
)

boot.cdf <- sapply(1:1000, function(i) {
  xi <- sample(x, size=length(x), replace=TRUE)
  MLE.est <- suppressWarnings(fitdist(xi, distr="weibull"))
  pweibull(xs, shape= MLE.est$estimate["shape"],  scale = MLE.est$estimate["scale"])
}
)

#-----------------------------------------------------------------------------
# Plot PDF
#-----------------------------------------------------------------------------

par(bg="white", las=1, cex=1.2)
plot(xs, boot.pdf[, 1], type="l", col=rgb(.6, .6, .6, .1), ylim=range(boot.pdf),
     xlab="x", ylab="Probability density")
for(i in 2:ncol(boot.pdf)) lines(xs, boot.pdf[, i], col=rgb(.6, .6, .6, .1))

# Add pointwise confidence bands

quants <- apply(boot.pdf, 1, quantile, c(0.025, 0.5, 0.975))
min.point <- apply(boot.pdf, 1, min, na.rm=TRUE)
max.point <- apply(boot.pdf, 1, max, na.rm=TRUE)
lines(xs, quants[1, ], col="red", lwd=1.5, lty=2)
lines(xs, quants[3, ], col="red", lwd=1.5, lty=2)
lines(xs, quants[2, ], col="darkred", lwd=2)

#-----------------------------------------------------------------------------
# Plot CDF
#-----------------------------------------------------------------------------

par(bg="white", las=1, cex=1.2)
plot(xs, boot.cdf[, 1], type="l", col=rgb(.6, .6, .6, .1), ylim=range(boot.cdf),
     xlab="x", ylab="F(x)")
for(i in 2:ncol(boot.cdf)) lines(xs, boot.cdf[, i], col=rgb(.6, .6, .6, .1))

# Add pointwise confidence bands

quants <- apply(boot.cdf, 1, quantile, c(0.025, 0.5, 0.975))
min.point <- apply(boot.cdf, 1, min, na.rm=TRUE)
max.point <- apply(boot.cdf, 1, max, na.rm=TRUE)
lines(xs, quants[1, ], col="red", lwd=1.5, lty=2)
lines(xs, quants[3, ], col="red", lwd=1.5, lty=2)
lines(xs, quants[2, ], col="darkred", lwd=2)
#lines(xs, min.point, col="purple")
#lines(xs, max.point, col="purple")

Automatic distribution fitting with GAMLSS
The gamlss package for R offers the ability to try many different distributions and select the "best" according to the GAIC (the generalized Akaike information criterion). The main function is fitDist. An important option in this function is the type of the distributions that are tried. For example, setting type = "realline" will try all implemented distributions defined on the whole real line whereas type = "realsplus" will only try distributions defined on the real positive line. Another important option is the parameter $k$, which is the penalty for the GAIC. In the example below, I set the parameter $k = 2$ which means that the "best" distribution is selected according to the classic AIC. You can set $k$ to anything you like, such as $\log(n)$ for the BIC.
library(gamlss)
library(gamlss.dist)
library(gamlss.add)

x <- c(37.50,46.79,48.30,46.04,43.40,39.25,38.49,49.51,40.38,36.98,40.00,
       38.49,37.74,47.92,44.53,44.91,44.91,40.00,41.51,47.92,36.98,43.40,
       42.26,41.89,38.87,43.02,39.25,40.38,42.64,36.98,44.15,44.91,43.40,
       49.81,38.87,40.00,52.45,53.13,47.92,52.45,44.91,29.54,27.13,35.60,
       45.34,43.37,54.15,42.77,42.88,44.26,27.14,39.31,24.80,16.62,30.30,
       36.39,28.60,28.53,35.84,31.10,34.55,52.65,48.81,43.42,52.49,38.00,
       38.65,34.54,37.70,38.11,43.05,29.95,32.48,24.63,35.33,41.34)

fit <- fitDist(x, k = 2, type = "realplus", trace = FALSE, try.gamlss = TRUE)

summary(fit)

*******************************************************************
Family:  c("WEI2", "Weibull type 2")

Call:  gamlssML(formula = y, family = DIST[i], data = sys.parent())

Fitting method: "nlminb"

Coefficient(s):
             Estimate  Std. Error  t value   Pr(>|t|)
eta.mu    -24.3468041   2.2141197 -10.9962 < 2.22e-16 ***
eta.sigma   1.8661380   0.0892799  20.9021 < 2.22e-16 ***

According to the AIC, the Weibull distribution (more specifically WEI2, a special parametrization of it) fits the data best. The exact parameterization of the distribution WEI2 is detailed in this document on page 279. Let's inspect the fit by looking at the residuals in a worm plot (basically a de-trended Q-Q-plot):

We expect the residuals to be close to the middle horizontal line and 95% of them to lie between the upper and lower dotted curves, which act as 95% pointwise confidence intervals. In this case, the worm plot looks fine to me indicating that the Weibull distribution is an adequate fit.


Question:
After taking a statistics course and then trying to help fellow students, I noticed one subject that inspires much head-desk banging is interpreting the results of statistical hypothesis tests.  It seems that students easily learn how to perform the calculations required by a given test but get hung up on interpreting the results.  Many computerized tools report test results in terms of "p values" or "t values".
How would you explain the following points to college students taking their first course in statistics:

What does a "p-value" mean in relation to the hypothesis being tested?  Are there cases when one should be looking for a high p-value or a low p-value?
What is the relationship between a p-value and a t-value?

Understanding $p$-value
Suppose, that you want to test the hypothesis that the average height of male students at your University is $5$ ft $7$ inches. You collect heights of $100$ students selected at random and compute the sample mean (say it turns out to be $5$ ft $9$ inches). Using an appropriate formula/statistical routine you compute the $p$-value for your hypothesis and say it turns out to be $0.06$.
In order to interpret $p=0.06$ appropriately, we should keep several things in mind:

The first step under classical hypothesis testing is the assumption that the hypothesis under consideration is true. (In our context, we assume that the true average height is $5$ ft $7$ inches.)

Imagine doing the following calculation: Compute the probability that the sample mean is greater than $5$ ft $9$ inches assuming that our hypothesis is in fact correct (see point 1).

In other words, we want to know $$\mathrm{P}(\mathrm{Sample\: mean} \ge 5 \:\mathrm{ft} \:9 \:\mathrm{inches} \:|\: \mathrm{True\: value} = 5 \:\mathrm{ft}\: 7\: \mathrm{inches}).$$
The calculation in step 2 is what is called the $p$-value. Therefore, a $p$-value of $0.06$ would mean that if we were to repeat our experiment many, many times (each time we select $100$ students at random and compute the sample mean) then $6$ times out of $100$ we can expect to see a sample mean greater than or equal to $5$ ft $9$ inches.
Given the above understanding, should we still retain our assumption that our hypothesis is true (see step 1)? Well, a $p=0.06$ indicates that one of two things have happened:

(A) Either our hypothesis is correct and an extremely unlikely event has occurred (e.g., all $100$ students are student athletes)

or

(B) Our assumption is incorrect and the sample we have obtained is not that unusual.

The traditional way to choose between (A) and (B) is to choose an arbitrary cut-off for $p$. We choose (A) if $p > 0.05$ and (B) if $p < 0.05$.


Question:
In low-cost mass-produced items I often run into black blobs of what looks like resin applied directly on top of something on the PCB. What are these things exactly? I suspect this is some kind of custom IC that is layed out directly on the PCB to save on the plastic  housing/connector pins. Is this correct? If so, what is this technique called?

This is a photograph of the inside of a cheap digital multimeter. The black blob is the only non-basic piece of circuitry present, along with an op-amp (top) and a single bipolar junction transistor.

It's called chip-on-board. The die is glued to the PCB and wires are bonded from it to pads. The Pulsonix PCB software I use has it as an optional extra.
The main benefit is reduced cost, since you don't have to pay for a package.


Question:
We learned about the class of regular languages $\mathrm{REG}$. It is characterised by any one concept among regular expressions, finite automata and left-linear grammars, so it is easy to show that a given language is regular.
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 regular expressions (or for all finite automata, or for all left-linear grammars) 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.
This is intended to be a reference question collecting usual proof methods and application examples. See here for the same question on context-free languages.

Proof by contradiction is often used to show that a language is not regular: let $P$ a property true for all regular languages, if your specific language does not verify $P$, then it's not regular.
The following properties can be used:

The pumping lemma, as exemplified in Dave's answer;
Closure properties of regular languages (set operations, concatenation, Kleene star, mirror, homomorphisms);
A regular language has a finite number of prefix equivalence class, Myhill–Nerode theorem.

To prove that a language $L$ is not regular using closure properties, the technique is to combine $L$ with regular languages by operations that preserve regularity in order to obtain a language known to be not regular, e.g., the archetypical language $I= \{ a^n b^n \mid n \in \mathbb{N} \}$.
For instance, let $L= \{a^p b^q \mid p \neq q  \}$. Assume $L$ is regular, as regular languages are closed under complementation so is $L$'s complement $L^c$. Now take the intersection of $L^c$ and $a^\star b^\star$ which is regular, we obtain $I$ which is not regular.
The Myhill–Nerode theorem can be used to prove that $I$ is not regular.
For $p \geq 0 $, $I/a^p= \{ a^{r}b^rb^p\mid r \in \mathbb{N} \}=I.\{b^p\}$. All classes are different and there is a countable infinity of such classes. As a regular language must have a finite number of classes $I$ is not regular.


Question:
An incredible news story today is about a man who survived for two days at the bottom of the sea (~30 m deep) in a capsized boat, in an air bubble that formed in a corner of the boat. He was eventually rescued by divers who came to retrieve dead bodies. Details here. Since gases diffuse through water (and are dissolved in it) the composition of air in the bubble should be close to the atmosphere outside, if the surface of the bubble is large enough; so the excessive carbon dioxide is removed and oxygen is brought in to support life of a human.
Question: How large does the bubble have to be so that a person in it can have indefinite supply of breathable air?

Summary: I find a formula for the diameter of a bubble large enough to support one human and plug in known values to get $d=400\,{\rm m}$.
I'll have a quantitative stab at the answer to the question of how large an air bubble has to be for the carbon dioxide concentration to be in a breathable steady state, whilst a human is continuously producing carbon dioxide inside the bubble.
Fick's law of diffusion is that the flux of a quantity through a surface (amount per unit time per unit area) is proportional to the concentration gradient at that surface,
$$\vec{J} = - D \nabla \phi,$$
where $\phi$ is concentration and $D$ is the diffusivity of the species. We want to find the net flux out of the bubble at the surface, or $\vec{J} = -D_{\text{surface}} \nabla \phi$.
$D_{\text{surface}}$ is going to be some funny combination of the diffusivity of $CO_2$ in air and in water, but since the coefficient in water is so much lower, really diffusion is going to be dominated by this coefficient: it can't diffuse rapidly out of the surface and very slowly immediately outside the surface, because the concentration would then pile up in a thin layer immediately outside until it was high enough to start diffusing back in again. So I'm going to assume $D_{\text{surface}} = D_{\text{water}}$ here.
To estimate $\nabla \phi$, we can first assume $\phi(\text{surface})=\phi(\text{inside})$, fixing $\phi(\text{inside})$ from the maximum nonlethal concentration of CO2 in air and the molar density of air ($=P/RT$); then assuming the bubble is a sphere of radius $a$, because in a steady state the concentration outside is a harmonic function, we can find
$$\phi(r) = \phi(\text{far}) + \frac{(\phi(\text{inside})-\phi(\text{far}))a}{r},$$
where $\phi(\text{far})$ is the concentration far from the bubble, assumed to be constant. Then
$$\nabla \phi(a) = -\frac{(\phi(\text{inside})-\phi(\text{far}))a}{a^2} = -\frac{\phi(\text{inside})-\phi(\text{far})}{a}$$
yielding
$$J = D \frac{\phi(\text{inside})-\phi(\text{far})}{a}.$$
Next we integrate this over the surface of the bubble to get the net amount leaving the bubble, and set this $=$ the amount at which carbon dioxide is exhaled by the human, $\dot{N}$. Since for the above simplifications $J$ is constant over the surface (area $A$), this is just $JA$.
So we have
$$\dot{N} = D_{\text{water}} A \frac{\phi(\text{inside})-\phi(\text{far})}{a} = D_{\text{water}} 4 \pi a (\phi(\text{inside})-\phi(\text{far})).$$
Finally assuming $\phi(\text{far})=0$ for convenience, and rearranging for diameter $d=2a$
$$d = \frac{\dot{N}}{2 \pi D_{\text{water}} \phi(\text{inside})}$$
and substituting

$D = 1.6\times 10^{-9}\,{\rm m}^2\,{\rm s}^{-1}$ (from wiki)
$\phi \approx 1.2\,{\rm mol}\,{\rm m}^{-3}$ (from OSHA maximum safe level of 3% at STP)
$\dot{N}= 4\times 10^{-6}\,{\rm m}^3\,{\rm s}^{-1} = 4.8\times 10^{-6}\,{\rm mol}\,{\rm s}^{-1}$ (from $\%{\rm CO}_2 \approx 4\%$, lung capacity $\approx 500\,{\rm mL}$ and breath rate $\approx \frac{1}{5}\,{\rm s}^{-1}$)

I get $d \approx 400\,{\rm m}$.
It's interesting to note that this is independent of pressure: I've neglected pressure dependence of $D$ and human resilience to carbon dioxide, and the maximum safe concentration of carbon dioxide is independent of pressure, just derived from measurements at STP.
Finally, a bubble this large will probably rapidly break up due to buoyancy and Plateau-Rayleigh instabilities.


Question:
Hidden Markov models (HMMs) are used extensively in bioinformatics, and have been adapted for gene prediction, protein family classification, and a variety of other problems. Indeed, the treatise by Durbin, Eddy and colleagues is one of the defining volumes in this field.
Although the details of each of these different applications of HMMs differ, the core mathematical model remains unchanged, and there are efficient algorithms for computing the probability of the observed sequence given the model, or (perhaps more useful) the most likely hidden sequence given the sequence of observed states.
Accordingly, it seems plausible that there could be a generic software library for solving HMMs. As far as I can tell that's not the case, and most bioinformaticians end up writing HMMs from scratch. Perhaps there's a good reason for this? (Aside from the obvious fact that it's already difficult, nigh impossible, to get funding to build and provide long-term support for open source science software. Academic pressures incentivize building a new tool that you can publish a paper on much more than building on and extending existing tools.)
Do any generic HMM solver libraries exist? If so, would this be tempting enough for bioinformaticians to use rather than writing their own from scratch?

I would also recommend to take a look at pomegranate, a nice Python package for probabilistic graphical models. It includes solvers for HMMs and much more. Under the hood it uses Cythonised code, so it's also quite fast.


Question:
I was trying to figure out which piano keys were being played in an audio recording using spectral analysis, and I noticed that the harmonics are not integer multiple of the base note.  What is the reason for this?

Take a look at the spectrogram of a clean sample from a single piano key.  I am using Piano.ff.A4 from here.

The following is the same as above, with a superimposed reference grid of $ 440 ~\mathrm{Hz}$. As you can see, the harmonics have increasingly higher frequencies than integer multiples of $440 ~\mathrm{Hz}$.

At this point you might think that the actual base frequency is just slightly higher than $440  ~\mathrm{Hz}$.  So let us make a different reference grid, which lines up with the harmonic at ~$5060  ~\mathrm{Hz}$.

You can now clearly see that they aren't actually integer multiples of a base frequency.
Question: What is the explanation for this?  I am looking both for simple high-level explanations of what is happening, and more in-depth, instrument specific ones, which could maybe allow me to attempt to calculate the harmonics.
My first reaction was that this must be some non-linear effect.  But you can see that the harmonics do not change frequency at all as time passes and the sound gets quieter.  I would expect a non-linear effect to be pronounced only in the loudest part of the sample.

Update – I measured the frequencies using peak detection on the Fourier transform from 0.3 to 0.4 seconds in the sample.  This table compares the measured values with integer multiples of 440:
meas.   int. mult.
440.    440.
880.    880.
1330.   1320.
1780.   1760.
2230.   2200.
2680.   2640.
3140.   3080.
3610.   3520.
4090.   3960.
4570.   4400.
5060.   4840.
5570.   5280.

This effect is known as inharmonicity, and it is important for precision piano tuning.
Ideally, waves on a string satisfy the wave equation
$$v^2 \frac{\partial^2 y}{\partial x^2} = \frac{\partial^2 y}{\partial t^2}.$$
The left-hand side is from the tension in the string acting as a restoring force.
The solutions are of the form $\sin(kx - \omega t)$, where $\omega = kv$. Applying fixed boundary conditions, the allowed values of the wavenumber $k$ are integer multiples of the lowest possible wavenumber, which implies that the allowed frequencies are integer multiplies of the fundamental frequency. This predicts evenly spaced harmonics.
However, piano strings are made of thick wire. If you bend a thick wire, there's an extra restoring force in addition to the wire's tension, because the inside of the bend is compressed while the outside is stretched. One can show that this modifies the wave equation to
$$v^2 \frac{\partial^2 y}{\partial x^2} - A \frac{\partial^4 y}{\partial x^4} = \frac{\partial^2 y}{\partial t^2}.$$
Upon taking a Fourier transform, we have the nonlinear dispersion relation
$$\omega = kv \sqrt{1 + (A/v^2)k^2}$$
which "stretches" evenly spaced values of $k$ into nonuniformly spaced values of $\omega$. Higher harmonics are further apart. We can write this equation in terms of the harmonic frequencies $f_n$ as
$$f_n \propto n \sqrt{1+Bn^2}$$
which should yield a good fit to your data. Note that the frequencies have no dependence on the amplitude, as you noted, and this is because our modified wave equation is still linear in $y$.
This effect must be taken into account when tuning a piano, since we perceive two notes to be in tune when their harmonics overlap. This results in stretched tuning, where the intervals between the fundamental frequencies of different keys are slightly larger than one would expect. That is, a piano whose fundamental frequencies really were tuned to simple ratios would sound out of tune!


Question:
Let me clarify:
Given a scatterplot of some given number of points n, if I want to find the closest point to any point in the plot mentally, I can immediately ignore most points in the graph, narrowing my choices down to some small, constant number of points nearby.
Yet, in programming, given a set of points n, in order to find the closest point to any one, it requires checking every other point, which is ${\cal O}(n)$ time.
I am guessing that the visual sight of a graph is likely the equivalent of some data structure I am incapable of understanding; because with programming, by converting the points to a more structured method such as a quadtree, one can find the closest points to $k$ points in $n$ in $k\cdot\log(n)$ time, or ammortized ${\cal O}(\log n)$ time.
But there is still no known ${\cal O}(1)$ ammortized algorithms (that I can find) for point-finding after data restructuring.
So why does this appear to be possible with mere visual inspection?

Your model of what you do mentally is incorrect. In fact, you operate in two steps:

Eliminate all points that are too far, in $O(1)$ time.
Measure the $m$ points that are about as close, in $\Theta(m)$ time.

If you've played games like pétanque (bowls) or curling, this should be familiar — you don't need to examine the objects that are very far from the target, but you may need to measure the closest contenders.
To illustrate this point, which green dot is closest to the red dot? (Only by a little over 1 pixel, but there is one that's closest.) To make things easier, the dots have even been color-coded by distance.

This picture contains $m=10$ points which are nearly on a circle, and $n \gg 10$ green points in total. Step 1 lets you eliminate all but about $m$ points, but step 2 requires checking each of the $m$ points. There is no a priori bound for $m$.
A physical observation lets you shrink the problem size from the whole set of $n$ points to a restricted candidate set of $m$ points. This step is not a computation step as commonly understood, because it is based on a continuous process. Continuous processes are not subject to the usual intuitions about computational complexity and in particular to asymptotic analysis.
Now, you may ask, why can't a continuous process completely solve the problem? How does it come to these $m$ points, why can't we refine the process to get $m=1$?
The answer is that I cheated a bit: I presented a set of points which is generated to consists of $m$ almost-closest points and $n-m$ points which are further. In general, determining which points lie within a precise boundary requires a precise observation which has to be performed point by point. A coarse process of elimination lets you exclude many obvious non-candidates, but merely deciding which candidates are left requires enumerating them.
You can model this system in a discrete, computational world. Assume that the points are represented in a data structure that sorts them into cells on a grid, i.e. the point $(x,y)$ is stored in a list for the cell $(\lfloor x \rfloor, \lfloor y \rfloor)$. If you're looking for the points that are closest to $(x_0, y_0)$ and the cell that contains this point contains at most one other point, then it is sufficient to check the containing cell and the 8 neighboring cells. The total number of points in these 9 cells is $m$. This model respects some key properties of the human model:

$m$ is potentially unbounded — a degenerate worse case of e.g. points lying almost on a circle is always possible.
The practical efficiency depends on having selected a scale that matches the data (e.g. you'll save nothing if your dots are on a piece of paper and your cells are 1 km wide).


Question:
This is a problem that has haunted me for more than a decade. Not all the time - but from time to time, and always on windy or rainy days, it suddenly reappears in my mind, stares at me for half an hour to an hour, and then just grins at me, and whispers whole day: "You will never solve me..."
Please save me from this torturer.
Here it is:
Let's say there are two people and a sandwich. They want to share the sandwich, but they don't trust each other. However, they found the way how both of them will have a lunch without feeling deceived: One of them will cut the sandwich in two halves, and another will choose which half will be his. Fair, right?

The problem is:
Is there such mechanism for three people and a sandwich?

EDIT: This was roller-coaster for me. Now, it turns out that there are at least two books devoted exclusively on this problem and its variations:
Fair Division
Cake Cutting Algorithms

Yesterday, I was in a coffee shop in a small company. We ordered coffee and some chocolate cakes. As I was cutting my cake for my first bite, I felt sweat on my forehead. I thought, 'What if some of my buddies just interrupt me and say: Stop! You are not cutting the cake in a fair manner!' My hands started shaking in fear of that. But, no, nothing happened, fortunately.

For more than two, the moving knife is a nice solution.  Somebody takes a knife and moves it slowly across the sandwich.  Any player may say "cut".  At that moment, the sandwich is cut and the piece given to the one who said "cut".  As he has said that is an acceptable piece, he believes he has at least $\frac 1n$ of the sandwich.  The rest have asserted (by not saying "cut") that is it at most $\frac 1n$ of the sandwich, so the average available is now at least their share.  Recurse.


Question:
What are the actual differences between different annotation databases?
My lab, for reasons still unknown to me, prefers Ensembl annotations (we're working with transcript/exon expression estimation), while some software ship with RefSeq annotations. Are there significant differences between them today, or are they, for all intents and purposes, interchangeable (e.g., are exon coordinates between RefSeq and Ensembl annotations interchangeable)?

To add to rightskewed answer:
While it is true that:
Gencode is an additive set of annotation (the manual one done by Havana and an automated one done by Ensembl),
the annotation (GTF) files are quite similar for a few exceptions involving the X chromosome and Y par and additional remarks in the Gencode file (see more at FAQ - Gencode).

What are the actual differences between different annotation databases?

They are a few differences, but the main one  for me (and it could be stupid) is
that Refseq is developed by the American NCBI and
the ENSEMBL is mainly developed by the European EMBL-EBI.
Often, labs or people will just start using what is the best known to them (because of a course or workshop) or because they start working with one of the databases with one specific tool and keep with it later.

My lab, for reasons still unknown to me, prefers Ensembl annotations (we're working with transcript/exon expression estimation), while some software ship with RefSeq annotations.

Your lab might be mostly European based people or they might also have read papers like the one from Frankish et al.  Comparison of GENCODE and RefSeq gene annotation and the impact of reference geneset on variant effect prediction. BMC Genomics 2015; 16(Suppl 8):S2 - DOI: 10.1186/1471-2164-16-S8-S2
From the Frankish et al. paper paper:

The GENCODE Comprehensive transcripts contain more exons, have greater genomic coverage and capture many more variants than RefSeq in both genome and exome datasets, while the GENCODE Basic set shows a higher degree of concordance with RefSeq and has fewer unique features.

As for:

Are there significant differences between them today, or are they, for all intents and purposes, interchangeable (e.g., are exon coordinates between RefSeq and Ensembl annotations interchangeable)?

No. I don't think they are great differences between them as that the global picture should stay the same (although you will see different results if you are interested in a small set of genes). However, they are not directly interchangeable. Particularly as there are many versions of Ensembl and Refseq based on different genome annotations (and those won't be interchangeable between themselves either in most cases).
However, you can easily translate most[1] of your Refseq IDs to ENSEMBL IDs and vice-versa with tools as  for example (there are devoted libraries/API as well like Biocondutor: biomaRt
[1] Most as sometimes, they might be annotated in one of the database but haven't (yet) an equivalent in the other.
EDIT
In fine, even if people tends to keep to what they are used to (and that the annotations are constantly expanded and corrected) depending on the research subject one might be interested in using one database over another:
From Zhao S, Zhang B. A comprehensive evaluation of ensembl, RefSeq, and UCSC annotations in the context of RNA-seq read mapping and gene quantification. BMC Genomics. 2015;16: 97. paper:

When choosing an annotation database, researchers should keep in mind that no database is perfect and some gene annotations might be inaccurate or entirely wrong. [..] Wu et al. [27] suggested that when conducting research that emphasizes reproducible and robust gene expression estimates, a less complex genome annotation, such as RefGene, might be preferred. When conducting more exploratory research, a more complex genome annotation, such as Ensembl, should be chosen.
[..]
[27] Wu P-Y, Phan JH, Wang MD. Assessing the impact of human genome annotation choice on RNA-seq expression estimates. BMC Bioinformatics. 2013;14(Suppl 11):S8. doi: 10.1186/1471-2105-14-S11-S8.


Question: Even after having studied these for quite sometime, I tend to forget (if I'm out of touch for a while) how they are related to each other and what each stands for (since they have such similar sounding names). I'm hoping you'd come up with an explanation that is so intuitive and mathematically beautiful that they'll get embedded into my memory forever and this thread will serve as a super quick refresher whenever I (or anyone else) needs it.

I wrote this handout as a complement to Oppenheim and Willsky. Please take a look at Table 4.1 on page 14, reproduced below. (Click for larger image.) I wrote that table specifically to answer questions such as yours.

Note the similarities and differences among the four operations:

"Series": periodic in time, discrete in frequency
"Transform": aperiodic in time, continuous in frequency
"Continuous Time": continuous in time, aperiodic in frequency
"Discrete Time": discrete in time, periodic in frequency

I hope you find these notes helpful! Please feel free to distribute as you wish.


Question:
In the past, I've come across statements  along the lines of "function $f(x)$ has no closed form integral", which I assume means that there is no combination of the operations:

addition/subtraction
multiplication/division
raising to powers and roots
trigonometric functions
exponential functions
logarithmic functions

which when differentiated gives the function $f(x)$. I've heard this said about the function $f(x) = x^x$, for example.
What sort of techniques are used to prove statements like this? What is this branch of mathematics called?

Merged with "How to prove that some functions don't have a primitive" by Ismael:
Sometimes we are told that some functions like $\dfrac{\sin(x)}{x}$ don't have an indefinite integral, or that it can't be expressed in term of other simple functions.
I wonder how we can prove that kind of assertion?

It is a theorem of Liouville, reproven later with purely algebraic methods, that for rational functions $f$ and $g$, $g$ non-constant, the antiderivative of
$$f(x)\exp(g(x)) \, \mathrm dx$$
can be expressed in terms of elementary functions if and only if there exists some rational function $h$ such that it is a solution of
$$f = h' + hg'$$
$e^{x^2}$ is another classic example of such a function with no elementary antiderivative.
I don't know how much math you've had, but some of this paper might be comprehensible in its broad strokes:

Liouville's original paper:

Liouville, J. "Suite du Mémoire sur la classification des Transcendantes, et sur l'impossibilité d'exprimer les racines de certaines équations en fonction finie explicite des coefficients." J. Math. Pure Appl. 3, 523-546, 1838.

Michael Spivak's book on Calculus also has a section with a discussion of this.


Question:
As a software engineer, I write a lot of code for industrial products. Relatively complicated stuff with classes, threads, some design efforts, but also some compromises for performance. I do a lot of testing, and I am tired of testing, so I got interested in formal proof tools, such as Coq, Isabelle... Could I use one of these to formally prove that my code is bug-free and be done with it? - but each time I check out one of these tools, I walk away unconvinced that they are usable for everyday software engineering. Now, that could only be me, and I am looking for pointers/opinions/ideas about that :-)
Specifically, I get the impression that to make one of these tools work for me would require a huge investment to properly define to the prover the objects, methods... of the program under consideration. I then wonder if the prover wouldn't just run out of steam given the size of everything it would have to deal with. Or maybe I would have to get rid of side-effects (those prover tools seem to do really well with declarative languages), and I wonder if that would result in "proven code" that could not be used because it would not be fast or small enough. Also, I don't have the luxury of changing the language I work with, it needs to be Java or C++: I can't tell my boss I'm going to code in OXXXml from now on, because it's the only language in which I can prove the correctness of the code...
Could someone with more experience of formal proof tools comment? Again - I would LOVE to use a formal prover tool, I think they are great, but I have the impression they are in an ivory tower that I can't reach from the lowly ditch of Java/C++... (PS: I also LOVE Haskell, OCaml... don't get the wrong idea: I am a fan of declarative languages and formal proof, I am just trying to see how I could realistically make that useful to software engineering)
Update: Since this is fairly broad, let's try the following more specific questions: 1) are there examples of using provers to prove correctness of industrial Java/C++ programs? 2) Would Coq be suitable for that task? 3) If Coq is suitable, should I write the program in Coq first, then generate C++/Java from Coq? 4) Could this approach handle  threading and performance optimizations?

I'll try to give a succinct answer to some of your questions. Please bear in mind that this is not strictly my field of research, so some of my info may be outdated/incorrect.

There are many tools that are specifically designed to formally prove properties of Java and C++.
However I need to make a small digression here: what does it mean to prove correctness of a program? The Java type checker proves a formal property of a Java program, namely that certain errors, like adding a float and an int, can never occur! I imagine you are interested in much stronger properties, namely that your program can never enter into an unwanted state, or that the output of a certain function conforms to a certain mathematical specification. In short, there is a wide gradient of what "proving a program correct" can mean, from simple security properties to a full proof that the program fulfills a detailed specification.
Now I'm going to assume that you are interested in proving strong properties about your programs. If you are interested in security properties (your program can not reach a certain state), then in general it seems the best approach is model checking. However if you wish to fully specify the behavior of a Java program, your best bet is to use a specification language for that language, for instance JML. There are such languages for specifying the behavior of C programs, for instance ACSL, but I don't know about C++.
Once you have your specifications, you need to prove that the program conforms to that specification.
For this you need a tool that has a formal understanding of both your specification and the operational semantics of your language (Java or C++) in order to express the adequacy theorem, namely that the execution of the program respects the specification.
This tool should also allow you to formulate or generate the proof of that theorem. Now both of these tasks (specifying and proving) are quite difficult, so they are often separated in two:

One tool that parses the code, the specification and generates the adequacy theorem. As Frank mentioned, Krakatoa is an example of such a tool.
One tool that proves the theorem(s), automatically or interactively. Coq interacts with Krakatoa in this manner, and there are some powerful automated tools like Z3 which can also be used.

One (minor) point: there are some theorems which are much too hard to be proven with automated methods, and automatic theorem provers are known to occasionally have soundness bugs which make them less trustworthy. This is an area where Coq shines in comparison (but it is not automatic!).
If you want to generate Ocaml code, then definitely write in Coq (Gallina) first, then extract the code. However, Coq is terrible at generating C++ or Java, if it is even possible.
Can the above tools handle threading and performance issues? Probably not, performance and threading concerns are best handled by specifically designed tools, as they are particularly hard problems. I'm not sure I have any tools to recommend here, though Martin Hofmann's PolyNI project seems interesting.

In conclusion: formal verification of "real world" Java and C++ programs is a large and well-developed field, and Coq is suitable for parts of that task. You can find a high-level overview here for example.


Question:
This is a question from /u/beneficii9 on reddit. The original post can be found here.

Through the Personal Genome Project, I have had my whole genome sequenced by Veritas, and have it in the form of a single VCF file for the whole genome and one BAS file for each chromosome. The reference genome associated with the VCF file is hg19. It has been helpful in health data; for example, I discovered I'm homozygous for the non-functional variant CYP-2D6 gene (rs3892097), which can render several common medications useless, and helps explain why some medicines didn't really work for me. My doctor has found this information very helpful.
Unfortunately, I can't find any way of looking at admixture or ancestry. I've tried setting everything up using a combination of VCFTools, Plink1.9, and ADMIXTURE, but I can't get it to work. I think for ADMIXTURE you have to have a bunch of genomes sorted by geographical origin to compare your genome against, but I'm not sure how to do that, and what's online isn't very clear to me. So scratch that one off.
I've tried converting the file to 23andme format (and at this /u/psychosomaticism has been very helpful). I did that (though it seems there were problems because of the way the VCF file was set up). But the websites that take the data want you to point them to your 23andme account, and that doesn't really work if you only have the file. 23andme doesn't provide for people who had their whole genomes sequenced. They want you to give them a saliva sample like everyone else.
So, what can I do?

A modified implementation of Vivek's answer.
peddy is a Python package that samples an input .vcf at ~25000 sites and projects onto a principal component space built on 2504 thousand genome samples. The author has extensive documentation of the tool's features and a link to the preprint.
I downloaded the .vcf and .vcf.tbi for the NA12878 sample from Genome in a Bottle's ftp here. Then, created a custom .ped file, NA12878.ped, with the contents:
NA12878 HG001   0       0       2       0
At the command line:
$ peddy --plot --prefix myvcf HG001_GRCh37_GIAB_highconf_CG-IllFB-IllGATKHC-Ion-10X-SOLID_CHROM1-X_v.3.3.2_highconf_PGandRTGphasetransfer.vcf.gz NA12878.ped

The output files all have the prefix myvcf., here's myvcf.pca_check.png


Question:
In quantum computation, what is the equivalent model of a Turing machine?
It is quite clear to me how quantum circuits can be constructed out of quantum gates, but how can we define a quantum Turing machine (QTM) that can actually benefit from quantum effects, namely, perform on high-dimensional systems?

(note: the full desciption is a bit complex, and has several subtleties which I prefered to ignore. The following is merely the high-level ideas for the QTM model)
When defining a Quantum Turing machine (QTM), one would like to have a simple model, similar to the classical TM (that is, a finite state machine plus an infinite tape), but allow the new model the advantage of quantum mechanics.
Similarly to the classical model, QTM has:

$Q=\{q_0,q_1,..\}$ - a finite set of states. Let $q_0$ be an initial state.
$\Sigma=\{\sigma_0,\sigma_1,...\}$, $\Gamma=\{\gamma_0,..\}$ - set of input/working alphabet
an infinite tape and a single "head".

However, when defining the transition function, one should recall that any quantum computation must be reversible.
Recall that a configuration of TM is the tuple $C=(q,T,i)$ denoting that the TM is at state $q\in Q$, the tape contains $T\in \Gamma^*$ and the head points to the $i$th cell of the tape.
Since, at any given time, the tape consist only a finite amount of non-blank cells, we define the (quantum) state of the QTM as
a unit vector in the Hilbert space $\mathcal{H}$ generated by the configuration space $Q\times\Sigma^*\times \mathrm{Z}$. The specific configuration $C=(q,T,i)$ is represented as the state $$|C\rangle = |q\rangle |T\rangle |i\rangle.$$
(remark: Therefore, every cell in the tape isa $\Gamma$-dimensional Hilbert space.)
The QTM is initialized to the state $|\psi(0)\rangle = |q_0\rangle |T_0\rangle |1\rangle$, where $T_0\in \Gamma^*$ is concatenation of the input $x\in\Sigma^*$ with many "blanks" as needed (there is a subtlety here to determine the maximal length, but I ignore it).
At each time step, the state of the QTM evolves according to some unitary $U$
$$|\psi(i+1)\rangle = U|\psi(i)\rangle$$
Note that the state at any time $n$ is given by $|\psi(n)\rangle = U^n|\psi(0)\rangle$. $U$ can be any unitary that "changes" the tape only where the head is located and moves the head one step to the right or left. That is, $\langle q',T',i'|U|q,T,i\rangle$ is zero unless $i'= i \pm 1$ and $T'$ differs from $T$ only at position $i$.
At the end of the computation (when the QTM reaches a state $q_f$) the tape is being measured (using, say, the computational basis).
The interesting thing to notice, is that each "step" the QTM's state is a superposition of possible configurations, which gives the QTM the "quantum" advantage.

The answer is based on Masanao Ozawa, On the Halting Problem for Quantum Turing Machines.
See also David Deutsch, Quantum theory, the Church-Turing principle and the universal quantum computer.


Question:
If you do an FFT plot of a simple signal, like:
t = 0:0.01:1 ;
N = max(size(t));
x = 1 + sin( 2*pi*t ) ;
y = abs( fft( x ) ) ;
stem( N*t, y )

1Hz sinusoid + DC

FFT of above

I understand that the number in the first bin is "how much DC" there is in the signal.
y(1)  %DC
  > 101.0000

The number in the second bin should be "how much 1-cycle over the whole signal" there is:
y(2)  %1 cycle in the N samples
  > 50.6665

But it's not 101!  It's about 50.5.
There's another entry at the end of the fft signal, equal in magnitude:
y(101)
  > 50.2971

So 50.5 again.
My question is, why is the FFT mirrored like this?  Why isn't it just a 101 in y(2) (which would of course mean, all 101 bins of your signal have a 1 Hz sinusoid in it?)
Would it be accurate to do:
mid = round( N/2 ) ;

% Prepend y(1), then add y(2:middle) with the mirror FLIPPED vector
% from y(middle+1:end)
z = [ y(1), y( 2:mid ) + fliplr( y(mid+1:end) ) ];

stem( z )

Flip and add-in the second half of the FFT vector

I thought now, the mirrored part on the right hand side is added in correctly, giving me the desired "all 101 bins of the FFT contain a 1Hz sinusoid"
>> z(2)

ans =

  100.5943

Real signals are "mirrored" in the real and negative halves of the Fourier transform because of the nature of the Fourier transform.  The Fourier transform is defined as the following-
$$H(f) = \int h(t)e^{-j2\pi ft}dt$$
Basically it correlates the signal with a bunch of complex sinusoids, each with its own frequency.  So what do those complex sinusoids look like?  The picture below illustrates one complex sinusoid.

The "corkscrew" is the rotating complex sinusoid in time, while the two sinusoids that follow it are the extracted real and imaginary components of the complex sinusoid.  The astute reader will note that the real and imaginary components are the exact same, only they are out of phase with each other by 90 degrees ($\frac{\pi}{2}$).  Because they are 90 degrees out of phase they are orthogonal and can "catch" any component of the signal at that frequency.
The relationship between the exponential and the cosine/sine is given by Euler's formula-
$$e^{jx} = \cos(x) + j\cdot\sin(x)$$
This allows us to modify the Fourier transform as follows-
$$
H(f) = \int h(t)e^{-j2\pi ft}dt \\
= \int h(t)(\cos(2\pi ft) - j\cdot\sin(2\pi ft))dt
$$
At the negative frequencies the Fourier transform becomes the following-
$$
H(-f) = \int h(t)(\cos(2\pi (-f)t) - j\sin(2\pi (-f)t))dt \\
= \int h(t)(\cos(2\pi ft) + j\cdot\sin(2\pi ft))dt
$$
Comparing the negative frequency version with the positive frequency version shows that the cosine is the same while the sine is inverted.  They are still 90 degrees out of phase with each other, though, allowing them to catch any signal component at that (negative) frequency.
Because both the positive and negative frequency sinusoids are 90 degrees out of phase and have the same magnitude, they will both respond to real signals in the same way.  Or rather, the magnitude of their response will be the same, but the correlation phase will be different.
EDIT: Specifically, the negative frequency correlation is the conjugate of the positive frequency correlation (due to the inverted imaginary sine component) for real signals.  In mathematical terms, this is, as Dilip pointed out, the following
$H(-f) = [H(f)]^*$
Another way to think about it:
Imaginary components are just that..Imaginary! They are a tool, which allows the employ of an extra plane to view things on and makes much of digital (and analog) signal processing possible, if not much easier than using differential equations!
But we can't break the logical laws of nature, we can't do anything 'real' with the imaginary content$^\dagger$ and so it must effectively cancel itself out before returning to reality. How does this look in the Fourier Transform of a time based signal(complex frequency domain)? If we add/sum the positive and negative frequency components of the signal the imaginary parts cancel, this is what we mean by saying the positive and negative elements are conjugate to each-other. Notice that when an FT is taken of a time-signal there exists these conjugate signals, with the 'real' part of each sharing the magnitude, half in the positive domain, half in the negative, so in effect adding the conjugates together removes the imaginary content and provides the real content only.
$^\dagger$ Meaning we can't create a voltage that is $5i$ volts. Obviously, we can use imaginary numbers to represent real-world signals that are two-vector-valued,  such as circularly polarized EM waves.


Question:
Let $U$ be an open set in $\mathbb R$. Then $U$ is a countable union of disjoint intervals.

This question has probably been asked. However, I am not interested in just getting the answer to it. Rather, I am interested in collecting as many different proofs of it which are as diverse as possible. A professor told me that there are many. So, I invite everyone who has seen proofs of this fact to share them with the community. I think it is a result worth knowing how to prove in many different ways and having a post that combines as many of them as possible will, no doubt, be quite useful. After two days, I will place a bounty on this question to attract as many people as possible. Of course, any comments, corrections, suggestions, links to papers/notes etc. are more than welcome.

Here’s one to get things started.
Let $U$ be a non-empty open subset of $\Bbb R$. For $x,y\in U$ define $x\sim y$ iff $\big[\min\{x,y\},\max\{x,y\}\big]\subseteq U$. It’s easily checked that $\sim$ is an equivalence relation on $U$ whose equivalence classes are pairwise disjoint open intervals in $\Bbb R$. (The term interval here includes unbounded intervals, i.e., rays.) Let $\mathscr{I}$ be the set of $\sim$-classes. Clearly $U=\bigcup_{I \in \mathscr{I}} I$. For each $I\in\mathscr{I}$ choose a rational $q_I\in I$; the map $\mathscr{I}\to\Bbb Q:I\mapsto q_I$ is injective, so $\mathscr{I}$ is countable.
A variant of the same basic idea is to let $\mathscr{I}$ be the set of open intervals that are subsets of $U$. For $I,J\in\mathscr{I}$ define $I\sim J$ iff there are $I_0=I,I_1,\dots,I_n=J\in\mathscr{I}$ such that $I_k\cap I_{k+1}\ne\varnothing$ for $k=0,\dots,n-1$. Then $\sim$ is an equivalence relation on $\mathscr{I}$. For $I\in\mathscr{I}$ let $[I]$ be the $\sim$-class of $I$. Then $\left\{\bigcup[I]:I\in\mathscr{I}\right\}$ is a decomposition of $U$ into pairwise disjoint open intervals.
Both of these arguments generalize to any LOTS (= Linearly Ordered Topological Space), i.e., any linearly ordered set $\langle X,\le\rangle$ with the topology generated by the subbase of open rays $(\leftarrow,x)$ and $(x,\to)$: if $U$ is a non-empty open subset of $X$, then $U$ is the union of a family of pairwise disjoint open order-convex sets. (A set $C\subseteq X$ is order-convex if whenever $u,v\in C$ and $u<x<v$, then $x\in C$. Intervals and rays are always order-convex, and the converse is true if the order is complete.) It does take a little work to verify that these sets are open.
Alternatively, $U$ is the union of a family of pairwise disjoint intervals, where the intervals are allowed to have endpoints in the completion of the linear order.
In general the family need not be countable, of course.


Question:
For someone who is physically unable to use a pencil and paper, what would be the best way to do math?
In my case, I have only a little movement in my fingers. I can move a computer mouse and press the left button. Currently I do very little math and when I do I use MS Office but this is a very slow way of doing it and will break my thinking process.
EDIT:
Thank you for the answers. I have a lot to try. I won't accept an answer since it's dependent on the disability but thank you all.

(Background: I have a chronic pain condition, and it is extremely painful for me to do any sort of repetitive fine motor activity, including writing and typing.  I earned an undergraduate degree in math with quite little handwriting, and I'm currently a graduate student.)
Unfortunately, I've never been able to find any one solution or approach to replace the work that many people do with pencil and paper, but there are lots of partial solutions that work for different situations and types of mathematics.  Here are some of the ones that I use and which, based on your description, might be applicable.

Getting really proficient at mental math.  I think you've already done a lot of this, so all I'm going to say is that I can do a lot more math in my head than I would've believed was possible pre-disability.  It just takes a lot of practice.  Of course, it doesn't work for everything; some calculations just require remembering too many things at once.
Speech-to-text.  If you have clear speech, then a speech-to-text system is potentially very helpful.  (I use Dragon NaturallySpeaking.)  Maybe you already use one for general writing and computer use.  If so, then you have almost certainly noticed that they are not designed for mathematics (or, for that matter, computer science), so some additional software is necessary in order to do math. I use a system based on NatLaTeX to dictate all of my formal mathematics, including anything in that I'm going to turn in for my coursework.  Basically, NatLaTeX defines a speakable form of many common LaTeX commands, including everything you need for most mathematical expressions.  Using a custom vocabulary in Dragon, I can dictate a plain text file containing this NatLaTeX source.  I then use in scripts from the NatLaTeX project to transform my dictated text into actual LaTeX source, which I can then compile into nicely typeset mathematics using a standard LaTeX compiler.  (Actually, I use a batch file to automate the process.)  Just as a note, I have made several modifications to NatLaTeX in order to optimize it for mathematics (the original author was a physicist) and to adjust for changes in LaTeX.  Feel free to contact me if you want a copy of the modified scripts.  I do eventually intend to post them somewhere online, but I need to spend some time updating the documentation first (and that's really hard to justify spending time on it while I'm preparing for comprehensive exams!).
The big advantage to a dictation system like this is that you get to go through the process of formally presenting your work, which is really helpful for checking understanding and practicing proof writing.  Disadvantages include a steep learning curve and not being able to see your work (typeset, at least) in real time.  You also have very limited choices in text editors because Dragon will only "play nice" with a couple of them.
Programming languages and computer algebra systems.  When you actually need to do calculations, plot functions, etc., it is hard to beat a good computer algebra system.  There are lots of choices out there, and I think the choice of which one to use ultimately comes down to personal preference and perhaps compatibility with whatever assistive technology you use.  Of course, you still face the problem of how to handle getting input to that computer algebra system.  Typing with one finger on an on-screen keyboard sounds rather slow and tedious.  Here are a few alternatives you might want to look into.

If you have head and neck movement, a head pointer is one option.  I sometimes use one that actually marketed as a gaming device called TrackIR.  (Gaming peripherals are much less expensive than assistive technology peripherals!)  You can use this to type on an on-screen keyboard or to interact with the input panels found in many computer algebra systems.  For mouse click, you could use a switch with your finger or a dwell/hover click.
Eye tracking is a technology that has recently become much more affordable due to relatively new consumer-level devices marketed for gaming applications.  Just a couple months ago, I got an Tobii EyeX eye tracker, and it has been great!  I use it with a simple mouse emulation script and Dasher to write code in Sage.  Dasher is really cool, by the way, and quite good for text entry with low-precision input devices like eye trackers.  It's also much faster than most on-screen keyboards.  Just as a warning, the EyeX is not intended as an assistive device so you do have to do a some software configuration in order to make it do what you want it to do.  But you're studying computer science, so I don't think that should be a problem for you.  (FreePIE, OptiKey, and Dasher are all good pieces of free software to look up and consider for use with the EyeX.)

The big advantage to computer algebra systems is that you can do all of the numerical calculations and tedious symbolic manipulations without needing to ever write down a single number.  The disadvantage is that hiding all of the details can sometimes hinder your conceptual understanding.

Those are the main strategies I use.  I hope something here can help you out, too.
EDIT:
There has been a request for some examples of what NatLaTex can do, so here are a couple of different examples pulled files on my hard drive.
Discrete Math Example:
NatLaTeX Input (dictated with Dragon)
Given a poset "(P, precedes)", a collection of linear extensions "{calligraphy R } equals left curly brace precedes sub one, precedes sub two, low dots, precedes sub k right curly brace" is called a ``realizer'' of "P" if "precedes equals intersection of sub {i equals one } to the k precedes sub k", where each relation "precedes sub i" is interpreted as a set of ordered pairs and "intersection of" is set intersection. Equivalently, "{calligraphy R }" is a realizer of "P" if, for all "p, q in P", "p precedes q" if and only if "p precedes sub i q" for all "one less than or equal to i less than or equal to k".
LaTeX Output
Given a poset \( ( P , \prec )\), a collection of linear extensions \(
{ \mathcal R } = \{ \prec_1 , \prec_2 , \ldots , \prec_k \}\) is called
a ``realizer'' of \( P\) if \( \prec = \bigcap_{ i = 1 }^k \prec_k\),
where each relation \( \prec_i\) is interpreted as a set of ordered
pairs and \( \bigcap\) is set intersection. Equivalently, \( { \mathcal
R }\) is a realizer of \( P\) if, for all \( p , q \in P\), \( p \prec
q\) if and only if \( p \prec_i q\) for all \( 1 \leq i \leq k\).
Analysis Example:
NatLaTeX Input (dictated with Dragon)
begin theorem [Monotone Convergence Theorem]
Let "left curly brace f sub n right curly brace sub {n equals one } to the infinity" be a sequence of nonnegative measurable functions with "f sub one less than or equal to f sub two less than or equal to low dots less than or equal to f sub n less than or equal to f sub {n +1 } less than or equal to low dots" and "limit of sub n f sub n equals f" (pointwise). Then, "f" is measurable and
@begin{equation}
limit of sub {n right arrow infinity } integral f sub n d Greek mu equals integral limit of sub {n right arrow infinity } f sub n d Greek mu equals integral f d Greek mu
@end{equation}
end theorem
LaTeX Output
\begin{theorem}[Monotone Convergence Theorem]
Let \( \{ f_n \}_{ n = 1 }^\infty\) be a sequence of nonnegative
measurable functions with \( f_1 \leq f_2 \leq \ldots \leq f_n \leq f_{ n
+ 1 } \leq \ldots\) and \( \lim_n f_n = f \) (pointwise). Then, \( f \) is
measurable and
\begin{equation}
\lim_{ n \rightarrow \infty } \int f_n d \mu = \int \lim_{ n
\rightarrow \infty } f_n d \mu = \int f d \mu
\end{equation}
\end{theorem}


Question: I understand the this (or self or Me) is used to refer to the current object, and that it is a feature of object-oriented programming languages. The earliest language I could find which has such a concept was Smalltalk, which uses self but was wondering where and when (which programming language) the concept was first implemented?

Simula 67 is generally considered the first object-oriented language and predates Smalltalk by a number of years.
It also used the this keyword for the same concept, which can be seen in this book chapter extract:
  class Linker;
  begin
     ref(Linker) Next, Sex, Employment;
     text ID;

     procedure Add_to_List(LHead); name LHead; ref(Linker) LHead;
     begin
        Next :- LHead;
        LHead :- this Linker
     end..of..Add..to..List;

     procedure Onto_Lists(Gender,Occupation);
         name Gender,Occupation;
         ref(Linker) Gender,Occupation;
     begin
        Sex :- Gender;
        Employment :- Occupation;
        Gender :- Occupation :- this Linker
     end..of..Onto..Lists;

     InImage;
     ID :- Copy(SysIn.Image);
     InImage;
  end--of--Linker;


Question: It is known that impurities in a desired isolated product lower the melting point of the mixture, even if the impurities' melting point is much higher than the desired product. Why is that so?

It's a very general statement, but it's not always true. I'll explain why it's often true, and give a counter-example at the end.

Your majority component B and the impurity (let's call it A) form a binary system. In most cases, such binary mixtures exhibit a solid–liquid phase diagram as follows:

(image taken from these lecture notes).
This binary phase diagram has pure A on the left, pure B on the right. A and B form, somewhere, a eutectic. It is the point here at concentration e and temperature y. Because the existence of a eutectic point is guaranteed for any A/B binary system, and because the eutectic corresponds to a lower temperature, your liquidus curve decreases with increasing impurity concentration, and the impurity thus lowers the melting point.
However, not all binary mixtures form a eutectic. In the words of Wikipedia:

Not all binary alloys have a eutectic point; for example, in the silver-gold system the melt temperature (liquidus) and freeze temperature (solidus) both increase monotonically as the mix changes from pure silver to pure gold.

The corresponding phase diagram is as follows:


Question:
What happens to the energy when waves completely cancel each other out via destructive interference? It seems like the energy just disappears, but that would violate the law of energy conservation.
My guess is that the kinetic energy is transformed into potential energy. Or maybe what happens to the energy depends on the specific interference scenario? Can someone elaborate on that or correct me if I'm wrong?

Waves always travel. Even standing waves can always be interpreted as two traveling waves that are moving in opposite directions (more on that below).
Keeping the idea that waves must travel in mind, here's what happens whenever you figure out a way to build a region in which the energy of such a moving wave cancels out fully: If you look closely, you will find that you have created a mirror, and that the missing energy has simply bounced off the region you created.
Examples include opals, peacock feathers, and ordinary light mirrors. The first two reflect specific frequencies of light because repeating internal structures create a physical regions in which that frequency of light cannot travel - that is, a region in which near-total energy cancellation occurs. An optical mirror uses electrons at the top of their Fermi seas to cancel out light over a much broader range of frequencies. In all three examples the light bounces off the region, with only a little of its energy being absorbed (converted to heat).
A skip rope (or perhaps a garden hose) provides a more accessible example. First, lay out the rope or hose along its length, then give it quick, sharp clockwise motion. You get a helical wave that travels quickly away from you like a moving corkscrew. No standing wave, that!
You put a friend at the other end, but she does not want your wave hitting her. So what does she do? First she tries sending a clockwise wave at you too, but that seems to backfire. Your wave if anything seems to hit harder and faster. So she tries a counterclockwise motion instead. That seems to work much better. It halts the forward progress of the wave you launched at her, converting it instead to a loop. That loop still has lots of energy, but at least now it stays in one place. It has become a standing wave, in this case a classic skip-rope loop, or maybe two or more loops if you are good at skip rope.
What happened is that she used a canceling motion to keep your wave from hitting her. But curiously, her cancelling motion also created a wave, one that is twisted in the opposite way (counterclockwise) and moving towards you, just as your clockwise wave moved towards her. As it turns out, the motion you are already doing cancels her wave too, sending it right back at her. The wave is now trapped between your two cancelling actions. The sum of the two waves, which now looks sinusoidal instead of helical, has the same energy as your two individual helical waves added together.
I should note that you really only need one person driving the wave, since any sufficiently solid anchor for one end of the rope will also prevent the wave from entering it, and so end up reflecting that wave just as your friend did using a more active approach. Physical media such as peacock features and Fermi sea electrons also use a passive approach to reflection, with the same result: The energy is forbidden by cancellation from entering into some region of space.
So, while this is by no means a complete explanation, I hope it provides some "feel" for what complete energy cancellation really means: It's more about keeping waves out. Thinking of cancellation as the art of building wave mirrors provides a different and less paradoxical-sounding perspective on a wide variety of phenomena that alter, cancel, or redirect waves.


Question:
Recently, I have found in a paper by Klammer, et al. a statement that p-values should be uniformly distributed. I believe the authors, but cannot understand why it is so.
Klammer, A. A., Park, C. Y., and Stafford Noble, W. (2009) Statistical Calibration of the SEQUEST XCorr Function. Journal of Proteome Research. 8(4): 2106–2113.

To clarify a bit.  The p-value is uniformly distributed when the null hypothesis is true and all other assumptions are met.  The reason for this is really the definition of alpha as the probability of a type I error.  We want the probability of rejecting a true null hypothesis to be alpha, we reject when the observed $\text{p-value} < \alpha$, the only way this happens for any value of alpha is when the p-value comes from a uniform distribution.  The whole point of using the correct distribution (normal, t, f, chisq, etc.) is to transform from the test statistic to a uniform p-value.  If the null hypothesis is false then the distribution of the p-value will (hopefully) be more weighted towards 0.
The Pvalue.norm.sim and Pvalue.binom.sim functions in the TeachingDemos package for R will simulate several data sets, compute the p-values and plot them to demonstrate this idea.
Also see:

Murdoch, D, Tsai, Y, and Adcock, J (2008). P-Values are Random
  Variables. The American Statistician, 62, 242-245.

for some more details.
Edit:
Since people are still reading this answer and commenting, I thought that I would address @whuber's comment.
It is true that when using a composite null hypothesis like $\mu_1 \leq \mu_2$ that the p-values will only be uniformly distributed when the 2 means are exactly equal and will not be a uniform if $\mu_1$ is any value that is less than $\mu_2$.  This can easily be seen using the Pvalue.norm.sim function and setting it to do a one sided test and simulating with the simulation and hypothesized means different (but in the direction to make the null true).
As far as statistical theory goes, this does not matter.  Consider if I claimed that I am taller than every member of your family, one way to test this claim would be to compare my height to the height of each member of your family one at a time.  Another option would be to find the member of your family that is the tallest and compare their height with mine.  If I am taller than that one person then I am taller than the rest as well and my claim is true, if I am not taller than that one person then my claim is false.  Testing a composite null can be seen as a similar process, rather than testing all the possible combinations where $\mu_1 \leq \mu_2$ we can test just the equality part because if we can reject that $\mu_1 = \mu_2$ in favour of $\mu_1 > \mu_2$ then we know that we can also reject all the possibilities of $\mu_1 < \mu_2$.   If we look at the distribution of p-values for cases where $\mu_1 < \mu_2$ then the distribution will not be perfectly uniform but will have more values closer to 1 than to 0 meaning that the probability of a type I error will be less than the selected $\alpha$ value making it a conservative test.  The uniform becomes the limiting distribution as $\mu_1$ gets closer to $\mu_2$ (the people who are more current on the stat-theory terms could probably state this better in terms of distributional supremum or something like that).  So by constructing our test assuming the equal part of the null even when the null is composite, then we are designing our test to have a probability of a type I error that is at most $\alpha$ for any conditions where the null is true.