Question:
Lots of people use a main tool like Excel or another spreadsheet, SPSS, Stata, or R for their statistics needs. They might turn to some specific package for very special needs, but a lot of things can be done with a simple spreadsheet or a general stats package or stats programming environment.
I've always liked Python as a programming language, and for simple needs, it's easy to write a short program that calculates what I need. Matplotlib allows me to plot it.
Has anyone switched completely from, say R, to Python? R (or any other statistics package) has a lot of functionality specific to statistics, and it has data structures that allow you to think about the statistics you want to perform and less about the internal representation of your data. Python (or some other dynamic language) has the benefit of allowing me to program in a familiar, high-level language, and it lets me programmatically interact with real-world systems in which the data resides or from which I can take measurements. But I haven't found any Python package that would allow me to express things with "statistical terminology" – from simple descriptive statistics to more complicated multivariate methods.
What can you recommend if I wanted to use Python as a "statistics workbench" to replace R, SPSS, etc.?
What would I gain and lose, based on your experience?

It's hard to ignore the wealth of statistical packages available in R/CRAN.  That said, I spend a lot of time in Python land and would never dissuade anyone from having as much fun as I do.  :)  Here are some libraries/links you might find useful for statistical work.
There's plenty of other stuff out there, but this is what I find the most useful along the lines you mentioned.

NumPy/Scipy You probably know about these already.  But let me point out the Cookbook where you can read about many statistical facilities already available and the Example List which is a great reference for functions (including data manipulation and other operations).  Another handy reference is John Cook's Distributions in Scipy.

pandas This is a really nice library for working with statistical data -- tabular data, time series, panel data.  Includes many builtin functions for data summaries, grouping/aggregation, pivoting.  Also has a statistics/econometrics library.

statsmodels Statistical modeling: Linear models, GLMs, among others.

PyMC For your Bayesian/MCMC/hierarchical modeling needs. Highly recommended.

scikit-learn A modular framework and a comprehensive collection of machine learning models and tools (data pre-processing, model selection, evaluation etc).

Biopython Useful for loading your biological data into python, and provides some rudimentary statistical/ machine learning tools for analysis.

Projects that are dead or not actively maintained as of 2025:

larry  Labeled array that plays nice with NumPy.  Provides statistical functions not present in NumPy and good for data manipulation.

python-statlib A fairly recent effort which combined a number of scattered statistics libraries.  Useful for basic and descriptive statistics if you're not using NumPy or pandas.

scikits  Statistical and scientific computing packages -- notably smoothing, optimization and machine learning. As of 2025, the page is dead, but it used to list well-known projects, such as Scikit-Learn.

PyMix Mixture models.

If speed becomes a problem, consider Theano -- used with good success by the deep learning people. PyTensor is the current successor to Theano.


Question:
What's the cheapest way to link a few microcontrollers wirelessly at low speeds over short distances.
I'm looking to keep it ultra-cheap, use common discrete parts and keep it physically small. I don't care about bands and licensing so long as it works.
802.15.4/ZigBee, Bluetooth and WiFi all require an expensive coprocessor, so aren't an option.
Alternatively, are there very cheap radio modules available to hobbyists? The kind of things you find in car keyfobs and wireless thermometers, perhaps?
Would building a simple transceiver on a homebrew PCB even be practical, or will I be plagued by tuning, interference and weirdy analogue stuff?
Could something like this be driven from a microcontroller?
What about receive?

You pretty much have to buy pre-made modules, you can't expect to wire up your own transmitter/receiver from a few transistors and a crystal, RF circuit design is unforgiving and all but requires a custom PCB (or custom IC) to do. You could probably build your own RF module on a PCB if you did some work, but at that point if you are making your own PCB's, you're not saving much money versus the very cheap modules that are available.
SparkFun has RF Transmitters & Receivers for $4 and $5 respectively. Since they are just basic parts, you will need to do a little extra logic on your microcontroller to compensate for interference, eg sending error control codes so that missing / flipped bits can be detected and recovered.
I found SeeedStudio sells almost the exact same thing, but even cheaper. It's $4.90 for a pair of a receiver and transmitter.


Question:
The industry standard for aligning short reads seems to be bwa-mem. However, in my tests I have seen that using bwa backtrack (bwa-aln + bwa-sampe + bwa-samse) performs better. It is slightly slower, but gives significantly better results in terms of both sensitivity and specificity. I have tested it using the genome in a bottle data and public samples (NA12878 and NA12877 among others) and found that backtrack consistently outperformed bwa-mem.
So why is bwa-mem the standard? Am I wrong and other tests have shown the opposite? I don't really see how since I tested using the most common datasets and validation data. Is it that the slight increase in efficiency outweighs the decrease in performance?
The only other explanation I can see is that bwa backtrack is designed specifically for Illumina reads and all my tests have been on Illumina data. Is it just that bwa-mem is "sequencer agnostic"? So that we can use the same algorithm irrespective of what sequencing platform is used? In that case, it makes sense to use backtrack for if we only deal with Illumina data and mem if we can have different sequencers. But, if so, seeing as Illumina is so widespread, why isn't backtrack used more often on Illumina data? I feel I must be missing something.

bwa mem is newer, faster, and [should be] more accurate, particularly for longer reads.
From the bwa man page (presumably in Heng Li's own words):

BWA is a software package for mapping low-divergent sequences against a large reference genome, such as the human genome. It consists of three algorithms:  BWA-backtrack, BWA-SW and BWA-MEM. The first algorithm  is designed for Illumina sequence reads up to 100bp, while the rest two for longer sequences ranged from 70bp to 1Mbp. BWA-MEM and BWA-SW share similar  features such as long-read support and split alignment, but BWA-MEM, which is the latest, is generally recommended for high-quality queries as it is faster and  more  accurate. BWA-MEM also has better performance than BWA-backtrack for 70-100bp Illumina reads.


Question: What's the maximum amount of current which I can draw from each of the Arduino's pins without tripping any of the internal fuses? Is there a limit per pin as well as an overall limit for the whole board?

This is a bit complex. Basically, there are a number of limiting factors:
The IO lines from the microcontroller (i.e. the analog and digital pins) have both an aggregate (e.g. total) current limit, and an per-pin limit:

From the ATmega328P datasheet.
However, depending on how you define the Arduino "Pins", this is not the entire story.
The 5V pin of the arduino is not connected through the microcontroller. As such, it can source significantly more power. When you are powering your arduino from USB, the USB interface limits your total power consumption to 500 mA. This is shared with the devices on the arduino board, so the available power will be somewhat less.
When you are using an external power supply, through the barrel power connector, you are limited by the local 5V regulator, which is rated for a maximum of 1 Amp. However, this it also thermally limited, meaning that as you draw power, the regulator will heat up. When it overheats, it will shut down temporarily.
The 3.3V regulated output is able to supply 150 mA max, which is the limit of the 3.3V regulator.

In Summary

The absolute maximum for any single IO pin is 40 mA (this is the maximum. You should never actually pull a full 40 mA from a pin. Basically, it's the threshold at which Atmel can no longer guarantee the chip won't be damaged. You should always ensure you're safely below this current limit.)
The total current from all the IO pins together is 200 mA max
The 5V output pin is good for ~400 mA on USB, ~900 mA when using an external power adapter

The 900 mA is for an adapter that provides ~7V. As the adapter voltage increases, the amount of heat the regulator has to deal with also increases, so the maximum current will drop as the voltage increases. This is called thermal limiting

The 3.3V output is capable of supplying 150 mA.

Note - Any power drawn from the 3.3V rail has to go through the 5V rail. Therefore, if you have a 100 mA device on the 3.3V output, you need to also count it against the 5V total current.

Note: This does not apply to the Arduino Due, and there are likely some differences for the Arduino Mega. It is likely generally true for any Arduino based off the ATmega328 microcontroller.


Question:
I have a question about matched filtering.  Does the matched filter maximise the SNR at the moment of decision only?  As far as I understand, if you put, say, NRZ through a matched filter, the SNR will be maximised at the decision point only and that is the advantage of the matched filter.  Does it maximise the SNR anywhere else in the output function, or just at the point of decision?
According to Wikipedia

The matched filter is the optimal linear filter for maximizing the signal to noise ratio (SNR) in the presence of additive stochastic noise

This to me implies that it maximises it everywhere, but I don't see how that is possible.  I've looked at the maths in my communications engineering textbooks, and from what I can tell, it's just at the decision point.
Another question I have is, why not make a filter that makes a really tall skinny spike at the point of decision.  Wouldn't that make the SNR even better?
Thanks.
Edit:
I guess what I'm also thinking is, say you have a some NRZ data and you use a matched filter, the matched filter could be implemented with an I&D (integrate and dump).  The I&D will basically ramp up until it gets to the sampling time and the idea is that one samples at the peak of the I&D because at that point, the SNR is a maximum.  What I don't get is, why not create a filter that double integrates it or something like that, that way, you'd have a squared increase (rather than a ramp) and the point at which you sample would be even higher up and from what I can tell, more likely to be interpreted correctly by the decision circuit (and give a lower Pe (probability of error))?

Since this question has multiple sub-questions in edits, comments on answers, etc., and these have not been addressed, here goes.

Matched filters

Consider a finite-energy signal $s(t)$ that is the input to a (linear
time-invariant BIBO-stable) filter with impulse response $h(t)$, transfer function $H(f)$,
and produces the output
signal
$$y(\tau) = \int_{-\infty}^\infty s(\tau-t)h(t)\,\mathrm dt.\tag{1}$$
What choice of $h(t)$ will produce a maximum response at a given time
$t_0$? That is, we are looking for a filter such that the global maximum
of $y(\tau)$ occurs at $t_0$. This really is a very loosely phrased
(and really unanswerable) question because clearly the filter
with impulse response $2h(t)$ will have larger response than
the filter with impulse response $h(t)$, and so there is
no such thing as the filter that maximizes the response.
So, rather than compare apples and oranges, let us include the
constraint that we seek the filter that maximizes $y(t_0)$ subject
to the impulse response having a fixed energy, for example, subject to
$$\int_{-\infty}^\infty |h(t)|^2\,\mathrm dt = \mathbb E
= \int_{-\infty}^\infty |s(t)|^2 \,\mathrm dt.\tag{2}$$

Here onwards, "filter" shall mean a linear time-invariant filter
whose impulse response satisfies (2).

The Cauchy-Schwarz inequality provides an answer to this question. We have
$$y(t_0) = \int_{-\infty}^\infty s(t_0-t)h(t)\,\mathrm dt
\leq \sqrt{\int_{-\infty}^\infty |s(t_0-t)|^2 \,\mathrm dt}
\sqrt{\int_{-\infty}^\infty |h(t)|^2\,\mathrm dt}
= \mathbb E$$
with equality occurring if $h(t) = \lambda s(t_0-t)$ with $\lambda > 0$
where from (2) we get that $\lambda = 1$, that
is, the filter with impulse response $h(t) = s(t_0-t)$ produces
the maximal response $y(t_0) = \mathbb E$ at the specified time $t_0$.
In the (non-stochastic) sense described above, this filter is
said to be

the filter matched to $s(t)$ at time $t_0$ or
the matched filter for $s(t)$ at time $t_0.$

There are several points worth noting about this result.

The output of the matched filter has a
unique global maximum value of $\mathbb E$ at $t_0$; for any other
$t$, we have $y(t) < y(t_0) = \mathbb E$.

The impulse response $s(t_0-t) = s(-(t-t_0))$
of the matched filter for time $t_0$ is just $s(t)$ "reversed in time"
and moved to the right by $t_0$.

a. If $s(t)$ has finite support, say, $[0,T]$, then the matched filter is
noncausal if $t_0 < T$.
b. The filter matched to $s(t)$ at time $t_1 > t_0$ is just the filter
matched at time $t_0$ with an additional delay of $t_1-t_0$. For this
reason, some people call the filter with impulse response $s(-t)$,
(that is, the filter matched to $s(t)$ at $t=0$) the matched filter for $s(t)$ with the
understanding that the exact time of match can be incorporated into
the discussion as and when needed. If $s(t) = 0$ for $t < 0$, then
the matched filter is noncausal. With this, we can rephrase 1. as

The matched filter for $s(t)$ produces a unique global maximum
value $y(0) = \mathbb E$ at time $t=0$. Furthermore,
$$y(t) = \int_{-\infty}^\infty s(t-\tau)s(-\tau)\,\mathrm d\tau
= \int_{-\infty}^\infty s(\tau-t)s(\tau)\,\mathrm d\tau = R_s(t)$$
is the autocorrelation function of the signal $s(t)$. It is
well-known, of course, that $R_s(t)$ is an even function of $t$
with a unique peak at the origin.  Note that the output of the
filter matched at time $t_0$ is just $R_s(t-t_0)$, the autocorrelation
function delayed to peak at time $t_0$.

No filter other than the
matched filter for time $t_0$ can produce an output as large
as $\mathbb E$ at $t_0$. However, for any $t_0$,
it is possible to find filters that
have outputs that exceed $R_s(t_0)$ at $t_0$. Note that $R_s(t_0) < \mathbb E$.

The transfer function of the matched filter is $H(f)=S^*(f)$, the
complex conjugate of the spectrum of $S(f)$.
Thus, $Y(f) = \mathfrak F[y(t)]= |S(f)|^2$.
Think of this result as follows. Since $x^2 > x$ for $x > 1$ and $x^2< x$ for
$0 < x < 1$, the matched filter has low gain at those frequencies where
$S(f)$ is small, and high gain at those frequencies where $S(f)$ is large.
Thus, the matched filter is reducing the weak spectral components
and enhancing the strong spectral components in $S(f)$. (It is also
doing phase compensation to adjust all the "sinusoids" so that
they all peak at $t=0$).

But what about noise and SNR and stuff like that which is what the OP
was asking about?
If the signal $s(t)$ plus additive white Gaussian noise with
two-sided power spectral density $\frac{N_0}{2}$ is processed
through a filter with impulse response $h(t)$, then the output
noise process is a  zero-mean stationary Gaussian process with
autocorrelation function $\frac{N_0}{2}R_h(t)$. Thus, the
variance is
$$\sigma^2 = \frac{N_0}{2} R_h(0) = \frac{N_0}{2}\int_{-\infty}^{\infty} |h(t)|^2\,\mathrm dt.$$
It is important to note that the variance is the same regardless
of when we sample the filter output.  So, what choice of $h(t)$
will maximize the SNR $y(t_0)/\sigma$ at time $t_0$?  Well, from the
Cauchy-Schwarz inequality, we have
$$\text{SNR} = \frac{y(t_0)}{\sigma}
= \frac{\int_{-\infty}^\infty s(t_0-t)h(t)\,\mathrm dt}{\sqrt{\frac{N_0}{2}\int_{-\infty}^\infty |h(t)|^2\,\mathrm dt}}
\leq \frac{\sqrt{\int_{-\infty}^\infty |s(t_0-t)|^2 \,\mathrm dt}
\sqrt{\int_{-\infty}^\infty |h(t)|^2\,\mathrm dt}}{\sqrt{\frac{N_0}{2}\int_{-\infty}^\infty |h(t)|^2\,\mathrm dt}} = \sqrt{\frac{2\mathbb E}{N_0}}$$
with equality exactly when $h(t) = s(t_0-t)$, the filter that is matched
to $s(t)$ at time $t_0$!! Note that $\sigma^2 = \mathbb EN_0/2$.
If we use this matched filter for our desired sample time, then at other
times $t_1$, the SNR will be
$y(t_1)/\sigma < y(t_0)/\sigma = \sqrt{\frac{2\mathbb E}{N_0}}$.  Could
another filter give a larger SNR at time $t_1$? Sure, because $\sigma$
is the same for all filters under consideration, and we have noted above that
it is possible to have a signal output larger than $y(t_1)$ at time
$t_1$ by use of a different non-matched filter.
In short,

"does the matched filter maximize the SNR only at the sampling
instant, or everywhere?" has the answer that the SNR is maximized only
at the sampling instant $t_0$. At other times, other filters could give
a larger SNR than what the matched filter is providing at time $t_1$,
but this still smaller than the SNR $\sqrt{\frac{2\mathbb E}{N_0}}$
that the matched filter is giving you at $t_0$, and if desired,
the matched filter could be redesigned to produce its peak at time
$t_1$ instead of at time $t_0.$

"why not make a filter that makes a really tall skinny spike at the point of decision. Wouldn't that make the SNR even better?"
The matched filter does produce a spike of sorts at the sampling time
but it is constrained by the shape of the autocorrelation function. Any
other filter that you can devise to produce a tall skinny (time-domain)
spike is not a matched filter and so will not give you the largest possible
SNR. Note that increasing the amplitude of the filter impulse response
(or using a time-varying filter that boosts the gain at the time
of sampling) does not change the SNR since both the signal and the noise standard deviation increase proportionately.

"The I&D will basically ramp up until it gets to the sampling time and the idea is that one samples at the peak of the I&D because at that point, the SNR is a maximum."
For NRZ data and rectangular pulses, the matched filter impulse response is
also a rectangular pulse. The integrate-and-dump circuit is a correlator
whose output equals the matched filter output only at the sampling instants, and not in-between.  See the figure below.

If you sample the correlator output at other times,
you get noise with smaller variance but you can't simply add up the samples
of I&D output taken at different times because the noise variables are highly correlated, and
the net variance works out to be much larger.  Nor should you expect to be able
to take multiple samples from the matched filter output and combine them
in any way to get a better SNR.  It doesn't work. What you have in effect
is a different filter, and you cannot do better than the (linear)
matched filter in Gaussian noise; no nonlinear processing  will give
a smaller error probability than the matched fiter.


Question:
I've been reading some resources on the web about Galerkin methods to solve PDEs, but I'm not clear about something. The following is my own account of what I have understood.
Consider the following boundary value problem (BVP):
$$L[u(x,y)]=0 \quad \text{on}\quad (x,y)\in\Omega, \qquad S[u]=0 \quad \text{on} \quad (x,y)\in\partial\Omega$$
where $L$ is a 2nd order linear differentiation operator, $\Omega\subset\mathbb{R}^2$ is the domain of the BVP, $\partial\Omega$ is the boundary of the domain, and $S$ is a 1st order linear differential operator. Expess $u(x,y)$ as an aproximation of the form:
$$u(x,y)\approx \sum_{i=1}^N a_i g_i(x,y)$$
where the $g_i$ are a set of functions that we will use to approximate $u$. Substituting in the BVP:
$$\sum_i a_i L[g_i(x,y)]=R(a_1,...,a_N,x,y)$$
Since our approximation is not exact, the residual $R$ is not exactly zero. In the Galerkin-Ritz-Raleigh method we minimize $R$ with respect to the set of approximating functions by requiring $\langle R,g_i \rangle = 0$. Hence
$$\langle R,g_i \rangle = \sum_{j=1}^N a_j \langle L[g_j],g_i \rangle = 0$$
Therefore, to find the coefficients $a_i$, we must solve the matrix equation:
$$\left(
\begin{array}{ccc}
 \left\langle L\left[g_1\right],g_1\right\rangle  & \ldots  & \left\langle L\left[g_N\right],g_1\right\rangle  \\
 \ldots  & \ldots  & \ldots  \\
 \left\langle L\left[g_1\right],g_N\right\rangle  & \ldots  & \left\langle L\left[g_N\right],g_N\right\rangle
\end{array}
\right)\left(
\begin{array}{c}
 a_1 \\
 \ldots  \\
 a_N
\end{array}
\right)=0$$
My question is: How do I incorporate the boundary conditions into this?
EDIT: Originally the question said that $S[u]$ was a 2nd order linear differential operator. I changed it to a 1st order linear differential operator.

A quick and general answers without mathematical abstractions. There are several options to impose boundary conditions, e.g.
Strictly speaking the Galerkin method requires that you choose a set of basis functions which satisfy the BC of the problem (e.g. via basis recombination and/or splitting of the approximation $u_h=u_0+u_N$ wit $u_0$ responsible for inhomogenous solutions and $u_N$ a partial sum which relies on basis functions which satisfies the homogenous conditions)

Penalty methods/Lagrange multiplies where one essentially add a penalty term which incorporated the boundary condition, e.g. $A + \tau \cdot B = b + \tau\cdot b_p$ where $B$ is a matrix responsible for the discrete boundary condition and $b_p$ is responsible for inhomogenous terms. In the limit $\tau\to\infty$ the conditions is strongly imposed and otherwise it is weakly imposed. Choice of $\tau$ affects conditioning of the system.

Tau method where a number of equations are exchanged (modification of rows in Galerkin system) with discrete versions of boundary conditions which is then enforced explicitly. Note: one option is also to make the systems overdetermined with additional boundary conditions.

Before discretization (Ritz Method) rewrite Galerkin formulation via Gauss divergence theorem to transform volume integrals to boundary integrals and then incorporate ( exact or approximately) boundary conditions directly in formulation before discretization.

Finally, by exploiting connection between nodal/modal expansions it is also possible to derive a nodal Galerkin method where the solution to the system is the coefficients of a Lagrange basis rather than a modal basis.


Question:
I am not very familiar with the common discretization schemes for PDEs. I know that Crank-Nicolson is popular scheme for discretizing the diffusion equation. Is also a good choice for the advection term?
I am interesting in solving the Reaction-Diffusion-Advection equation,
$\frac{\partial u}{\partial t} + \nabla \cdot \left( \boldsymbol{v} u - D\nabla u \right) = f$
where $D$ is the diffusion coefficient of substance $u$ and $\boldsymbol{v}$ is the velocity.
For my specific application the equation can be written in the form,
$\frac{\partial u}{\partial t} = \underbrace{D\frac{\partial^2 u}{\partial x^2}}_{\textrm{Diffusion}} + \underbrace{\boldsymbol{v}\frac{\partial u}{\partial x}}_{\textrm{Advection (convection)}} + \underbrace{f(x,t)}_{\textrm{Reaction}}$
Here is the Crank-Nicolson scheme I have applied,
$\frac{u_{j}^{n+1} - u_{j}^{n}}{\Delta t} = D \left[ \frac{1 - \beta}{(\Delta x)^2} \left( u_{j-1}^{n} - 2u_{j}^{n} + u_{j+1}^{n} \right) +  \frac{\beta}{(\Delta x)^2} \left( u_{j-1}^{n+1} - 2u_{j}^{n+1} + u_{j+1}^{n+1} \right) \right] +
\boldsymbol{v} \left[ \frac{1-\alpha}{2\Delta x} \left( u_{j+1}^{n} - u_{j-1}^{n} \right) + \frac{\alpha}{2\Delta x} \left( u_{j+1}^{n+1} - u_{j-1}^{n+1} \right) \right] + f(x,t)$
Notice the $\alpha$ and the $\beta$ terms. This enables scheme to move between:

$\beta=\alpha=1/2$ Crank-Niscolson,
$\beta=\alpha=1$ it is fully implicit
$\beta=\alpha=0$ it is fully explicit

The values can be different, which allows the diffusion term to be Crank-Nicolson and the advection term to be something else. What is the most stable approach, what would you recommend?

This is a well-framed question and a very useful thing to understand.  Korrok is correct to refer you to von Neumann analysis and LeVeque's book.  I can add a bit more to that.  I'd like to write a detailed answer, but at the moment I only have time for a short one:
With $\alpha=\beta=1/2$, you get a method that is absolutely stable for arbitrarily large step sizes, as well as second-order accurate.  However, the method is not L-stable, so very high frequencies will not be damped, which is unphysical.
With $\alpha=\beta=1$, you get a method that is also unconditionally stable, but only 1st-order accurate.  This method is very dissipative.  It is L-stable.
If you take $\alpha\ne\beta$, your method can be understood as applying an additive Runge-Kutta method to the centered-difference semi-discretization.  The stability and accuracy analysis for such methods is considerably more complicated.  A very nice paper on such methods is here.
Which approach to recommend depends strongly on the magnitude of $D$, the kind of initial data you deal with, and the accuracy you seek.  If very low accuracy is acceptable, then $\alpha=\beta=1$ is a very robust approach.  If $D$ is moderate or large, then the problem is diffusion-dominated and very stiff; typically $\alpha=\beta=1/2$ will give good results.  If $D$ is very small, then it may be advantageous to use an explicit method and higher-order upwinding for the convective terms.


Question:
I've heard of (structural) induction. It allows you to build up finite structures from smaller ones and gives you proof principles for reasoning about such structures. The idea is clear enough.

But what about coinduction? How does it work? How can one say anything conclusive about an infinite structure?

There are (at least) two angles to address, namely, coinduction as a way of defining things and as a proof technique.

Regarding coinduction as a proof technique, what is the relationship between coinduction and bisimulation?

First, to dispel a possible cognitive dissonance: reasoning about infinite structures is not a problem, we do it all the time. As long as the structure is finitely describable, that's not a problem. Here are a few common types of infinite structures:

languages (sets of strings over some alphabet, which may be finite);
tree languages (sets of trees over some alphabet);
execution traces of a non-deterministic system;
real numbers;
sets of integers;
sets of functions from integers to integers; …

Coinductivity as the largest fixpoint
Where inductive definitions build a structure from elementary building blocks, coinductive definitions shape structures from how they can be deconstructed. For example, the type of lists whose elements are in a set A is defined as follows in Coq:
Inductive list (A:Set) : Set :=
  | nil : list A
  | cons : A -> list A -> list A.

Informally, the list type is the smallest type that contains all values built from the nil and cons constructors, with the axiom that $\forall x \, y, \: \mathtt{nil} \ne \mathtt{cons} \: x \: y$. Conversely, we can define the largest type that contains all values built from these constructors, keeping the discrimination axiom:
CoInductive colist (A:Set) : Set :=
  | conil : colist A
  | cocons : A -> colist A -> colist A.

list is isomorphic to a subset of colist. In addition, colist contains infinite lists: lists with cocons upon cocons.
CoFixpoint flipflop : colist ℕ := cocons 1 (cocons 2 flipflop).
CoFixpoint from (n:ℕ) : colist ℕ := cocons n (from (1 + n)).

flipflop is the infinite (circular list) $1::2::1::2::\ldots$; from 0 is the infinite list of natural numbers $0::1::2::\ldots$.
A recursive definition is well-formed if the result is built from smaller blocks: recursive calls must work on smaller inputs. A corecursive definition is well-formed if the result builds larger objects. Induction looks at constructors, coinduction looks at destructors. Note how the duality not only changes smaller to larger but also inputs to outputs. For example, the reason the flipflop and from definitions above are well-formed is that the corecursive call is guarded by a call to the cocons constructor in both cases.
Where statements about inductive objects have inductive proofs, statements about coinductive objects have coinductive proofs. For example, let's define the infinite predicate on colists; intuitively, the infinite colists are the ones that don't end with conil.
CoInductive Infinite A : colist A -> Prop :=
  | Inf : forall x l, Infinite l -> Infinite (cocons x l).

To prove that colists of the form from n are infinite, we can reason by coinduction. from n is equal to cocons n (from (1 + n)). This shows that from n is larger than from (1 + n), which is infinite by the coinduction hypothesis, hence from n is infinite.
Bisimilarity, a coinductive property
Coinduction as a proof technique also applies to finitary objects. Intuitively speaking, inductive proofs about an object are based on how the object is built. Coinductive proofs are based on how the object can be decomposed.
When studying deterministic systems, it is common to define equivalence through inductive rules: two systems are equivalent if you can get from one to the other by a series of transformations. Such definitions tend to fail to capture the many different ways non-deterministic systems can end up having the same (observable) behavior in spite of having different internal structure. (Coinduction is also useful to describe non-terminating systems, even when they're deterministic, but this isn't what I'll focus on here.)
Nondeterministic systems such as concurrent systems are often modeled by labeled transition systems. An LTS is a directed graph in which the edges are labeled. Each edge represents a possible transition of the system. A trace of an LTS is the sequence of edge labels over a path in the graph.
Two LTS can behave identically, in that they have the same possible traces, even if their internal structure is different. Graph isomorphism is too strong to define their equivalence. Instead, an LTS $\mathscr{A}$ is said to simulate another LTS $\mathscr{B}$ if every transition of the second LTS admits a corresponding transition in the first. Formally, let $S$ be the disjoint union of the states of the two LTS, $L$ the (common) set of labels and $\rightarrow$ the transition relation. The relation $R \subseteq S \times S$ is a simulation if
$$ \forall (p,q)\in R, %\forall p'\in S, \forall\alpha\in L,
   \text{ if } p \stackrel\alpha\rightarrow p'
   \text{ then } \exists q', \;
   q \stackrel\alpha\rightarrow q' \text{ and } (p',q')\in R
$$
$\mathscr{A}$ simulates $\mathscr{B}$ if there is a simulation in which all the states of $\mathscr{B}$ are related to a state in $\mathscr{A}$. If $R$ is a simulation in both directions, it is called a bisimulation. Simulation is a coinductive property: any observation on one side must have a match on the other side.
There are potentially many bisimulations in an LTS. Different bisimulations might identify different states. Given two bisimulations $R_1$ and $R_2$, the relation given by taking the union of the relation graphs $R_1 \cup R_2$ is itself a bisimulation, since related states give rise to related states for both relations. (This holds for infinite unions as well. The empty relation is an unintersting bisimulation, as is the identity relation.) In particular, the union of all bisimulations is itself a bisimulation, called bisimilarity. Bisimilarity is the coarsest way to observe a system that does not distinguish between distinct states.
Bisimilarity is a coinductive property. It can be defined as the largest fixpoint of an operator: it is the largest relation which, when extended to identify equivalent states, remains the same.
References

Coq and the calculus of inductive constructions

Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development — Coq'Art: The Calculus of Inductive Constructions. Springer, 2004. Ch. 13. [website] [Amazon]
Eduardo Giménez. An application of co-inductive types in coq: verification of the alternating bit protocol. In Workshop on Types for Proofs and Programs, number 1158 in Lecture Notes in Computer Science, pages 135–152. Springer-Verlag, 1995. [Google Books]
Eduardo Giménez and Pierre Castéran. A Tutorial on [Co-]Inductive Types in Coq. 2007. [PDF]

Labeled transition systems and bisimulations

Robin Milner. Communication and Concurrency. Prentice Hall, 1989.
Davide Sangiorgi. On the origins of bisimulation and coinduction. ACM Transactions on Programming Languages and Systems (TOPLAS), volume 31 issue 4, May 2009. [PDF] [ACM] Associated course slides: [PDF] [CiteSeer]
Davide Sangiorgi. The Pi-Calculus: A Theory of Mobile Processes. Cambridge University Press, 2003. [Amazon]

More references suggested by Anton Trunov

A chapter in Certified Programming with Dependent Types by A. Chlipala
D. Sangiorgi. "Introduction to Bisimulation and Coinduction". 2011. [PDF]
D. Sangiorgi and J. Rutten. Advanced Topics in Bisimulation and Coinduction. Cambridge University Press, 2012. [CUP]


Question:
A while ago I was trying different ways to draw digital waveforms, and one of the things I tried was, instead of the standard silhouette of the amplitude envelope, to display it more like an oscilloscope.  This is what a sine and square wave look like on a scope:

The naïve way to do this is:

Divide up the audio file into one chunk per horizontal pixel in the output image
Calculate the histogram of sample amplitudes for each chunk
Plot the histogram by brightness as a column of pixels

It produces something like this:

This works fine if there are a lot of samples per chunk and the signal's frequency is unrelated to the sampling frequency, but not otherwise.   If the signal frequency is an exact submultiple of the sampling frequency, for instance, the samples will always occur at exactly the same amplitudes in each cycle and the histogram will just be a few points, even though the actual reconstructed signal exists between these points.  This sine pulse should be as smooth as the above left, but it isn't because it's exactly 1 kHz and the samples always occur around the same points:

I tried upsampling to increase the number of points, but it doesn't solve the issue, just helps smooth things out in some cases.
So what I'd really like is a way to calculate the true PDF (probability vs amplitude) of the continuous reconstructed signal from its digital samples (amplitude vs time).  I don't know what algorithm to use for this.  In general, the PDF of a function is the derivative of its inverse function.
PDF of sin(x): $\frac{d}{dx} \arcsin x = \frac{1}{\sqrt{1-x^2}}$
But I don't know how to calculate this for waves where the inverse is a multi-valued function, or how to do it fast.  Break it up into branches and calculate the inverse of each, take the derivatives, and sum them all together?  But that's pretty complicated and there's probably a simpler way.
This "PDF of interpolated data" is also applicable to an attempt I made to do kernel density estimation of a GPS track.  It should have been ring shaped, but because it was only looking at the samples and not considering the interpolated points between the samples, the KDE looked more like a hump than a ring.  If the samples are all we know, then this is the best we can do.  But the samples are not all we know.  We also know that there's a path between the samples.  For GPS, there's no perfect Nyquist reconstruction like there is for bandlimited audio, but the basic idea still applies, with some guesswork in the interpolation function.

What I'd go with is essentially Jason R's "random resampler", which in turn is a presampled-signal based implementation of yoda's stochastic sampling.
I've used simple cubic interpolation to one random point between each two samples. For a primitive synth sound (decaying from a saturated non-bandlimited square-like signal +even harmonics to a sine) it looks like this:

Let's compare it to a higher-sampled version,

and the weird one with the same samplerate but no interpolation.

Notable artifact of this method is the overshoot in the square-like domain, but this is actually what the PDF of the sinc-filtered signal (as I said, my signal is not bandlimited) would also look like and represents the perceived loudness much better than the peaks, if this were an audio signal.
Code (Haskell):
cubInterpolate vll vl v vr vrr vrrr x
    = v*lSpline x + vr*rSpline x
      + ((vr-vl) - (vrr-vll)/4)*ldSpline x
      + ((vrr-v) - (vrrr-vl)/4)*rdSpline x
     where lSpline x = rSpline (1-x)
           rSpline x = x*x * (3-2*x)
           ldSpline x = x * (1 + x*(x-2))
           rdSpline x = -ldSpline (1-x)

                   --  rand list   IN samples  OUT samples
stochasticAntiAlias :: [Double] -> [Double] -> [Double]
stochasticAntiAlias rs (lsll:lsl:lsc:lsr:lsrr:[]) = []
stochasticAntiAlias (r:rLst) (lsll:lsl:lsc:lsr:lsrr:lsrrr:t)
    = ( cubInterpolate lsll lsl lsc lsr lsrr lsrrr r )
          : stochasticAntiAlias rLst (lsll:lsl:lsc:lsr:lsrr:lsrrr:t)

rand list is a list of random variables in range [0,1].


Question:
During breakfast with my colleagues, a question popped into my head:
What is the fastest method to cool a cup of coffee, if your only available instrument is a spoon?
A qualitative answer would be nice, but if we could find a mathematical model or even better make the experiment (we don't have the means here:-s) for this it would be great! :-D
So far, the options that we have considered are (any other creative methods are also welcome):
Stir the coffee with the spoon:
Pros:

The whirlpool has a greater surface than the flat coffee, so it is better for heat exchange with the air.
Due to the difference in speed between the liquid and the surrounding air, the Bernoulli effect should lower the pressure and that would cool it too to keep the atmospheric pressure constant.

Cons:

Joule effect should heat the coffee.

Leave the spoon inside the cup:
As the metal is a good heat conductor (and we are not talking about a wooden spoon!), and there is some part inside the liquid and another outside, it should help with the heat transfer, right?
A side question about this is what is better, to put it like normal or reversed, with the handle inside the cup? (I think it is better reversed, as there is more surface in contact with the air, as in the CPU heat sinks).
Insert and remove the spoon repeatedly:
The reasoning for this is that the spoon cools off faster when it's outside.
(I personally think it doesn't pay off the difference between keeping it always inside, as as it gets cooler, the lesser the temperature gradient and the worse for the heat transfer).

I We did the experiment. (Early results indicate that dipping may win, though the final conclusion remains uncertain.)

$\mathrm{H_2O}$ ice bath
canning jar
thermometer
pot of boiling water
stop watch

There were four trials, each lasting 10 minutes. Boiling water was poured into the canning jar, and the spoon was taken from the ice bath and placed into the jar.  A temperature reading was taken once every minute. After each trial the water was poured back into the pot of boiling water and the spoon was placed back into the ice bath.

 Method:                  Final Temp.
 1. No Spoon              151 F
 2. Spoon in, no motion   149 F
 3. Spoon stirring        147 F
 4. Spoon dipping         143 F

Temperature readings have an uncertainty of $\pm1\,\mathrm{^\circ F}$.

 Red   line:  no Spoon
 Green line:  Spoon in, no motion
 Aqua  line:  Stirring
 Blue  line:  Dipping

$$\begin{array}{|c|cl|cl|cl|cl|}
\hline
\text{Min} & \text{No Spoon} & & \text{Spoon} & & \text{Stirring} & & \text{Dipping} \\ \hline
 & \text{°F} & \text{°C} & \text{°F} & \text{°C} & \text{°F} & \text{°C} & \text{°F} & \text{°C} \\ \hline
1' & 180 & 82.22 & 175 & 79.44 & 175 & 79.44 & 177 & 80.56 \\
2' & 174 & 78.89 & 172 & 77.78 & 171 & 77.22 & 173 & 78.33 \\
3' & 171 & 77.22 & 168 & 75.56 & 167 & 75 & 168 & 75.56 \\
4' & 168 & 75.56 & 165 & 73.89 & 164 & 73.33 & 164 & 73.33 \\
5' & 164 & 73.33 & 162 & 72.22 & 161 & 71.67 & 160 & 71.11 \\
6' & 161 & 71.67 & 160 & 71.11 & 158 & 70 & 156 & 68.89 \\
7' & 158 & 70 & 156 & 68.89 & 155 & 68.33 & 152 & 66.67 \\
8' & 155 & 68.33 & 153 & 67.22 & 152 & 66.67 & 149 & 65 \\
9' & 153 & 67.22 & 151 & 66.11 & 150 & 65.56 & 146 & 63.33 \\
10' & 151 & 66.11 & 149 & 65 & 147 & 63.89 & 143 & 61.67 \\ \hline
\end{array}$$


Question:
Mathematica's ImageResize function supports many resampling methods.
Not being familiar with this area, beyond nearest neighbour, bilinear, biquadratic and bicubic (which are obvious from the name), I am lost.
Can you point me to some source that will explain the basic (mathematical) differences between these methods, and in particular point out the practical differences (e.g. by showing sample images where the choice of method really matters and introduces noticeable differences)?
I don't have a signal processing background, so I'd prefer a "gentle" and concise introduction :-)

I'll copy here the list of ImageResize methods for those "lazy" to click the link:

"Nearest"  nearest neighbor resampling
"Bilinear" bilinear interpolation
"Biquadratic"  biquadratic spline interpolation
"Bicubic"  bicubic spline interpolation
"Gaussian" Gaussian resampling
"Lanczos"  Lanczos multivariate interpolation method
"Cosine"   cosine interpolation
"Hamming"  raised-cosine Hamming interpolation
"Hann" raised-cosine Hann interpolation
"Blackman" three-term generalized raised cosine
"Bartlett" triangular window interpolation
"Connes"   squared Welch interpolation
"Welch"    Welch quadratic interpolation
"Parzen"   piecewise cubic interpolation
"Kaiser"   zero-order modified Bessel interpolation

Given an image $I(m,n)$ with $m,n$ integers, the interpolation of that image at any arbitrary point $m',n'$ can be written as
$$\tilde{I}(m',n')=\sum_{m=\left\lfloor m'\right\rfloor-w+1}^{\left\lfloor m'\right\rfloor+w}\ \sum_{n=\left\lfloor n'\right\rfloor-w+1}^{\left\lfloor n'\right\rfloor+w}I(m,n)\ f(m'-m,n'-n)$$
The result $\tilde{I}$ is still only an approximation to the true underlying continuous image $\mathcal{I}(x,y)$ and all that different interpolating functions do is to minimize the approximation error under different constraints and goals.
In signal processing, you'd like the interpolating function $f(m,n)$ to be the ideal low-pass filter. However, its frequency response requires infinite support and is useful only for bandlimited signals. Most images are not bandlimited and in image processing there are other factors to consider (such as how the eye interprets images. What's mathematically optimal might not be visually appealing). The choice of an interpolating function, much like window functions, depends very much on the specific problem at hand. I have not heard of Connes, Welch and Parzen (perhaps they're domain specific), but the others should be the 2-D equivalents of the mathematical functions for a 1-D window given in the Wikipedia link above.
Just as with window functions for temporal signals, it is easy to get a gist of what an image interpolating kernel does by looking at its frequency response. From my answer on window functions:

The two primary factors that describe a window function are:

Width of the main lobe (i.e., at what frequency bin is the power half that of the maximum response)
Attenuation of the side lobes (i.e., how far away down are the side lobes from the mainlobe). This tells you about the spectral
  leakage in the window.

This pretty much holds true for interpolation kernels. The choice is basically a trade-off between frequency filtering (attenuation of sidelobes), spatial localization (width of mainlobe) and reducing other effects such as ringing (Gibbs effect), aliasing, blurring, etc. For example, a kernel with oscillations such as the sinc kernel and the Lanczos4 kernel will introduce "ringing" in the image, whereas a Gaussian resampling will not introduce ringing.
Here's a simplified example in Mathematica that let's you see the effects of different interpolating functions:
true = ExampleData[{"TestImage", "Lena"}];
resampling = {"Nearest", "Bilinear", "Biquadratic", "Bicubic",
   "Gaussian", "Lanczos", "Cosine", "Hamming", "Hann", "Blackman",
   "Bartlett", "Connes", "Welch", "Parzen", "Kaiser"};
small = ImageResize[true, Scaled[1/4]];

Here, true represents the image which I assume to be the discrete equivalent of the "exact" image $\mathcal{I}(x,y)$, and small represents a smaller scale image $I(m,n)$ (we don't know how it was obtained). We'll interpolate $I(m,n)$ by 4x to give $\tilde{I}(m',n')$ which is the same size as the original. Below, I show the results of this interpolation and a comparison with the true image:

You can see for yourself that different interpolating functions have different effects. Nearest and a few others have very coarse features and you can essentially see jagged lines (see full sized image, not the grid display). Bicubic, biquadratic and Parzen overcome this but introduce a lot of blurring. Of all the kernels, Lanczos seems (visually) to be the most appealing and one that does the best job of the lot.
I'll try to expand upon this answer and provide more intuitive examples demonstrating the differences when I have the time. You might want to read this pretty easy and informative article that I found on the web (PDF warning).


Question: I'm going to start self-stydying algebraic geometry very soon. So, my question is why do mathematicians study algebraic geometry? What are the types of problems in which algebraic geometers are interested in? And what are some of the most beautiful theorems in algebraic geometry?

NEW ADDITION: a big list of freely available online courses on algebraic geometry, from introduction to advanced topics, has been compiled in this other answer. And a digression on motivation for studying the subject along with a self-learning guide of books is in this new answer.
There are other similar questions, above all asking for references for self-studying, whose answers may be helpful:

(Undergraduate) Algebraic Geometry Textbook Recomendations.
Reference for Algebraic Geometry.
Best Algebraic Geometry text book? (other than Hartshorne).

My personal recommendation is that you start and get your motivation in the following freely available notes. They are extremely instructive, from the very basics of complex algebraic curves up to schemes and intersection theory with Grothendieck-Riemann-Roch, and prove of some of the theorems I mention below. They are excellent for self-study mixing rigor with many pictures! (sadly, something quite unusual among AG references):

Matt Kerr - Lecture Notes Algebraic Geometry III/IV, Washington University in St. Louis.
Andreas Gathmann - Class Notes: Algebraic Geometry, University of Kaiserslautern.

For a powerful, long and abstract course, suitable for self-study, these notes have become famous:

Ravi Vakil - Foundations of Algebraic Geometry, Stanford University.

Also, there are many wonderful lecture videos for complete courses on elementary algebraic geometry, algebraic surfaces and beyond, by the one old master:

Miles Reid - Lecture Courses on Video (WCU project at Sogang University),

where you can really start at a slow pace (following his undergraduate textbook) to get up to the surface classification theorem.

Now, Algebraic Geometry is one of the oldest, deepest, broadest and most active subjects in Mathematics with connections to almost all other branches in either a very direct or subtle way. The main motivation started with Pierre de Fermat and René Descartes who realized that to study geometry one could work with algebraic equations instead of drawings and pictures (which is now fundamental to work with higher dimensional objects, since intuition fails there). The most basic equations one could imagine to start studying were polynomials on the coordinates of your plane or space, or in a number field in general, as they are the most basic constructions from the elementary arithmetic operations. Equations of first order, i.e. linear polynomials, are the straight lines, planes, linear subspaces and hyperplanes. Equations of second order turned out to comprise all the classical conic sections; in fact the conics classification in the affine, Euclidean and projective cases (over the real and complex numbers) is the first actual algebraic geometry problem that every student is introduced to: the classification of all possible canonical forms of polynomials of degree 2 (either under affine transformations or isometries in variables $(x,y)$, or projective transformations in homogeneous variables $[x:y:z]$). Thus the basic plane curves over the real numbers can be studied by the algebraic properties of polynomials. Working over the complex numbers is actually more natural, as it is the algebraic closure of the reals and so it simplifies a lot the study tying together the whole subject, thanks to elementary things like the fundamental theorem of algebra and the Hilbert Nullstellensatz. Besides, working within projective varieties, enlarging our ambient space with the points at infinity, also helps since then we are dealing with topologically compact objects and pathological results disappear, e.g. all curves intersect at least at a point, giving the beautiful Bézout's theorem.
From a purely practical point of view, one has to realize that all other analytic non-polynomial functions can be approximated by polynomials (e.g. by truncating the series), which is actually what calculators and computers do when computing trigonometric functions for example. So when any software plots a transcendental surface (or manifold), it is actually displaying a polynomial approximation (an algebraic variety). So the study of algebraic geometry in the applied and computational sense is fundamental for the rest of geometry.
From a pure mathematics perspective, the case of projective complex algebraic geometry is of central importance. This is because of several results, like Lefschetz's principle by which doing (algebraic) geometry over an algebraically closed field of characteristic $0$ is essentially equivalent to doing it over the complex numbers; furthermore, Chow's theorem guarantees that all projective complex manifolds are actually algebraic, meaning that differential geometry deals with the same objects as algebraic geometry in that case, i.e. complex projective manifolds are given by the zero locus of a finite number of homogeneous polynomials! This was strengthened by Jean-Pierre Serre's GAGA theorems, which unified and equated the study of analytic geometry with algebraic geometry in a very general setting. Besides, in the case of projective complex algebraic curves one is actually working with compact orientable real surfaces (since these always admit a holomorphic structure), therefore unifying the theory of compact Riemann surfaces of complex analysis with the differential geometry of real surfaces, the algebraic topology of 2-manifolds and the algebraic geometry of algebraic curves! Here one finds wonderful relations and deep results like all the consequences of the concept of degree, index and curvature, linking together the milestone theorems of Gauß-Bonnet, Poincaré-Hopf and Riemann-Roch theorem! In fact the principal classification of algebraic curves is given in terms of their genus which is an invariant proved to be the same in the different perspectives: the topological genus of number of doughnut holes, the arithmetic genus of the Hilbert polynomial of the algebraic curve and the geometric genus as the number of independent holomorphic differential 2-forms over the Riemann surface. Analogously, the study of real 4-manifolds in differential geometry and differential topology is of central importance in mathematics per se but also in theoretical and mathematical physics, for example in gauge theory, so the study of complex algebraic surfaces gives results and provides tools. The full birational classification of algebraic surfaces was worked out decades ago in the Kodaira-Enriques theorem and served as a starting point to Mori's minimal model program to birationally classify all higher-dimensional (projective) complex algebraic varieties. A fundamental difference with other types of geometry is the presence of singularities, which play a very important role in algebraic geometry as many of the obstacles are due to them, but the fundamental Hironaka's resolution theorem guarantees that, at least in characteristic zero, varieties always have a smooth birational model. Also the construction and study of moduli spaces of types of geometric objects is a very important topic (e.g. Deligne-Mumford construction), since the space of all such objects is often an algebraic-geometric object itself.
There are also many interesting problems and results in enumerative geometry and intersection theory, starting from the classic and amazing Cayley-Salmon theorem that all smooth cubic surfaces defined over an algebraic closed field contain exactly 27 straight lines, the Thom-Porteus formula for degeneracy loci, Schubert calculus up to modern quantum cohomology with Kontsevich's and ELSV formulas; Torelli's theorem on the reconstruction of algebraic curves from their Jacobian variety, and finally the cornerstone (Grothendieck)-Hirzebruch-Riemann-Roch theorem computing the number of independent global sections of vector bundles, actually their Euler-Poincaré characteristics, by the intersection numbers of generic zero loci of characteristic classes over the variety.
Besides all this, since the foundational immense work of Alexandre Grothendieck, the subject has got very solid and abstract foundations so powerful to fuse algebraic geometry with number theory, as many were hoping before. Thus, the abstract algebraic geometry of sheaves and schemes plays nowadays a fundamental role in algebraic number theory disguised as arithmetic geometry. Wondeful results in Diophantine geometry like Faltings theorem and Mordell-Weil theorem made use of all these advances, along with the famous proof of Wiles of Fermat's last theorem. The development of abstract algebraic geometry was more or less motivated to solve the remarkable Weil conjectures relating the number of solutions of polynomials over finite number fields to the geometry of the complex variety defined by the same polynomials. For this, tremendous machinery was worked out, like étale cohomology. Also, trying to apply complex geometry constructions to arithmetic has led to Arakelov geometry and the arithmetic Grothendieck-Riemann-Roch among other results.
Related to arithmetic geometry, thanks to schemes, there has emerged a new subject of arithmetic topology, where properties of the prime numbers and algebraic number theory have relationships and dualities with the theory of knots, links and 3-dimensional manifolds! This is a very mysterious and interesting new topic, since knots and links also appear in theoretical physics (e.g. topological quantum field theories). Also, anabelian geometry interestingly has led the way to studies on the relationships between the topological fundamental group of algebraic varieties and the Galois groups of arithmetic number field extensions.
So, mathematicians study algebraic geometry because it is at the core of many subjects, serving as a bridge between seemingly different disciplines: from geometry and topology to complex analysis and number theory. Since in the end, any mathematical subject works within specified algebras, studying the geometry those algebras define is a useful tool and interesting endeavor in itself. In fact, the requirement of being commutative algebras has been dropped since the work of Alain Connes and the whole 'new' subject of noncommmutative geometry has flourished, in analytic and algebraic styles, to try to complete the geometrization of mathematics. On the other hand it attempts to give a quantum counterpart to classical geometries, something of extreme interest in fundamental physics (complex algebraic geometry and noncommutative geometry appear almost necessarily in one way or another in any attempt to unify the fundamental forces with gravity, i.e. quantum field theory with general relativity; even abstract and categorical algebraic geometry play a role in topics like homological mirror symmetry and quantum cohomology, which originated in physics).
Therefore, the kind of problems mathematicians try to solve in algebraic geometry are related to much of everything else, mostly: anything related to the classification (as fine as possible) of algebraic varieties (and schemes, maybe someday), their invariants, singularities, deformations and moduli spaces, intersections, their topology and differential geometry, and framing arithmetic problems in terms of geometry. There are many interesting open problems:

Birational minimal model program for all varieties,
Hodge conjecture,
Jacobian conjecture,
Hartshorne's conjecture,
General Griffiths conjecture,
Fujita's conjecture,
Linearization and cancelation conjectures,
Coolidge-Nagata conjecture,
Resolution of singularities in nonzero characteristic,
Grothendieck's standard conjectures on algebraic cycles,
Grothendieck's anabelian section conjecture,
Classification of vector bundles over projective spaces,
Unirationality of moduli spaces of curves,
Unirationality of rationally connected varieties,
Full rigorous formalization of mirror symmetry and quantum cohomology,
Full theory of a universal cohomology and mixed motives (e.g. Voevodsky vanishing conjecture).

In my personal case, I started as a theoretical physicists but switched completely to pure mathematics because of algebraic geometry, and I also began by self-learning. It is a very deep subject with connections to almost everything else, once one has learned enough to realize that. It is also a very demanding field because of the tremendous background one has to master, in commutative and homological algebra for example, before being able to get to the most modern and interesting results. The effort nevertheless pays off! In fact, the route through commutative algebra actually paves the way not only to algebraic geometry but to algebraic number theory and arithmetic geometry. I had a strong background in differential geometry so I arrived at algebraic geometry through complex (Kähler) geometry, and ended up fascinated by even the most abstract incarnations of it.
"Algebraic geometry seems to have acquired the reputation of being esoteric, exclusive, and very abstract, with adherents who are secretly plotting to take over all the rest of mathematics. In one respect this last point is accurate..." - David Mumford.
So the question could be instead "why not study algebraic geometry!?" I hope this answer motivates you enough to dive into this deep ocean of the mathematical world and to corroborate it yourself. Best luck!


Question:
I understand OpenCV is the de facto library for programming image processing in C/C++; I'm wondering if there is a C or C++ library like that for audio processing. I basically want to filter raw waves from a microphone, and analyze them with some machine learning algorithms. But I may eventually also need:

Multiplatform audio capture and audio playback
DSP - Audio filters
Tone detection
Tonal property analysis
Tone synthesis
Recognition given some recognition corpus and model
Speech / music synthesis

Any advice would be appreciated.

Consider the following:
clam-project.org:

CLAM (C++ Library for Audio and Music) is a full-fledged software framework for research and application development in the Audio and Music Domain. It offers a conceptual model as well as tools for the analysis, synthesis and processing of audio signals.

MARF:

MARF is an open-source research platform and a collection of voice/sound/speech/text and natural language processing (NLP) algorithms written in Java and arranged into a modular and extensible framework facilitating addition of new algorithms. MARF can run distributedly over the network and may act as a library in applications or be used as a source for learning and extension.

aubio:

aubio is a tool designed for the extraction of annotations from audio signals. Its features include segmenting a sound file before each of its attacks, performing pitch detection, tapping the beat and producing midi streams from live audio.


Question: I'm interested in obtaining coding sequences of my favourite gene in all individuals from the 1000Genomes (and similar projects). I use GATK to get the right subset of variants, vcf-consensus to map these variants onto the reference genome and finally samtools to extract the individual exons. This works fine if the variants are SNPs but if there are any indels, this changes the coordinates of exons and I end up getting the wrong region. Is there any generic way of remapping genomic coordinates to account for the changes created by indels?

I think that you need a LiftOver Chain file to transform your coordinates. You can obtain such a file using bcftools consensus with the -c parameter:
-c, --chain <file>         write a chain file for liftover

Then you can use it to transform coordinates in various genomic formats using CrossMap.


Question:
So we have arithmetic mean (AM), geometric mean (GM) and harmonic mean (HM). Their mathematical formulation is also well known along with their associated stereotypical examples (e.g., Harmonic mean and it's application to 'speed' related problems).
However, a question that has always intrigued me is "how do I decide which mean is the most appropriate to use in a given context?" There must be at least some rule of thumb to help understand the applicability and yet the most common answer I've come across is: "It depends" (but on what?).
This may seem to be a rather trivial question but even high-school texts failed to explain this -- they only provide mathematical definitions!
I prefer an English explanation over a mathematical one -- simple test would be "would your mom/child understand it?"

This answer may have a slightly more mathematical bent than you were looking for.
The important thing to recognize is that all of these means are simply the arithmetic mean in disguise.
The important characteristic in identifying which (if any!) of the three common means (arithmetic, geometric or harmonic) is the "right" mean is to find the "additive structure" in the question at hand.
In other words suppose we're given some abstract quantities $x_1, x_2,\ldots,x_n$, which I will call "measurements", somewhat abusing this term below for the sake of consistency. Each of these three means can be obtained by (1) transforming each $x_i$ into some $y_i$, (2) taking the arithmetic mean and then (3) transforming back to the original scale of measurement.
Arithmetic mean: Obviously, we use the "identity" transformation: $y_i = x_i$. So, steps (1) and (3) are trivial (nothing is done) and $\bar x_{\mathrm{AM}} = \bar y$.
Geometric mean: Here the additive structure is on the logarithms of the original observations. So, we take $y_i = \log x_i$ and then to get the GM in step (3) we convert back via the inverse function of the $\log$, i.e., $\bar x_{\mathrm{GM}} = \exp(\bar{y})$.
Harmonic mean: Here the additive structure is on the reciprocals of our observations. So, $y_i = 1/x_i$, whence $\bar x_{\mathrm{HM}} = 1/\bar{y}$.
In physical problems, these often arise through the following process: We have some quantity $w$ that remains fixed in relation to our measurements $x_1,\ldots,x_n$ and some other quantities, say $z_1,\ldots,z_n$. Now, we play the following game: Keep $w$ and $z_1+\cdots+z_n$ constant and try to find some $\bar x$ such that if we replace each of our individual observations $x_i$ by $\bar x$, then the "total" relationship is still conserved.
The distance–velocity–time example appears to be popular, so let's use it.
Constant distance, varying times
Consider a fixed distance traveled $d$. Now suppose we travel this distance $n$ different times at speeds $v_1,\ldots,v_n$, taking times $t_1,\ldots,t_n$. We now play our game. Suppose we wanted to replace our individual velocities with some fixed velocity $\bar v$ such that the total time remains constant. Note that we have
$$
d - v_i t_i = 0 \>,
$$
so that $\sum_i (d - v_i t_i) = 0$. We want this total relationship (total time and total distance traveled) conserved when we replace each of the $v_i$ by $\bar v$ in our game. Hence,
$$
n d - \bar v \sum_i t_i = 0 \>,
$$
and since each $t_i = d / v_i$, we get that
$$
\bar v = \frac{n}{\frac{1}{v_1}+\cdots+\frac{1}{v_n}} = \bar v_{\mathrm{HM}} \>.
$$
Note that the "additive structure" here is with respect to the individual times, and our measurements are inversely related to them, hence the harmonic mean applies.
Varying distances, constant time
Now, let's change the situation. Suppose that for $n$ instances we travel a fixed time $t$ at velocities $v_1,\ldots,v_n$ over distances $d_1,\ldots,d_n$. Now, we want the total distance conserved. We have
$$
d_i - v_i t = 0 \>,
$$
and the total system is conserved if $\sum_i (d_i - v_i t) = 0$. Playing our game again, we seek a $\bar v$ such that
$$
\sum_i (d_i - \bar v t) = 0 \>,
$$
but, since $d_i = v_i t$, we get that
$$
\bar v = \frac{1}{n} \sum_i v_i = \bar v_{\mathrm{AM}} \>.
$$
Here the additive structure we are trying to maintain is proportional to the measurements we have, so the arithmetic mean applies.
Equal volume cube
Suppose we have constructed an $n$-dimensional box with a given volume $V$ and our measurements are the side-lengths of the box. Then
$$
V = x_1 \cdot x_2 \cdots x_n \>,
$$
and suppose we wanted to construct an $n$-dimensional (hyper)cube with the same volume. That is, we want to replace our individual side-lengths $x_i$ by a common side-length $\bar x$. Then
$$
V = \bar x \cdot \bar x \cdots \bar x = \bar x^n \>.
$$
This easily indicates that we should take $\bar x = (x_i \cdots x_n)^{1/n} = \bar x_{\mathrm{GM}}$.
Note that the additive structure is in the logarithms, that is, $\log V = \sum_i \log x_i$ and we are trying to conserve the left-hand quantity.
New means from old
As an exercise, think about what the "natural" mean is in the situation where you let both the distances and times vary in the first example. That is, we have distances $d_i$, velocities $v_i$ and times $t_i$. We want to conserve the total distance and time traveled and find a constant $\bar v$ to achieve this.
Exercise: What is the "natural" mean in this situation?


Question:
From my basic understanding: The viruses causing Ebola, Sars and Covid-19 are all the result of a zoonosis, meanings that the viruses have passed from animals to humans.
So my question is: Are all recently (let's say 100 years) emerged viral diseases, with potential for a global epidemic, the result of a zoonosis?

To my knowledge, yes. A partial list of recently emerged/emerging viral diseases (I certainly could have missed some), with probable reservoir hosts:

Chikungunya* (birds, rodents)
coronaviruses/sarbecoviruses (SARS [bats], MERS [camels], COVID-19 [?? bats ?? pangolins ??])
Ebola and other filoviruses (Marburg): (bats?)
Hantavirus (rodents)
Hendra, Nipah (bats)
Ross river virus* (various mammals)
HIV (primates)
influenza (H1N1, avian) (birds/pigs)
Lassa fever (rats)
Mpox (formerly monkeypox: monkeys, rodents)
West Nile virus* (birds)
Zika* (? "a wide range of animals in West Africa")

Starred examples are vector-borne (so perhaps of slightly lower concern - might not fit your criterion of "capable of causing a global pandemic").
Omitted:

older zoonotic viruses (rabies, dengue, hepatitis, ...)
non-viral zoonoses (malaria, plague, anthrax, tularemia)

A list of zoonoses; another from US CDC
More generally, the only other place an emerging virus could come from would be from mutation or recombination of existing human viruses. I'm not aware of such an example.


Question:
I do a fair bit of soldering (lead-free). Is breathing in solder/flux/paste fumes actually going to harm me?
Are cheap fume extractors worth buying?

Solder fumes aren't very good for you. Some people can become sensitized to flux fumes, especially from the older rosin flux used in cored solder, and get breathing problems:
Controlling health risks from rosin (colophony) based solder fluxes
The no-clean flux isn't as bad.
I once felt quite ill after assembling about 30 boards that I had to do myself as my distributor wanted them very quickly.
Breathing out whilst you are soldering each joint helps a lot, if you don't have fume extraction.


Question: The datasheet for the ATTiny13A, for instance, lists Min frequency of 0 MHz.  Does this mean the clock can be run at any arbitrarily low frequency with no ill effects?  I'm assuming it draws lower current at lower clock speeds?  Does 0 MHz mean you can stop the clock completely, and as long as power is still applied, it will remember its state indefinitely?

Yes. If the datasheet says "fully static operation", then you can clock it at any speed, even 0 Hz.  A "dynamic" chip needs to have a clock at a specific rate or it loses its state.


Question:
What aerodynamic effects actually contribute to producing the lift on an airplane?
I know there's a common belief that lift comes from the Bernoulli effect, where air moving over the wings is at reduced pressure because it's forced to travel further than air flowing under the wings. But I also know that this is wrong, or at best a minor contribution to the actual lift. The thing is, none of the many sources I've seen that discredit the Bernoulli effect explain what's actually going on, so I'm left wondering. Why do airplanes actually fly? Is this something that can be explained or summarized at a level appropriate for someone who isn't trained in fluid dynamics?
(Links to further reading for more detail would also be much appreciated)

A short summary of the paper mentioned in another answer and another good site.
Basically planes fly because they push enough air downwards and receive an upwards lift thanks to Newton's third law.
They do so in a variety of manners, but the most significant contributions are:

The angle of attack of the wings, which uses drag to push the air down. This is typical during take off (think of airplanes going upwards with the nose up) and landing (flaps). This is also how planes fly upside down.
The asymmetrical shape of the wings that directs the air passing over them downwards instead of straight behind. This allows planes to fly level to the ground without having a permanent angle on the wings.

Explanations showing a wing profile without an angle of attack are incorrect. Airplane wings are attached at an angle so they push the air down, and the airfoil shape lets them do so efficiently and in a stable configuration.

This incidence means that even when the airplane is at zero degrees, the wing is still at the 5 or 10 degree angle.

-- What is the most common degree for the angle of attack in 747's, 757's, and 767's

Any object with an angle of attack in a moving fluid, such as a flat plate, a building, or the deck of a bridge, will generate an aerodynamic force (called lift) perpendicular to the flow. Airfoils are more efficient lifting shapes, able to generate more lift (up to a point), and to generate lift with less drag.

--Airfoil


Question:
We are working on a product where the entire device needs to be dissolved in liquid after the device has operated and the device is no longer usable or desired.
This is a down-hole application.  The device body is either aluminum or magnesium.  There is a small lithium-ion battery plus a circuit board with some electronics.  There currently exists technology that can dissolve the aluminum body - a brine solution of about 5% Potassium Chloride (KCl) is circulated until the device is dissolved.
Our client would like to have the circuit board break down / dissolve as well.  The board is currently FR4 glass epoxy with traces on both top and bottom layers.  We will have a look to see if there is any chance that we can constrain the traces to the top-side layer only - this might allow us to use an aluminum circuit board.  However, I'm not hopeful this will be possible.
I'm looking for suggestions for either suitable PCB material OR techniques that might allow the board to be dissolved.
For example, we are considering using a much more fragile PCB material (paper-epoxy) and using a small explosive charge to shatter the board into much smaller pieces.  However, I'd like to learn about other techniques that might achieve our goal.
Note that is NOT a shopping question.  If someone can suggest a PCB material that would directly be suitable - that's awesome.  But I'm after other techniques that might achieve a similar outcome.
I'm aware that the individual components won't be dissolved by the brine solution.  However, the goal is to make the pieces small enough that they can be pumped without clogging the system - the pieces can be filtered out and discarded.
[Edit]
From the comments below:
1) Not military
2) PCB is currently about 1.5" x 1.0".  Was larger but we've been shrinking it.
3) Operate time from deployment to end of life is measured in hours.  I'm not the lead engineer on the project but I think there is sufficient battery capacity for about 24 hours of operation.
4) PCB is sealed inside a heavy-wall aluminum canister.  Circuit board is not exposed to any liquid during operational life.
5) Max temperature that we have been testing to is 100C.  Surprisingly, the particular Lipo battery that we are using is quite happy at that temperature.
6) The unit dissolving or breaking into smaller pieces is simply so that it doesn't cause obstruction when it has finished its job.  Nothing nefarious - just sort of "cleaning up after itself".

Researchers from the National Physical Laboratory (NPL), in London, in
  cooperation with partners In2Teck Ltd and Gwent Electronic Materials
  Ltd, have developed a 3D printable circuit board that separates into
  individual components when immersed in hot water.  The goal of the
  ReUSE project was to increase the recyclability of electronic
  assemblies in order to reduce the ever-increasing amount of electronic
  waste.

Source:
If that doesn't work, nitric acid will work on just about everything.
Oh, if you wanted to 'roll your own' manufacturing process, you could find a dissolveable material (maybe a some kind of cellulose?) and print on it with on of these PCB conductive ink printers:
As per Edgar Browns suggestion,  also this idea for dissolving polyimide for flat flex:

Try a mixture of Methanol:THF=1:1 , but it will take 1-2 days; The
  easiest way to dissolve Kapton - is to use 0.1-0.3M NaOH in water. By
  using alkaline solutions  you can completely decompose the Kapton -
  down to initial monomers.

NaOH is lye, I don't know in what concentration you would have to have to get kapton to dissolve but that seems like it would be easy to experiment with.


Question: If we convolve 2 signals we get a third signal. What does this third signal represent in relation to the input signals?

There's not particularly any "physical" meaning to the convolution operation. The main use of convolution in engineering is in describing the output of a linear, time-invariant (LTI) system. The input-output behavior of an LTI system can be characterized via its impulse response, and the output of an LTI system for any input signal $x(t)$ can be expressed as the convolution of the input signal with the system's impulse response.
Namely, if the signal $x(t)$ is applied to an LTI system with impulse response $h(t)$, then the output signal is:
$$
y(t) = x(t) * h(t) = \int_{-\infty}^{\infty}x(\tau)h(t - \tau)d\tau
$$
Like I said, there's not much of a physical interpretation, but you can think of a convolution qualitatively as "smearing" the energy present in $x(t)$ out in time in some way, dependent upon the shape of the impulse response $h(t)$. At an engineering level (rigorous mathematicians wouldn't approve), you can get some insight by looking more closely at the structure of the integrand itself. You can think of the output $y(t)$ as the sum of an infinite number of copies of the impulse response, each shifted by a slightly different time delay ($\tau$) and scaled according to the value of the input signal at the value of $t$ that corresponds to the delay: $x(\tau)$.
This sort of interpretation is similar to taking discrete-time convolution (discussed in Atul Ingle's answer) to a limit of an infinitesimally-short sample period, which again isn't fully mathematically sound, but makes for a decently intuitive way to visualize the action for a continuous-time system.


Question: Say I want to estimate a large number of parameters, and I want to penalize some of them because I believe they should have little effect compared to the others. How do I decide what penalization scheme to use? When is ridge regression more appropriate? When should I use lasso?

Keep in mind that ridge regression can't zero out coefficients; thus, you either end up including all the coefficients in the model, or none of them. In contrast, the LASSO does both parameter shrinkage and variable selection automatically. If some of your covariates are highly correlated, you may want to look at the Elastic Net [3] instead of the LASSO.
I'd personally recommend using the Non-Negative Garotte (NNG) [1] as it's consistent in terms of estimation and variable selection [2]. Unlike LASSO and ridge regression, NNG requires an initial estimate that is then shrunk towards the origin. In the original paper, Breiman recommends the least-squares solution for the initial estimate (you may however want to start the search from a ridge regression solution and use something like GCV to select the penalty parameter).
In terms of available software, I've implemented the original NNG in MATLAB (based on Breiman's original FORTRAN code). You can download it from:

BTW, if you prefer a Bayesian solution, check out [4,5].
References:
[1] Breiman, L. Better Subset Regression Using the Nonnegative Garrote Technometrics, 1995, 37, 373-384
[2] Yuan, M. & Lin, Y. On the non-negative garrotte estimator Journal of the Royal Statistical Society (Series B), 2007, 69, 143-161
[3] Zou, H. & Hastie, T. Regularization and variable selection via the elastic net Journal of the Royal Statistical Society (Series B), 2005, 67, 301-320
[4] Park, T. & Casella, G. The Bayesian Lasso Journal of the American Statistical Association, 2008, 103, 681-686
[5] Kyung, M.; Gill, J.; Ghosh, M. & Casella, G. Penalized Regression, Standard Errors, and Bayesian Lassos Bayesian Analysis, 2010, 5, 369-412


Question:
Reposted on MathOverflow

Let $\,A,B,C\in M_{n}(\mathbb C)\,$ be Hermitian and positive definite matrices such that $A+B+C=I_{n}$, where $I_{n}$ is the identity matrix. Show that $$\det\left(6(A^3+B^3+C^3)+I_{n}\right)\ge 5^n \det \left(A^2+B^2+C^2\right)$$

This problem is a  test question from China (xixi). It is said one can use the equation
$$a^3+b^3+c^3-3abc=(a+b+c)(a^2+b^2+c^2-ab-bc-ac)$$
but I can't use this to prove it. Can you help me?

Here is a partial and positive result, valid around the "triple point"
$A=B=C= \frac13\mathbb 1$.
Let $A,B,C\in M_n(\mathbb C)$ be Hermitian satisfying $A+B+C=\mathbb 1$, and additionally assume that
$$\|A-\tfrac13\mathbb 1\|\,,\,\|B-\tfrac13\mathbb 1\|\,,\,
\|C-\tfrac13\mathbb 1\|\:\leqslant\:\tfrac16\tag{1}$$
in the spectral or operator norm. (In particular, $A,B,C$ are positive-definite.)
Then we have
$$6\left(A^3+B^3+C^3\right)+\mathbb 1\:\geqslant\: 5\left(A^2+B^2+C^2\right)\,.\tag{2}$$
Proof:
Let $A_0=A-\frac13\mathbb 1$ a.s.o., then $A_0+B_0+C_0=0$, or
$\,\sum_\text{cyc}A_0 =0\,$ in notational short form.
Consider the

Sum of squares
$$\sum_\text{cyc}\big(A_0 + \tfrac13\mathbb 1\big)^2
\:=\: \sum_\text{cyc}\big(A_0^2 + \tfrac23 A_0+ \tfrac19\mathbb 1\big)
 \:=\: \sum_\text{cyc}A_0^2 \:+\: \tfrac13\mathbb 1$$
Sum of cubes
$$\sum_\text{cyc}\big(A_0 + \tfrac13\mathbb 1\big)^3
\:=\: \sum_\text{cyc}\big(A_0^3 + 3A_0^2\cdot\tfrac13
+ 3A_0\cdot\tfrac1{3^2} + \tfrac1{3^3}\mathbb 1\big) \\
\;=\: \sum_\text{cyc}A_0^3 \:+\: \sum_\text{cyc}A_0^2 \:+\: \tfrac19\mathbb 1$$
to obtain
$$6\sum_\text{cyc}\big(A_0 + \tfrac13\mathbb 1\big)^3+\mathbb 1
\;-\; 5\sum_\text{cyc}\big(A_0 + \tfrac13\mathbb 1\big)^2
\:=\: \sum_\text{cyc}A_0^2\,(\mathbb 1 + 6A_0) \:\geqslant\: 0$$
where positivity is due to each summand being a product of commuting positive-semidefinite matrices.
$\quad\blacktriangle$

Two years later observation:
In order to conclude $(2)$ the additional assumptions $(1)$ may be weakened a fair way off to
$$\tfrac16\mathbb 1\:\leqslant\: A,B,C\tag{3}$$
or equivalently, assuming the smallest eigenvalue of each matrix $A,B,C\,$ to be at least $\tfrac16$.
Proof:
Consider the very last summand in the preceding proof.
Revert notation from $A_0$ to $A$ and use the same argument, this time based on $(3)$, to obtain
$$\sum_\text{cyc}\big(A-\tfrac13\mathbb 1\big)^2\,(6A -\mathbb 1)\:\geqslant\: 0\,.\qquad\qquad\blacktriangle$$


Question:
Is anyone aware of any research/papers/software for identifying a trail (as a line or point-to-point curve) in an image of a forest scene (from the perspective of the camera standing somewhere along the trail)?
I'm trying to find an algorithm that could take an image like:

and produce a mask, identifying a likely "trail", such as:

As you can see, the original image is a bit blurry, which is purposeful. The image source can't guarantee perfect focus, so I need to be able to handle a reasonable amount of noise and blurriness.
My first thought was to apply a Gaussian blur, and segment the image into blocks, comparing adjacent blocks looking for sharp color differences (indicating a trail "edge"). However, I quickly realized that shadows and other changes in lighting easily throws that off.
I was thinking about extracting SURF features, but I've only had success with SURF/SIFT when the image is perfectly clear and with consistent lighting.
I've also tried scaling the images and masks down to much smaller sizes (e.g. 100x75), converting them into 1xN vectors, and using them to train a FANN-based neural network (where the image is the input and the mask is the desired output). Even at such a small size, with 1 hidden layer with 75% the size of the input vector, it took 6 hours to train, and still couldn't predict any masks in the testing set.
Can anyone suggest any other methods or papers on the subject?

I don't believe you have enough information in the source image to produce the mask image.  You might start by segmenting on color, i.e. green is not trail, gray/brown is.  However, there are gray/brown regions on the "trail borders" that are not represented in your mask.  (See the lower left quadrant of your source image.)
The mask you provide implies structural constraints not evident in the source image: for example, perhaps your trails are of fixed width - then you can use that information to constrain the preliminary mask returned by your pattern recognizer.
Continuing the topic of structure: Do trails merge with others? Are trails delineated with certain soil/gravel features?  As a human (that is reasonably good at pattern recognition!), I'm challenged by the features shown in the lower left quadrant: I see gray/brown regions that I cannot discount as "trail".  Perhaps I could do so conclusively if I had more information: a map and a coarsely-known location, personal experience on this trail, or perhaps a sequence of images leading to this point - perhaps this view is not so ambiguous if the recognizer "knows" what led to this scene.
A collection of images is the most interesting approach in my opinion. Continuing that line of thought: one image might not provide enough data, but a panoramic view might disambiguate the scene.


Question:
We were given the following exercise.

Let
$\qquad \displaystyle f(n) = \begin{cases} 1 & 0^n \text{ occurs in the decimal representation of } \pi \\ 0 & \text{else}\end{cases}$
Prove that $f$ is computable.

How is this possible? As far as I know, we do not know wether $\pi$ contains every sequence of digits (or which) and an algorithm can certainly not decide that some sequence is not occurring. Therefore I think $f$ is not computable, because the underlying problem is only semi-decidable.

There are only two possibilities to consider.

For every positive integer $n$, the string $0^n$ appears in the decimal representation of $\pi$.  In this case, the algorithm that always returns 1 is always correct.
There is a largest integer $N$ such that $0^N$ appears in the decimal representation of $\pi$.  In this case the following algorithm (with the value $N$ hard-coded) is always correct:
Zeros-in-pi(n):
 if (n > N) then return 0 else return 1

We have no idea which of these possibilities is correct, or what value of $N$ is the right one in the second case.  Nevertheless, one of these algorithms is guaranteed to be correct.  Thus, there is an algorithm to decide whether a string of $n$ zeros appears in $\pi$; the problem is decidable.

Note the subtle difference with the following proof sketch proposed by gallais:

Take a random Turing machine and a random input.
Either the computation will go on for ever or it will stop at some point and there is a (constant) computable function describing each one of these behaviors.
???
Profit!

Alex ten Brink explains:

watch out what the Halting theorem states: it says that there exists no single program that can decide whether a given program halts. You can easily make two programs such that either one computes whether a given program halts: the first always says 'it halts', the second 'it doesn't halt' - one program is always right, we just can't compute which one of them is!

sepp2k adds:

In the case of Alex's example neither of the algorithms will return the right result for all inputs. In the case of this question one of them will. You can claim that the problem is decidable because you know that there is an algorithm that produces the right result for all inputs. It doesn't matter whether you know which one that algorithm is.
  10


Question:
Why do human women have periods when most animals don't? It is known that the unfertilized egg needs to be shed from the uterus. But why shed the whole endometrium? Why didn't evolution put macrophages to work to simply digest the ovum and only the ovum, instead of the physiologically, energy-draining process of menstruation and accompanying blood loss? Also, are there any other purposes for menstruation, besides wiping out dead ova?
Sites I used for references:
 1. Jensen et al., Am J Reprod Immunol (2012); 68(5): 374–386 -                       Menstruation seems energy draining, in my perspective, given that 30-40 ml of blood is lost × 3-4 days × 12 months × 15 years on average - that is a lot of blood loss.
 2. Also see this Quora post.

Related question: Why is menstruation in wild animals not a disadvantage to organismal survival?.

My question is different from this related question because there the OP is concerned about the survival advantage of the menstruation with respect to the predators. Here I've asked why menstruation and why not phagocytosis as the former to me seems to be highly energy consuming process. Also as the fellow post writer had earlier suggested though the two questions  seem to be one and the same, they are subtly different and aimed for two different audiences as I emphasise more on the physiological aspects of menstruation and the related question's OP needs clarification about survival advantage and other ecological aspects of menstruation.

Short answer
Shedding or reabsorbing the endometrial lining is energetically advantageous to the female.The advantage of shedding over re-absorption may be that sperm-born pathogens are removed from the uterus. A more parsimonious explanation, however, is that the endometrium in primates has developed into too large of a structure to be completely reabsorbed by the uterus wall.
Background
Basically you ask why are estrous cycles in mammals accompanied by regression and build up of the endometrial lining? The main reason for either reabsorbing or shedding the endometrial lining is thought to be to save energy. It has been calculated that, when implantation fails, a cyclical regression and renewal of the endometrium is energetically less costly than maintaining it in a metabolically active state required for implantation. In the regressed state, oxygen consumption in human endometria declines nearly sevenfold. Metabolic rate is at least 7% lower, on average, during the follicular phase than during the luteal phase in women, which signifies an estimated energy savings of 53 MJ over four cycles, or nearly six days worth of food (Strassmann, 1996; Crawford, 1998).
In fact, impaired shedding of the endometrial lining may lead to pathologies. If no egg is released and the estrogen/progesterone system becomes imbalanced, the endometrium may continue to thicken, instead of breaking down and being shed normally as a menstrual period. This abnormal thickening is called endometrial hyperplasia. Periodically, the thickened lining is shed incompletely and irregularly, causing irregular and more heavy bleeding. If this cycle of abnormal thickening and irregular shedding continues, precancerous cells may develop, increasing the risk of cancer of the uterine lining (endometrial cancer), even in young women (source: MSD manual).
Now the question of why human females shed the endometrial lining instead of resorbing it? Indeed, shedding the endometrium is mainly limited to primates, as opposed to reabsorbing it (like in most other mammals). Here, I do not have a definitive answer, but I like to share two opposing hypothesis on the matter.

Hypothesis 1:  Profet (1993) hypothesized that shedding the endometrium may be an effective way to get rid of sperm-based pathogens. The accompanying bleeding, Profet hypothesizes, delivers immune cells into the uterine cavity that can combat pathogens.
Hypothesis 2: Strassmann (1996) surmises that the endometrial microvasculature is designed to provide the blood supply to the endometrium and the placenta, and that external bleeding appears to be a side effect of endometrial regression that arises when there is too much blood and other tissue for complete reabsorption. The relatively large blood loss as seen in humans and chimpanzees can be attributed to the large size of the uterus relative to adult female size and to the design of the microvasculature in the uterus wall.

References
- Crawford (ed), Handbook of Evolutionary Psychology: Ideas, Issues, and Applications, Psychology Press (1998)
- Profet,  Quarterly Rev Biol (1993); 68(3): 355-86
- Strassmann, Quarterly Rev Biol (1996);71(2): 181-220


Question:
I apologize if this is a vague question, but here goes:
Over the past few years, functional programming has received a lot of attention in the Software Engineering community. Many have started using languages such as Scala and Haskell and claimed success over other programming languages and paradigms. My question is: as high performance computing / scientific computing experts, should we be interested in functional programming? Should we be participating in this mini-revolution?
What are the pros and cons of functional programming in the SciComp domain of work?

I've only done a little bit of functional programming, so take this answer with a grain of salt.
Pros:

Functional programming looks very mathematical; it's a nice paradigm for expressing some mathematical concepts
There are good libraries available for things like formal verification of programs and theorem proving, so it's possible to write programs that reason about programs -- this aspect is good for reproducibility
You can do functional programming in Python and C++ via lambda expressions; you can also do functional programming in Julia and Mathematica
Not many people use it, so you can be a pioneer. Much like there were early adopters of MATLAB, Python, R, and now Julia, there need to be early adopters of functional programming for it to catch on

Cons:

Languages that are typically thought of as functional programming languages, like Haskell, OCaml (and other ML dialects), and Lisp are generally thought of as slow relative to languages used for performance-critical scientific computing. OCaml is, at best, around half as fast as C.
These languages lack library infrastructure compared to languages commonly used in computational science (Fortran, C, C++, Python); if you want to solve a PDE, it's way easier to do it in a language more commonly used in computational science than one that is not.
There isn't as much of a computational science community using functional programming languages as there is using procedural languages, which means you won't get a whole lot of help learning it or debugging it, and people are probably going to give you crap for using it (whether or not you deserve it)
The style of functional programming is different than the style used in procedural programming, which is typically taught in introductory computer science classes and in "MATLAB for Scientists and Engineers"-type classes

I think many of the objections in the "Cons" section could be overcome. As is a common point of discussion on this Stack Exchange site, developer time is more important than execution time. Even if functional programming languages are slow, if performance-critical portions can be delegated to a faster procedural language and if productivity gains can be demonstrated through rapid application development, then they might be worth using. It's worth noting here that programs implemented in pure Python, pure MATLAB, and pure R are considerably slower than implementations of these same programs in C, C++, or Fortran. Languages like Python, MATLAB, and R are popular precisely because they trade execution speed for productivity, and even then, Python and MATLAB both have facilities for implementing interfaces to compiled code in C or C++ so that performance-critical code can be implemented to execute quickly. Most languages have a foreign function interface to C, which would be enough to interface with most libraries of interest to computational scientists.
Should you be interested in functional programming?
That all depends on what you think is cool. If you're the type of person who is willing to buck convention and you're willing to go through the slog of evangelizing to people about the virtues of whatever it is you want to do with functional programming, I'd say go for it. I would love to see people do cool things with functional programming in computational science, if for no other reason than to prove all of the naysayers wrong (and there will be a lot of naysayers). If you're not the type of person who wants to deal with a bunch of people asking you, "Why in hell are you using a functional programming language instead of (insert their favorite procedural programming language here)?", then I wouldn't bother.
There's been some use of functional programming languages for simulation-intensive work. The quantitative trading firm Jane Street uses OCaml for financial modeling and execution of its trading strategies. OCaml was also used in FFTW for generating some C code used in the library. Liszt is a domain-specific language developed at Stanford and implemented in Scala that is used for solving PDEs. Functional programming is definitely used in industry (not necessarily in computational science); it remains to be seen whether it will take off in computational science.