Question: I read that 'Euclidean distance is not a good distance in high dimensions'. I guess this statement has something to do with the curse of dimensionality, but what exactly? Besides, what is 'high dimensions'? I have been applying hierarchical clustering using Euclidean distance with 100 features. Up to how many features is it 'safe' to use this metric?

A great summary of non-intuitive results in higher dimensions comes from "A Few Useful Things to Know about Machine Learning" by Pedro Domingos at the University of Washington:

[O]ur intuitions, which come from a three-dimensional world, often do not apply in high-dimensional ones. In high dimensions, most of the mass of a multivariate Gaussian distribution is not near the mean, but in an increasingly distant “shell” around it; and most of the volume of a high-dimensional orange is in the skin, not the pulp. If a constant number of examples is distributed uniformly in a high-dimensional hypercube, beyond some dimensionality most examples are closer to a face of the hypercube than to their nearest neighbor. And if we approximate a hypersphere by inscribing it in a hypercube, in high dimensions almost all the volume of the hypercube is outside the hypersphere. This is bad news for machine learning, where shapes of one type are often approximated by shapes of another.

The article is also full of many additional pearls of wisdom for machine learning.
Another application, beyond machine learning, is nearest neighbor search: given an observation of interest, find its nearest neighbors (in the sense that these are the points with the smallest distance from the query point). But in high dimensions, a curious phenomenon arises: the ratio between the nearest and farthest points approaches 1, i.e. the points essentially become uniformly distant from each other. This phenomenon can be observed for wide variety of distance metrics, but it is more pronounced for the Euclidean metric than, say, Manhattan distance metric. The premise of nearest neighbor search is that "closer" points are more relevant than "farther" points, but if all points are essentially uniformly distant from each other, the distinction is meaningless.
From Charu C. Aggarwal, Alexander Hinneburg, Daniel A. Keim, "On the Surprising Behavior of Distance Metrics in High Dimensional Space":

It has been argued in [Kevin Beyer, Jonathan Goldstein, Raghu Ramakrishnan, Uri Shaft, "When Is 'Nearest Neighbor' Meaningful?"] that under certain reasonable assumptions on the data distribution, the ratio of the distances of the nearest and farthest neighbors to a given target in high dimensional space is almost 1 for a wide variety of data distributions and distance functions. In such a case, the nearest neighbor problem becomes ill defined, since the contrast between the distances to diferent data points does not exist. In such cases, even the concept of proximity may not be meaningful from a qualitative perspective: a problem which is even more fundamental than the performance degradation of high dimensional algorithms.
... Many high-dimensional indexing structures and algorithms use the [E]uclidean distance metric as a natural extension of its traditional use in two- or three-dimensional spatial applications. ... In this paper we provide some surprising theoretical and experimental results in analyzing the dependency of the $L_k$ norm on the value of $k$. More specifically, we show that the relative contrasts of the distances to a query point depend heavily on the $L_k$ metric used. This provides considerable evidence that the meaningfulness of the $L_k$ norm worsens faster within increasing dimensionality for higher values of $k$. Thus, for a given problem with a fixed (high) value for the dimensionality $d$, it may be preferable to use lower values of $k$. This means that the $L_1$ distance metric (Manhattan distance metric) is the most preferable for high dimensional applications, followed by the Euclidean metric ($L_2$). ...

The authors of the "Surprising Behavior" paper then propose using $L_k$ norms with $k<1$. They produce some results which demonstrate that these "fractional norms" exhibit the property of increasing the contrast between farthest and nearest points. However, later research has concluded against fractional norms. See: "Fractional norms and quasinorms do not help to overcome the curse of dimensionality" by Mirkes, Allohibi, & Gorban (2020). (Thanks to michen00 for the comment and helpful citation.)


Question:
Are there any tools specifically designed for compressing floating point scientific data?
If a function is smooth, there's obviously a lot of correlation between the numbers representing that function, so the data should compress well.  Zipping/gzipping binary floating point data doesn't compress it that well though.  I am wondering if there are methods specifically developed for compressing floating point data.
Requirements:

Either lossless compression or the possibility to specify a minimum number of digits to retain (for some applications double might be more than what we need while float might not have enough precision).

Well tested working tool (i.e. not just a paper describing a theoretical method).

Suitable for compressing 1D numerical data (such as a time series)

Cross platform (must work on Windows)

It must be fast---preferably not much slower than gzip.  I found that if I have the numbers stored as ASCII, gzipping the file can speed up reading and processing it (as the operation might be I/O bound).

I'd especially like to hear from people who have actually used such a tool.

Try out Blosc.  It is in many cases faster than memcopy.  Think about that for a second. . . wicked.
It is super stable, highly-vetted, cross-platform, and performs like a champ.


Question:
I'm looking for cases of invalid math operations producing (in spite of it all) correct results (aka "every math teacher's nightmare").
One example would be "cancelling" the 6s in
$$\frac{64}{16}$$
Another one would be something like
$$\frac{9}{2} - \frac{25}{10} = \frac{9 - 25}{2 - 10} = \frac{-16}{-8} = 2 \;\;$$
Yet another one would be
$$x^1 - 1^0 = (x - 1)^{(1 - 0)} = x - 1\;\;$$
Note that I am specifically not interested in mathematical fallacies (aka spurious proofs).  Such fallacies produce shockingly wrong ends by (seemingly) valid means, whereas what I am looking for are cases where one arrives at valid ends by (shockingly) wrong means.

I was quite amused when a student produced the following when cancelling a fraction:
$$\frac{x^2-y^2}{x-y}$$
He began by "cancelling" the $x$ and the $y$ on top and bottom, to get:
$$\frac{x-y}{-}$$
and then concluded that "two negatives make a positive", so the final answer has to be $x+y$.


Question:
Mammals, reptiles, arachnids, insects, etc are all as far as I am aware symmetrical in appearance.
Take a human for instance, make a line from the top of our head right down the middle. However, internally it is not the same. Our organs excluding the kidneys, lungs, reproductive organs, etc are not symmetrically placed in our body.

Why do we not have an even number of each organ so it can be placed symmetrically?
If we have a single organ why is it not placed in the middle like the brain or bladder is for instance?
Is there some evolutionary advantage that led to this setup?

First, I think it worthwhile considering 'Why would internal symmetry be beneficial?' Developmental simplicity jumps to mind immediately. You can also consider relationship to external organs; the stomach and esophagus are lined up with the mouth which is symmetrical about the sagittal plane. Or maybe even balance; the lungs are large organs and if put to one side would likely cause locomotive issues. (Perhaps this is even an interesting topic for another question.)
That said, I feel, at it's core the evolutionary advantage which led to the lack of ubiquitous internal symmetry is space. Simply put, there is only so much room inside an organism and every little counts. Thus, if there isn't a need for a particular organ to be mirrored about a plane then there is a benefit in putting elsewhere: utilization of space.
I think a fantastic example of this is the human digestive tract. The key factor in the shape of the intestines is utilization of space, which directly affects the point at which is connects to the stomach, itself contributing to the asymmetrical shape of the stomach. One could envision other configurations, sure, and nature has. However, this configuration works quite well and the extraordinary use of limited space seems to outweigh all benefits of symmetry.
To directly respond to your questions above:

Question: Why do we not have an even number of each organ so it can be placed symmetrically?
Response: Each organ addresses (or addressed) a need of the organism. Addressing that need with multiple organs working in concert has benefits and consequences, as does addressing the need with a single organ alone. These benefits and consequences are balanced throughout the evolution of an organism.
Question: If we have a single organ why is it not placed in the middle like the brain or bladder is for instance?
Response: I feel space. Again, there are benefits to symmetry but there are many other factors at play. Some of which, it seems, are more important than symmetry at times.
Question: Is there some evolutionary advantage that led to this setup?
Response: I hope this has been addressed - I don't claim to have 'answered' anything, this is a question for discussion.

Other fuel for discussion:
In thinking through this question I found myself able to rationalize why internal symmetry isn't necessary. However, I'd be interested in seeing opinions on why, then, external symmetry is so prevalent.


Question:
Can anyone recommend me a good workflow management system (WMS), preferably in Python? So far I have been using GNU Make, but it introduces a layer of complexity that I want to avoid. A good WMS should have the following features:

integrate easily with command line tools and Python scripts,
simple to use and lightweight,
handle dependencies,
provide command line interface,
provide logging mechanism,
(optional) provide data provenance.

I know that WMS are very popular in bioinformatics (for example Galaxy), but I am looking for something more general.

For logging that allows full reproducibility, I highly recommend the Sumatra python package. It nicely links the version control commit number, machine state, and output files to each program run and has a django web interface to interact with the database of run info. The python API makes it very easy to include logging in my scripts.


Question:
I am reading the datasheet of an ARM Cortex chip, specifically the GPIO chapter. Ultimately, I want to configure various GPIO pins to use them in "Alternate Function" mode for read/write access to SRAM.
Of all the GPIO registers available, I do not understand two: GPIO_PUPDR and GPIO_OTYPE which are respectively the "pull-up/pull-down register" and the "output type register".
For GPIO_PUPDR I have three choices:

No pull-up or pull-down
Pull-up
Pull down

For GPIO_0TYPE I have two choices:

Output push-pull
Output open-drain

What is the difference between all the different configurations, and which would be the most appropriate for SRAM communication?
The documentation for the board I am working on is available here (see page 24 for the SRAM schematics). The reference manual for the ARM Chip is available here (see pages 145 and 146 for the GPIO registers).

This answer is general to processors and peripherals, and has an SRAM specific comment at the end, which is probably pertinent to your specific RAM and CPU.
Output pins can be driven in three different modes:

open drain - a transistor connects to low and nothing else
open drain, with pull-up - a transistor connects to low, and a resistor connects to high
push-pull - a transistor connects to high, and a transistor connects to low   (only one is operated at a time)

Input pins can be a gate input with a:

pull-up - a resistor connected to high
pull-down -  a resistor connected to low
pull-up and pull-down  - both a resistor connected to high and a resistor connected to low (only useful in rare cases).

There is also a Schmitt triggered input mode where the input pin is pulled with a weak pull-up to an initial state. When left alone it persists in its state, but may be pulled to a new state with minimal effort.
Open drain is useful when multiple gates or pins are connected together with an (external or internal) pull-up. If all the pin are high, they are all open circuits and the pull-up drives the pins high. If any pin is low they all go low as they tied together. This configuration effectively forms an AND gate.
_____________________________
Note added November 2019 - 7+ years on: The configuration of combining multiple open collector/drain outputs has traditionally been referred to as a "Wired OR" configuration. CALLING it an OR (even traditionally) does not make it one. If you use negative logic (which traditionally may have been the case) things will be different, but in the following I'll stick to positive logic convention which is what is used as of right unless specifically stated.
The above comment about forming an 'AND' gate has been queried a number of times over the years - and it has been suggested that the result is 'really' an 'OR' gate. It's complex.
The simple picture' is that if several open collector outputs are connected together then if any one of the open collector transistors is turned on then the common output will be low.  For the common output to be high all outputs must be off.
If you consider combining 3 outputs - for the result to be high all 3 would need to have been high individually. 111 -> 1. That's an 'AND'.
If you consider each of the output stages as an inverter then for each one to have a high output it's input must be low. So to get a combined high output you need three  000 -> 1 . That's a 'NOR'.
Some have suggested that this is an OR - Any of XYZ with at least 1 of these is a 1 -> 1.
I can't really "force" that idea onto the situation.
_________________________________
When driving an SRAM you probably want to drive either the data lines or the address lines high or low as solidly and rapidly as possible so that active up and down drive is needed, so push-pull is indicated. In some cases with multiple RAMs you may want to do something clever and combine lines, where another mode may be more suitable.
With SRAM with data inputs from the SRAM if the RAM IC is always asserting data then a pin with no pull-up is probably OK as the RAM always sets the level and this minimises load. If the RAM data lines are sometimes open circuit or tristate you will need the input pins to be able to set their own valid state. In very high speed communications you may want to use a pull-up and a pull-down so the parallel effective resistance is the terminating resistance, and the bus idle voltage is set by the two resistors, but this is somewhat specialist.


Question:
Why do most mammals produce their own Vitamin C?
Why do Humans not?

Humans do not produce Vitamin C due to a mutation in the GULO (gulonolactone oxidase) gene, which results in the inability to synthesize the protein.  Normal GULO is an enzyme that catalyses the reaction of D-glucuronolactone with oxygen to L-xylo-hex-3-gulonolactone.  This then spontaneously forms Ascorbic Acid (Vitamin C).  However without the GULO enzyme, no vitamin C is produced.
This has not been selected against in natural selection as we are able to consume more than enough vitamin C from our diet.  It is also suggested that organisms without a functional GULO gene have a method of "recycling" the vitamin C that they obtain from their diets using red blood cells (see Montel-Hagen et al. 2008).
A 2008 published study (Li et al. 2008) claimed to have successfully re-instated the ability to produce vitamin C in mice.
Simply as trivia: other than humans; guinea pigs, bats and dry-nosed primates have lost their ability to produce vitamin C in the same way.

References

Li, Y., Shi, C.-X., Mossman, K.L., Rosenfeld, J., Boo, Y.C. &
Schellhorn, H.E. (2008) Restoration of vitamin C synthesis in
transgenic Gulo-/- mice by helper-dependent adenovirus-based
expression of gulonolactone oxidase. Human gene therapy. [Online] 19
(12), 1349–1358. Available from: doi:10.1089/hgt.2008.106 [Accessed:
31 December 2011].
Montel-Hagen, A., Kinet, S., Manel, N., Mongellaz, C., Prohaska, R.,
Battini, J.-L., Delaunay, J., Sitbon, M. & Taylor, N. (2008)
Erythrocyte Glut1 Triggers Dehydroascorbic Acid Uptake in Mammals
Unable to Synthesize Vitamin C. Cell. [Online] 132 (6), 1039–1048.
Available from: doi:10.1016/j.cell.2008.01.042 [Accessed: 31 December
2011].


Question:
In Density Functional Theory courses, one is often reminded that Kohn-Sham orbitals are often said to bear no any physical meaning. They only represent a noninteracting reference system which has the same electron density as the real interacting system.
That being said, there are plenty of studies in that field’s literature that given KS orbitals a physical interpretation, often after a disclaimer similar to what I said above. To give only two examples, KS orbitals of H2O[1] and CO2 closely resemble the well-known molecular orbitals.
Thus, I wonder: What good (by virtue of being intuitive, striking or famous) examples can one give as a warning of interpreting the KS orbitals resulting from a DFT calculation?

[1] “What Do the Kohn-Sham Orbitals and Eigenvalues Mean?”, R. Stowasser and R. Hoffmann, J. Am. Chem. Soc. 1999, 121, 3414–3420.

When people say that Kohn-Sham orbitals bear no physical meaning, they mean it in the sense that nobody has proved mathematically that they mean anything. However, it has been empirically observed that many times, Kohn-Sham orbitals often do look very much like Hartree-Fock orbitals, which do have accepted physical interpretations in molecular orbital theory. In fact, the reference in the OP lends evidence to precisely this latter viewpoint.
To say that orbitals are "good" or "bad" is not really that meaningful in the first place. A basic fact that can be found in any electronic structure textbook is that in theories that use determinantal wavefunctions such as Hartree-Fock theory or Kohn-Sham DFT, the occupied orbitals form an invariant subspace in that any (unitary) rotation can be applied to the collection of occupied orbitals while leaving the overall density matrix unchanged. Since any observable you would care to construct is a functional of the density matrix in SCF theories, this means that individuals orbitals themselves aren't physical observables, and therefore interpretations of any orbitals should always be undertaken with caution.
Even the premise of this question is not quite true. The energies of Kohn-Sham orbitals are known to correspond to ionization energies and electron affinities of the true electronic system due to Janak's theorem, which is the DFT analogue of Koopmans' theorem. It would be exceedingly strange if the eigenvalues were meaningful while their corresponding eigenvectors were completely meaningless.


Question:
I was writing some exercises about the AM-GM inequality and I got carried away by the following (pretty nontrivial, I believe) question:

Q: By properly folding a common $210mm\times 297mm$ sheet of paper, what
  is the maximum amount of water such a sheet is able to contain?

The volume of the optimal box (on the right) is about $1.128l$. But the volume of the butterfly (in my left hand) seems to be much bigger and I am not sure at all about the shape of the optimal folded sheet. Is is something boat-like?
Clarifications: we may assume to have a magical glue to prevent water from leaking through the cracks, or for glueing together points of the surface. Solutions where parts of the sheet are cut out, then glued back together deserve to be considered as separate cases. On the other hand these cases are trivial, as pointed by joriki in the comments below. The isoperimetric inequality gives that the maximum volume is $<2.072l$.
As pointed out by Rahul, here it is a way for realizing the optimal configuration: the maximum capacity of the following A4+A4 bag exceeds $2.8l$.

This problem reminds me of tension field theory and related problems in studying the shape of inflated inextensible membranes (like helium balloons). What follows is far from a solution, but some initial thoughts about the problem.
First, since you're allowing creasing and folding, by Nash-Kuiper it's enough to consider short immersions
$$\phi:P\subset\mathbb{R}^2\to\mathbb{R}^3,\qquad \|d\phi^Td\phi\|_2 \leq 1$$
of the piece of paper $P$ into $\mathbb{R}^3$, the intuition being that you can always "hide" area by adding wrinkling/corrugation, but cannot "create" area. It follows that we can assume, without loss of generality, that $\phi$ sends the paper boundary $\partial P$ to a curve $\gamma$ in the plane.
We can thus partition your problem into two pieces: (I) given a fixed curve $\gamma$, what is the volume of the volume-maximizing surface $M_{\gamma}$ with $\phi(\partial P) = \gamma$? (II) Can we characterize $\gamma$ for which $M_{\gamma}$ has maximum volume?

Let's consider the case where $\gamma$ is given. We can partition $M_{\gamma}$ into
1) regions of pure tension, where $d\phi^Td\phi = I$; in these regions $M_{\gamma}$ is, by definition, developable;
2) regions where one direction is in tension and one in compression, $\|d\phi^Td\phi\|_2 = 1$ but $\det d\phi^Td\phi < 1$.
We need not consider $\|d\phi^Td\phi\|_2 < 1$ as in such regions of pure compression, one could increase the volume while keeping $\phi$ a short map.
Let us look at the regions of type (2). We can trace on these regions a family of curves $\tau$ along which $\phi$ is an isometry. Since $M_{\gamma}$ maximizes volume, we can imagine the situation physically as follows: pressure inside $M_{\gamma}$ pushes against the surface, and is exactly balanced by stress along inextensible fibers $\tau$. In other words, for some stress $\sigma$ constant along each $\tau$, at all points $\tau(s)$ along $\tau$ we have
$$\hat{n} = \sigma \tau''(s)$$
where $\hat{n}$ the surface normal; it follows that (1) the $\tau$ follow geodesics on $M_{\gamma}$, (2) each $\tau$ has constant curvature.

The only thing I can say about problem (II) is that for the optimal $\gamma$, the surface $M_\gamma$ must meet the plane at a right angle. But there are many locally-optimal solutions that are not globally optimal (for example, consider a half-cylinder (type 1 region) with two quarter-spherical caps (type 2 region); it has volume $\approx 1.236$ liters, less than Joriki's solution).

I got curious so I implemented a quick-and-dirty tension field simulation that optimizes for $\gamma$ and $M_{\gamma}$. Source code is here (needs the header-only Eigen and Libigl libraries):
Here is a rendering of the numerical solution, from above and below (the volume is roughly 1.56 liters).

EDIT 2: A sketch of the orientation of $\tau$ on the surface:


Question: What function is served by the epidermal or capillary ridges on human fingers, the supposedly unique impressions of which are known as fingerprints?

I found many plausible claims that fingerprints increase friction. However, the following article claims, at least under their experimental conditions, that fingerprints actually decrease friction with smooth surfaces by reducing contact area.
Fingerprints are unlikely to increase the friction of primate fingerpads.

It is generally assumed that fingerprints improve the grip of primates, but the efficiency of their ridging will depend on the type of frictional behaviour the skin exhibits. Ridges would be effective at increasing friction for hard materials, but in a rubbery material they would reduce friction because they would reduce contact area. In this study we investigated the frictional performance of human fingertips on dry acrylic glass using a modified universal mechanical testing machine, measuring friction at a range of normal loads while also measuring the contact area. Tests were carried out on different fingers, fingers at different angles and against different widths of acrylic sheet to separate the effects of normal force and contact area. The results showed that fingertips behaved more like rubbers than hard solids; their coefficients of friction fell at higher normal forces and friction was higher when fingers were held flatter against wider sheets and hence when contact area was greater. The shear stress was greater at higher pressures, suggesting the presence of a biofilm between the skin and the surface. Fingerprints reduced contact area by a factor of one-third compared with flat skin, however, which would have reduced the friction; this casts severe doubt on their supposed frictional function.

That said, the author does later discuss their potential role in gripping of rough or wet surfaces:

So why do we have fingerprints? One possibility is that they increase friction on rougher surfaces compared with flat skin, because the ridges project into the depressions of such surfaces and provide a higher contact area. Experiments on materials of contrasting known roughness are needed to test this possibility.
A second possibility is that they facilitate runoff of water like the tread of a car tyre or grooves in the feet of tree frogs (Federle et al., 2006), so that they improve grip on wet surfaces. Though there is evidence that friction falls on fingers coated with high levels of moisture (Andre et al., 2008) it is possible that it falls less quickly on fingertips than on flatter skin. Once more, suitable experiments could test this idea.

There seems to be more consensus on the idea that fingerprints are useful for tactile sensation. The following are just some articles which discuss this.
Effect of fingerprints orientation on skin vibrations during tactile exploration of textured surfaces.

In humans, the tactile perception of fine textures is mediated by skin vibrations when scanning the surface with the fingertip. These vibrations are encoded by specific mechanoreceptors, Pacinian corpuscules (PCs), located about 2 mm below the skin surface. In a recent article, we performed experiments using a biomimetic sensor which suggest that fingerprints (epidermal ridges) may play an important role in shaping the subcutaneous stress vibrations in a way which facilitates their processing by the PC channel. Here we further test this hypothesis by directly recording the modulations of the fingerpad/substrate friction force induced by scanning an actual fingertip across a textured surface. When the fingerprints are oriented perpendicular to the scanning direction, the spectrum of these modulations shows a pronounced maximum around the frequency v/λ, where v is the scanning velocity and λ the fingerprints period. This simple biomechanical result confirms the relevance of our previous finding for human touch.

The role of fingerprints in the coding of tactile information probed with a biomimetic sensor.

In humans, the tactile perception of fine textures (spatial scale <200 micrometers) is mediated by skin vibrations generated as the finger scans the surface. To establish the relationship between texture characteristics and subcutaneous vibrations, a biomimetic tactile sensor has been designed whose dimensions match those of the fingertip. When the sensor surface is patterned with parallel ridges mimicking the fingerprints, the spectrum of vibrations elicited by randomly textured substrates is dominated by one frequency set by the ratio of the scanning speed to the interridge distance. For human touch, this frequency falls within the optimal range of sensitivity of Pacinian afferents, which mediate the coding of fine textures. Thus, fingerprints may perform spectral selection and amplification of tactile information that facilitate its processing by specific mechanoreceptors.

This paper also asserts a reason for the elliptical nature of fingerprints:

In humans, fingerprints are organized in elliptical twirls so that each region of the fingertip (and thus each PC) can be ascribed with an optimal scanning orientation.


Question: What is the true meaning of a minimum phase system? Reading the Wikipedia article and Oppenheim is some help, in that, we understand that for an LTI system, minimum phase means the inverse is causal and stable. (So that means zeros and poles are inside the unit circle), but what does "phase" and "minimum" have to do with it? Can we tell a system is minimum phase by looking at the phase response of the DFT somehow?

The relation of "minimum" to "phase" in a minimum phase system or filter can be seen if you plot the unwrapped phase against frequency.  You can use a pole zero diagram of the system response to help do a incremental graphical plot of the frequency response and phase angle.  This method helps in doing a phase plot without phase wrapping discontinuities.
Put all the zeros inside the unit circle (or in left half plane in the continuous-time case), where all the poles have to be as well for system stability.  Add up the angles from all the poles, and the negative of the angles from all the zeros, to calculate total phase to a point on the unit circle, as that frequency response reference point moves around the unit circle.  Plot phase vs. frequency.  Now compare this plot with a similar plot for a pole-zero diagram with any of the zeros swapped outside the unit circle (non-minimum phase).  The overall average slope of the line with all the zeros inside will be lower than the average slope of any other line representing the same LTI system response (e.g. with a zero reflected outside the unit circle).  This is because the "wind ups" in phase angle are all mostly cancelled by the "wind downs" in phase angle only when both the poles and zeros are on the same side of the unit circle line.  Otherwise, for each zero outside, there will be an extra "wind up" of increasing phase angle that will remain mostly uncancelled as the plot reference point "winds" around the unit circle from 0 to PI.  (...or up the vertical axis in the continuous-time case.)
This arrangement, all the zeros inside the unit circle, thus corresponds to the minimum total increase in phase, which corresponds to minimum average total phase delay, which corresponds to maximum compactness in time, for any given (stable) set of poles and zeros with the exact same frequency magnitude response.  Thus the relationship between "minimum" and "phase" for this particular arrangement of poles and zeros.
Also see my old word picture with strange crank handles in the ancient usenet comp.dsp archives:


Question:
Which is the best introductory textbook for Bayesian statistics?
One book per answer, please.

John Kruschke released a book in mid 2011 called Doing Bayesian Data Analysis: A Tutorial with R and BUGS. (A second edition was released in Nov 2014: Doing Bayesian Data Analysis, Second Edition: A Tutorial with R, JAGS, and Stan.) It is truly introductory. If you want to walk from frequentist stats into Bayes though, especially with multilevel modelling, I recommend Gelman and Hill.
John Kruschke also has a website for the book that has all the examples in the book in BUGS and JAGS. His blog on Bayesian statistics also links in with the book.


Question:
I have a project where I would like to image an object and be able to derive the heights of features in this image to sub-millimetre precision (exactly how precise is still yet to be determined, but let's say 100ths of a millimetre for now).
I have been previously advised that direct laser ranging techniques will not be appropriate

the travel time will be too small and thus will require too much precision to make precise calculations
minor vibrations (such as a person walking near the apparatus) will perturb the results

I have observed a laser device that sells for approximately $1000 that can achieve the precision but suffers from the vibration problem (which is fine, mechanically isolating the apparatus is another discussion).
I would prefer to achieve a result that is more cost effective, and considered stereo vision as an alternative.  Being a novice to this field I am uncertain if the desired precision can be achieved.
Is the desired precision (at least) theoretically attainable?
Is there a recommended paper or resource that would help explain this topic further?
Additional notes
The objects in question will range from approximately 1/2" square up to about 2 1/2" square with some times very low thickness (1/16"?). A large percentage of the surface should be flat, though one test will be to confirm that assertion. Features will be fairly rough (generally sharp transitions). Aug 17 at 11:00
One of the "harder" interesting objects would be about 20mm square, 1.25mm high. The surface features in question would be on the order of .1 - .3mm I'm estimating. The camera position would likely be on the order of 6" above. Does this give you better insight? Aug 17 at 15:15
I am not looking to perform a single profile/relief measurement, but rather attempting to generate a surface height map of the object.  The surface features of the object, as well as the overall profile, are of significant interest.

Stereo imaging
Given the large field of view you need in relation to the accuracy you want, and how close you want to be, I think that stereo imaging may be a challenging, so you need to somehow amplify the differences you are trying to measure.
Structured lighting
If you are essentially trying to measure the profile of an object, have you considered a single high resolution camera and structured lighting?

Thanks to looptechnology for this image, used without permission, but hopefully attribution will be enough.
Note, the shallower the grazing angle, the the greater accuracy you can measure, but the lower the supported depth of field would be, so for your application you would need to optimise for your needs or make your system adjustable (one laser angle for 0-500um, another for 500-1500um and so on). In this case though, you would probably have to calibrate each time you changed laser position.
Incidentally, a very cheap way to try this out would be to pick up a pair of Laser Scissors which include a basic line laser LED.
Finally, you can remove the vibration problem by sampling multiple times, rejecting outliers and then averaging. A better solution though would be to mount the whole test apparatus on a block of granite. This worked well for laser micro-machining tools I've worked with in the past, which require micron level position and depth of focus accuracy, even when located in factories.
Some back of the envelope calculations.
Lets assume an incident angle of 10 degree from horizontal, and a camera with a 640x480 resolution and a field of view of 87 x 65mm. If we place the beam so that it is right at the bottom of the portrait frame with no sample, and then place the sample with the beam crossing it, this should give us a maximum height of around 15mm and thus an uncorrected resolution of around 24um for each pixel the line walks up the screen. With this setup, a 0.1mm variation should be visible as a 4 pixel variation in position.
Similarly, if we use an incident angle of 2 degrees from horizontal then this should give us a maximum height of around 3mm (Tan(2deg)*87mm) and thus an uncorrected resolution of around 4.7um per pixel, for a much more noticeable 20 pixel jump. This would probably require a much more accurate line laser however.
Note, if the camera is close enough then the you may need to do a second trig calculation, using the camera height, to determine the the true position of the line relative to the base line.
Also note that if you don't need absolute accuracy, and local repeatability is enough (say you are profiling the flatness of a sample to ensure it is within given tolerances) then just being able to see the relative position of the laser line might be enough.


Question:
I have run Oxford Nanopore Technologies' MinION sequencing on the same DNA sample using three flowcells, each aligned against the same reference genome (E.coli K12 MG1655) using both BWA MEM and GraphMap and stored as BAM files.
How can I quantitatively and efficiently analyse the quality of alignment (percentage identity, insertion rate, deletion rate) of each of these files?

Qualimap will do this for you.

Go to qualimap.bioinfo.cipf.es
Run qualimap (default params are fine) on each BAM file
Open up the HTML output, and you can read off the %identity (they measure the opposite, i.e. mismatch rate, but 100% - mismatch rate is %identity of course), indel rate, etc.

One thing to watch out for (you don't mention it in your question, but just in case) is that you cannot directly compare Q scores - these are a bit of a mess and calculated very differently in each piece of software.
Unsolicited suggestion: you might also try NGM-LR for mapping MinION data. We've found it beats the others for our data (though we map to a distant reference).


Question: In simple terms, how would you explain (perhaps with simple examples) the difference between fixed effect, random effect in mixed effect models?

There are good books on this such as Gelman and Hill. What follows is essentially a summary of their perspective.
First of all, you should not get too caught up in the terminology. In statistics, jargon should never be used as a substitute for a mathematical understanding of the models themselves. That is especially true for random and mixed effects models. "Mixed" just means the model has both fixed and random effects, so let's focus on the difference between fixed and random.
Random versus Fixed Effects
Let's say you have a model with a categorical predictor, which divides your observations into groups according to the category values.* The model coefficients, or "effects", associated to that predictor can be either fixed or random. The most important practical difference between the two is this:
Random effects are estimated with partial pooling, while fixed effects are not.
Partial pooling means that, if you have few data points in a group, the group's effect estimate will be based partially on the more abundant data from other groups. This can be a nice compromise between estimating an effect by completely pooling all groups, which masks group-level variation, and estimating an effect for all groups completely separately, which could give poor estimates for low-sample groups.
Random effects are simply the extension of the partial pooling technique as a general-purpose statistical model. This enables principled application of the idea to a wide variety of situations, including multiple predictors, mixed continuous and categorical variables, and complex correlation structures. (But with great power comes great responsibility: the complexity of modeling and inference is substantially increased, and can give rise to subtle biases that require considerable sophistication to avoid.)
To motivate the random effects model, ask yourself: why would you partial pool? Probably because you think the little subgroups are part of some bigger group with a common mean effect. The subgroup means can deviate a bit from the big group mean, but not by an arbitrary amount. To formalize that idea, we posit that the deviations follow a distribution, typically Gaussian. That's where the "random" in random effects comes in: we're assuming the deviations of subgroups from a parent follow the distribution of a random variable. Once you have this idea in mind, the mixed-effects model equations follow naturally.
Unfortunately, users of mixed effect models often have false preconceptions about what random effects are and how they differ from fixed effects. People hear "random" and think it means something very special about the system being modeled, like fixed effects have to be used when something is "fixed" while random effects have to be used when something is "randomly sampled". But there's nothing particularly random about assuming that model coefficients come from a distribution; it's just a soft constraint, similar to the $\ell_2$ penalty applied to model coefficients in ridge regression. There are many situations when you might or might not want to use random effects, and they don't necessarily have much to do with the distinction between "fixed" and "random" quantities.
Unfortunately, the concept confusion caused by these terms has led to a profusion of conflicting definitions. Of the five definitions at this link, only #4 is completely correct in the general case, but it's also completely uninformative. You have to read entire papers and books (or failing that, this post) to understand what that definition implies in practical work.
Example
Let's look at a case where random effects modeling might be useful. Suppose you want to estimate average US household income by ZIP code. You have a large dataset containing observations of households' incomes and ZIP codes. Some ZIP codes are well represented in the dataset, but others have only a couple households.
For your initial model you would most likely take the mean income in each ZIP. This will work well when you have lots of data for a ZIP, but the estimates for your poorly sampled ZIPs will suffer from high variance. You can mitigate this by using a shrinkage estimator (aka partial pooling), which will push extreme values towards the mean income across all ZIP codes.
But how much shrinkage/pooling should you do for a particular ZIP? Intuitively, it should depend on the following:

How many observations you have in that ZIP
How many observations you have overall
The individual-level mean and variance of household income across all ZIP codes
The group-level variance in mean household income across all ZIP codes

If you model ZIP code as a random effect, the mean income estimate in all ZIP codes will be subjected to a statistically well-founded shrinkage, taking into account all the factors above.
The best part is that random and mixed effects models automatically handle (4), the variability estimation, for all random effects in the model. This is harder than it seems at first glance: you could try the variance of the sample mean for each ZIP, but this will be biased high, because some of the variance between estimates for different ZIPs is just sampling variance. In a random effects model, the inference process accounts for sampling variance and shrinks the variance estimate accordingly.
Having accounted for (1)-(4), a random/mixed effects model is able to determine the appropriate shrinkage for low-sample groups. It can also handle much more complicated models with many different predictors.
Relationship to Hierarchical Bayesian Modeling
If this sounds like hierarchical Bayesian modeling to you, you're right - it is a close relative but not identical. Mixed effects models are hierarchical in that they posit distributions for latent, unobserved parameters, but they are typically not fully Bayesian because the top-level hyperparameters will not be given proper priors. For example, in the above example we would most likely treat the mean income in a given ZIP as a sample from a normal distribution, with unknown mean and sigma to be estimated by the mixed-effects fitting process. However, a (non-Bayesian) mixed effects model will typically not have a prior on the unknown mean and sigma, so it's not fully Bayesian. That said, with a decent-sized data set, the standard mixed effects model and the fully Bayesian variant will often give very similar results.
*While many treatments of this topic focus on a narrow definition of "group", the concept is in fact very flexible: it is just a set of observations that share a common property. A group could be composed of multiple observations of a single person, or multiple people in a school, or multiple schools in a district, or multiple varieties of a single kind of fruit, or multiple kinds of vegetable from the same harvest, or multiple harvests of the same kind of vegetable, etc. Any categorical variable can be used as a grouping variable.


Question:
How do CUDA and OpenCL compare to each other as of late 2013 from a programmer's perspective?  My group is thinking about trying to make use of GPU computing.  Would we be limiting ourself significantly by choosing hardware that only supports OpenCL but not CUDA?
To be a bit more specific, are the following assumptions correct?

Everything that's possible in CUDA is also possible in OpenCL
For as long as we're not using libraries, a given task is not significantly easier (or more difficult) to do in either of them
CUDA's main advantage is the availability of libraries
Both have good support for all three main platforms (Win/OSX/Linux)

I'll try to summarize my experiences obtained in the course of developing ViennaCL, where we have CUDA and OpenCL backends with mostly 1:1 translations of a lot of compute kernels. From your question I'll also assume that we are mostly taking about GPUs here.
Performance Portability. First of all, there is no such thing as performance-portable kernels in the sense that you write a kernel once and it will run efficiently on every hardware. Not in OpenCL, where it is more apparent due to the broader range of hardware supported, but also not in CUDA. In CUDA it is less apparent because of the smaller range of hardware supported, but even here we have to distinguish at least three hardware architectures (pre-Fermi, Fermi, Kepler) already. These performance fluctuations can easily result in a 20 percent performance variation depending on how you orchestrate threads and which work group sizes you choose, even if the kernel is as simple as a buffer copy. It's probably also worth mentioning that on pre-Fermi and Fermi GPUs it was possible to write fast matrix-matrix multiplication kernels directly in CUDA, while for the latest Kepler GPUs it seems that one has to go down to the PTX pseudo-assembly language in order to get close to CUBLAS' performance. Thus, even a vendor-controlled language such as CUDA appears to have issues to keep the pace with hardware developments. Moreover, all CUDA code gets compiled statically when you run nvcc, which somewhat requires a balancing act via the -arch flag, while OpenCL kernels get compiled at run-time from the just-in-time compiler, so you can in principle tailor kernels down to the very specifics of a particular compute device. The latter is, however, quite involved and usually only becomes a very attractive option as your code matures and as your experience accumulates. The price to pay is the O(1) time required for just-in-time compilation, which can be an issue in certain situations. OpenCL 2.0 has some great improvements to address this.
Debugging and Profiling. The CUDA debugging and profiling tools are the best available for GPGPU. AMD's tools are not bad either, but they do not include gems like cuda-gdb or cuda-memcheck. Also, still today NVIDIA provides the most robust drivers and SDKs for GPGPU, system freezes due to buggy kernels are really the exception, not the rule, both with OpenCL and CUDA. For reasons I probably do not need to explain here, NVIDIA no longer offers debugging and profiling for OpenCL with CUDA 5.0 and above.
Accessibility and Convenience. It is a lot easier to get the first CUDA codes up and running, particularly since CUDA code integrates rather nicely with host code. (I'll discuss the price to pay later.) There are plenty of tutorials out there on the web as well as optimization guides and some libraries. With OpenCL you have to go through quite a bit of initialization code and write your kernels in strings, so you only find compilation errors during execution when feeding the sources to the jit-compiler. Thus, it takes longer to go through one code/compile/debug cycle with OpenCL, so your productivity is usually lower during this initial development stage.
Software Library Aspects. While the previous items were in favor of CUDA, the integration into other software is a big plus for OpenCL. You can use OpenCL by just linking with the shared OpenCL library and that's it, while with CUDA you are required to have the whole CUDA toolchain available. Even worse, you need to use the correct host compilers for nvcc to work. If you ever tried to use e.g. CUDA 4.2 with GCC 4.6 or newer, you'll have a hard time getting things to work. Generally, if you happen to have any compiler in use which is newer than the CUDA SDK, troubles are likely to occur. Integration into build systems like CMake is another source of headache (you can also find ample of evidence on e.g. the PETSc mailinglists). This may not be an issue on your own machine where you have full control, but as soon as you distribute your code you will run into situations where users are somewhat restricted in their software stack. In other words, with CUDA you are no longer free to choose your favourite host compiler, but NVIDIA dictates which compilers you are allowed to use.
Other Aspects. CUDA is a little closer to hardware (e.g. warps), but my experience with linear algebra is that you rarely get a significant benefit from it. There are a few more software libraries out there for CUDA, but more and more libraries use multiple compute backends. ViennaCL, VexCL, or Paralution all support OpenCL and CUDA backends in the meanwhile, a similar trend can be seen with libraries in other areas.
GPGPU is not a Silver Bullet. GPGPU has been shown to provide good performance for structured operations and compute-limited tasks. However, for algorithms with a non-negligible share of sequential processing, GPGPU cannot magically overcome Amdahl's Law. In such situations you are better off using a good CPU implementation of the best algorithm available rather than trying to throw a parallel, but less suitable algorithm at your problem. Also, PCI-Express is a serious bottleneck, so you need to check in advance whether the savings from GPUs can compensate the overhead of moving data back and forth.
My Recommendation. Please consider CUDA and OpenCL rather than CUDA or OpenCL. There is no need to unnecessarily restrict yourself to one platform, but instead take the best out of both worlds. What works well for me is to set up an initial implementation in CUDA, debug it, profile it, and then port it over to OpenCL by simple string substitutions.( You may even parametrize your OpenCL kernel string generation routines such that you have some flexibility in tuning to the target hardware.) This porting effort will usually consume less than 10 percent of your time, but gives you the ability to run on other hardware as well. You may be surprised about how well non-NVIDIA hardware can perform in certain situations. Most of all, consider the reuse of functionality in libraries to the largest extent possible. While a quick&dirty reimplementation of some functionality often works acceptable for single-threaded execution on a CPU, it will often give you poor performance on massively parallel hardware. Ideally you can even offload everything to libraries and don't ever have to care about whether they use CUDA, OpenCL, or both internally. Personally I would never dare to write vendor-locked code for something I want to rely on in several years from now, but this ideological aspect is should go into a separate discussion.


Question:
Many times have I heard that anti-vaccine people are dangerous even to the vaccinated population. Is that true? If so, how can it be? People say that germs will attack them, and soon they would eventually grow and spread even toward general population which actually got its vaccines.
I mean it's so counter-intuitive: if I'm vaccinated even when disease will spread I shouldn't be in danger.

Biology is rarely black or white, all or nothing. Protective immunity is generally not an on/off switch, where from the moment you're vaccinated you're infinitely resistant for the rest of your life. You shouldn't expect that, having received a smallpox vaccine, you could have billions of smallpox viruses squirted directly into your lungs and shrug it off without noticing.
Given that (fairly obvious) fact, you should immediately think of scenarios where vaccinated people are still at risk of disease following exposure to unvaccinated people. What about older people who were vaccinated 20 years ago, 50 years ago? What about people whose immune systems are slightly weakened through lack of sleep or obesity or stress? Any of these vaccinated people might well be protected against a brief encounter, but not against, say, being in an airplane seat for 18 hours beside an infected child shedding huge amounts of virus, or caring for their sick child.
It's all sliders, not switches. You can have a slight loss of immunity (4 hours sleep last night) and be protected against everything except a large exposure (your baby got infected and won't rest unless you hold him for 8 hours). You can have a moderate loss of immunity (you were vaccinated twenty years ago) and be protected against most exposures, but you're sitting next to someone on the subway for an hour. You may have a significant loss of immunity (you're a frail 80-year-old) and still be protected against a moderate exposure, but your grandchild is visiting for a week.


Question:
I've read that the oxygen atom in water is $\mathrm{sp^2}$ hybridized, such that one of the oxygen lone pairs should be in an $\mathrm{sp^2}$ orbital and the other should be in a pure p atomic orbital.
First, am I correct about the lone pairs being non-equivalent?
Second, if so, does this have any significance in actual physical systems (i.e. is it a measurable phenomenon), and what is the approximate energy difference between the pairs of electrons?
Lastly, if it turns out the lone pairs are actually inequivalent, can this be reconciled with the traditional explanation (due to VSEPR theory) that oxygen is $\mathrm{sp^3}$ and the lone pairs are equivalent?

Water, as simple as it might appear, has quite a few extraordinary things to offer. Most does not seem to be as it appears.
Before diving deeper, a few cautionary words about hybridisation. Hybridisation is an often misconceived concept. It only is a mathematical interpretation, which explains a certain bonding situation (in an intuitive fashion). In a molecule the equilibrium geometry will result from various factors, such as steric and electronic interactions, and furthermore interactions with the surroundings like a solvent or external field. The geometric arrangement will not be formed because a molecule is hybridised in a certain way, it is the other way around, i.e. a result of the geometry or more precise and interpretation of the wave function for the given molecular arrangement.
In molecular orbital theory linear combinations of all available (atomic) orbitals will form molecular orbitals (MO). These are spread over the whole molecule, or delocalised, and in a quantum chemical interpretation they are called canonical orbitals. Such a solution (approximation) of the wave function can be unitary transformed form localised molecular orbitals (LMO). The solution (the energy) does not change due to this transformation. These can then be used to interpret a bonding situation in a simpler theory.
Each LMO can be expressed as a linear combination of the atomic orbitals, hence it is possible to determine the coefficients of the atomic orbitals and describe these also as hybrid orbitals. It is absolutely wrong to assume that there are only three types of spx hybrid orbitals.
Therefore it is very well possible, that there are multiple different types of orbitals involved in bonding for a certain atom. For more on this, read about Bent's rule on the network.[1]
Let's look at water, Wikipedia is so kind to provide us with a schematic drawing:

The bonding angle is quite close to the ideal tetrahedral angle, so one would assume, that the involved orbitals are sp3 hybridised. There is also a connection between bond angle and hybridisation, called Coulson's theorem, which lets you approximate hybridisation.[2] In this case the orbitals involved in the bonds would be sp4 hybridised. (Close enough.)
Let us also consider the symmetry of the molecule. The point group of water is C2v. Because there are mirror planes, in the canonical bonding picture π-type orbitals[3] are necessary. We have an orbital with appropriate symmetry, which is the p-orbital sticking out of the bonding plane. This interpretation is not only valid it is one that comes as the solution of the Schrödinger equation.[4] That leaves for the other orbital a hybridisation of sp(2/3).
If we make the reasonable assumption, that the oxygen hydrogen bonds are sp3 hybridised, and the out-of-plane lone pair is a p orbital, then the maths is a bit easier and the in-plane lone pair is sp hybridised.[5]
A calculation on the MO6/def2-QZVPP level of theory gives us the following canonical molecular orbitals:

(Orbital symmetries: $2\mathrm{A}_1$, $1\mathrm{B}_2$, $3\mathrm{A}_1$, $1\mathrm{B}_1$)[6,7]
Since the interpretation with hybrid orbitals is equivalent, I used the natural bond orbital theory to interpret the results. This method transforms the canonical orbitals into localised orbitals for easier interpretation.

Here is an excerpt of the output (core orbital and polarisation functions omitted) giving us the calculated hybridisations:

     (Occupancy)   Bond orbital / Coefficients / Hybrids
 ------------------ Lewis ------------------------------------------------------
   2. (1.99797) LP ( 1) O  1            s( 53.05%)p 0.88( 46.76%)d 0.00(  0.19%)
   3. (1.99770) LP ( 2) O  1            s(  0.00%)p 1.00( 99.69%)d 0.00(  0.28%)
   4. (1.99953) BD ( 1) O  1- H  2
               ( 73.49%)   0.8573* O  1 s( 23.41%)p 3.26( 76.25%)d 0.01(  0.31%)
               ( 26.51%)   0.5149* H  2 s( 99.65%)p 0.00(  0.32%)d 0.00(  0.02%)
   5. (1.99955) BD ( 1) O  1- H  3
               ( 73.48%)   0.8572* O  1 s( 23.41%)p 3.26( 76.27%)d 0.01(  0.30%)
               ( 26.52%)   0.5150* H  3 s( 99.65%)p 0.00(  0.32%)d 0.00(  0.02%)
 -------------------------------------------------------------------------------

As we can see, that pretty much matches the assumption of sp3 oxygen hydrogen bonds, a p lone pair, and a sp lone pair.
Does that mean that the lone pairs are non-equivalent?
Well, that is at least one interpretation. And we only deduced all that from a gas phase point of view. When we go towards condensed phase, things will certainly change. Hydrogen bonds will break the symmetry, dynamics will play an important role and in the end, both will probably behave quite similarly or even identical.
Now let's get to the juicy part:

Second, if so, does this have any significance in actual physical systems (i.e. is it a measurable phenomenon), and what is the approximate energy difference between the pairs of electrons?

Well the first part is a bit tricky to answer, because that is dependent on a lot more conditions. But the part in parentheses is easy. It is measurable with photoelectron spectroscopy. There is a nice orbital scheme correlated to the orbital ionisation potential on the homepage of Michael K. Denk for water.[8] Unfortunately I cannot find license information, or a reference to reproduce, hence I am hesitant to post it here.
However, I found a nice little publication on the photoelectron spectroscopy of water in the bonding region.[9] I'll quote some relevant data from the article.

$\ce{H2O}$ is a non-linear, triatomic molecule consisting of an oxygen atom  covalently bonded to two hydrogen atoms. The ground state of the $\ce{H2O}$ molecule is classified as belonging to the $C_\mathrm{2v}$ point group and so the electronic states of water are described using the irreducible representations $\mathrm{A}_1$, $\mathrm{A}_2$, $\mathrm{B}_1$, $\mathrm{B}_2$. The electronic configuration of the ground state of the $\ce{H2O}$ molecule is described by five doubly occupied molecular orbitals:
  $$\begin{align}
\underbrace{(1\mathrm{a}_1)^2}_{\text{core}}&&
\underbrace{(2\mathrm{a}_1)^2}_{\text{inner-valence orbital}}&&
\underbrace{
  (1\mathrm{b}_2)^2 (3\mathrm{a}_1)^2 (1\mathrm{b}_1)^2
       }_{\text{outer-valence orbital}}&&
\mathrm{X~^1A_1}
\end{align}$$
[..]
In addition to the three band systems observed in HeI PES of $\ce{H2O}$, a fourth band system in the TPE spectrum close to 32 eV is also observed. As indicated in Fig. 1, these band systems correspond to the removal of a valence electron from each of the molecular orbitals $(1\mathrm{b}_1)^{-1}$, $(3\mathrm{a}_1)^{-1}$, $(1\mathrm{b}_2)^{-1}$ and $(2\mathrm{a}_1)^{-1}$ of $\ce{H2O}$.

As you can see, it fits quite nicely with the calculated data. From the image I would say that the difference between $(1\mathrm{b}_1)^{-1}$ and $(3\mathrm{a}_1)^{-1}$ is about 1-2 eV.
TL;DR
As you see your hunch paid off quite well. Photoelectron spectroscopy of water in the gas phase confirms that the lone pairs are non-equivalent. Conclusions for condensed phases might be different, but that is a story for another day.

Notes and References

What is Bent's rule?
Utility of Bent's Rule - What can Bent's rule explain that other qualitative considerations cannot?

Formal theory of Bent's rule, derivation of Coulson's theorem (Wikipedia).
Worked example for cyclo propane by ron.

A π orbital has one nodal plane collinear with the bonding axis, it is asymmetric with respect to this plane. A bit more explanation in my question What would follow in the series sigma, pi and delta bonds?
With in the approximation that molecular orbitals are a linear combination of atomic orbitals (MO = LCAO).
The terminology we use for hybridisation actually is just an abbreviation:
$$\mathrm{sp}^{x} = \mathrm{s}^{\frac{1}{x+1}}\mathrm{p}^{\frac{x}{x+1}}$$
In theory $x$ can have any value; since it is just a unitary transformation the representation does not change, hence
\begin{align}
 1\times\mathrm{s}, 3\times\mathrm{p}
   &\leadsto 4\times\mathrm{sp}^3 \\
   &\leadsto 3\times\mathrm{sp}^2, 1\times\mathrm{p} \\
   &\leadsto 2\times\mathrm{sp}, 2\times\mathrm{p} \\
   &\leadsto 2\times\mathrm{sp}^3, 1\times\mathrm{sp}, 1\times\mathrm{p} \\
   &\leadsto \text{etc. pp.}\\
   &\leadsto 2\times\mathrm{sp}^4, 1\times\mathrm{p}, 1\times\mathrm{sp}^{(2/3)}
\end{align}
There are virtually infinite possibilities of combination.
This and the next footnote address a couple of points that were raised in a comment by DavePhD. While I already extensively answered that there, I want to include a few more clarifying points here. (If I do it right, the comments become obsolete.)

What is the reason for concluding 2 lone pairs versus 1 or 3? For example Mulliken has in table V the b1 orbital being a definite lone pair (no H population) but the two a1 orbitals both have about 0.3e population on H. Would it be wrong to say only one of the PES energy levels corresponds to a lone pair, and the other 3 has some significant population on hydrogen? Are Mulliken's calculations still valid? – DavePhD

The article Dave refers to is R. S. Mulliken, J. Chem. Phys. 1955, 23, 1833., which introduces Mulliken population analysis. In this paper Mulliken analyses wave functions on the SCF-LCAO-MO level of theory. This is essentially Hartree Fock with a minimal basis set. (I will address this in the next footnote.) We have to understand that this was state-of-the-art computational chemistry back then. What we take for granted nowadays, calculating the same thing in a few seconds, was revolutionary back then. Today we have a lot fancier methods. I used density functional theory with a very large basis set. The main difference between these approaches is that the level I use recovers a lot more of electron correlation than the method of Mulliken. However, if you look closely at the results it is quite impressive how well these early approximations perform.
On the M06/def2-QZVPP level of theory the geometry of the molecule is optimised to have an oxygen hydrogen distance of 95.61 pm and a bond angle of 105.003°. This is quite close to the experimental results.
The contribution to the orbitals are given as follows. I include the orbital energies (OE), too. The contributions of the atomic orbitals are given to 1.00 being the total for each molecular orbital. Because the basis set has polarisation functions the missing parts are attributed to this. The threshold for printing is 3%. (I also rearranged the Gaussian Output for better readability.)

Atomic contributions to molecular orbitals:
2:  2A1  OE=-1.039   is   O1-s=0.81 O1-p=0.03   H2-s=0.07   H3-s=0.07
3:  1B2  OE=-0.547   is   O1-p=0.63             H2-s=0.18   H3-s=0.18
4:  3A1  OE=-0.406   is   O1-s=0.12 O1-p=0.74   H2-s=0.06   H3-s=0.06
5:  1B1  OE=-0.332   is   O1-p=0.95

We can see that there is indeed some contribution by the hydrogens to the in-plane lone pair of oxygen. On the other hand we see that there is only one orbital where there is a large contribution by hydrogen. One could here easily come up with the theory of one or three lone pairs of oxygen, depending on your own point of view. Mulliken's analysis is based on the canonical orbitals, which are delocalised, so we will never have a pure lone pair orbital. When we refer to orbitals as being of a certain type, then we imply that this is the largest contribution. Often we also use visual aides like pictures of these orbitals to decide if they are of bonding or anti-bonding nature, or if their contribution is on the bonding axis.
All these analyses are highly biased by your point of view. There is no right or wrong when it comes to separation schemes. There is no hard evidence for any of these obtainable. These are mathematical interpretations that do in the best case help us understand bonding better. Thus deciding whether water has one, two or three (or even four) lone pairs is somewhat playing with numbers until something seems to fit. Bonding is too difficult to transform it in easy pictures. (That's why I am not an advocate for cautiously using Lewis structures.)
The NBO analysis is another separation scheme. One that aims to transform the obtained canonical orbitals into a Lewis like picture for a better understanding. This transformation does not change the wave function and in this way is as equally a representation as other approaches. What you loose by this approach are the orbital energies, since you break the symmetry of the wave function, but this is going much too far to explain. In a nutshell, the localisation scheme aims to transform the delocalised orbitals into orbitals that correspond to bonds.
From a quite general point of view, Mulliken's calculations (he actually only interpreted the results of others) and conclusion hold up to a certain point. Nowadays we know that his population analysis has severe problems, but within the minimal basis they still produce justifiable results. The popularity of this method comes mainly because it is very easy to perform. See also: Which one, Mulliken charge distribution and NBO, is more reliable?
Mulliken used a SCF-LCAO-MO calculation by Ellison and Shull and was so kind to include the main results into his paper. The oxygen hydrogen bond distance is 95.8 pm and the bond angle is 105°. I performed a calculation on the same geometry on the HF/STO-3G level of theory for comparison. It obviously does not match perfectly, but well enough for a little bit of further discussion.

NO  SYM    HF/STO-3G : N(O)     N(H2)      |      Mulliken : N(O)     N(H2)
1   1A1    -550.79     2.0014   -0.0014    |      -557.3     2.0007   -0.0005
2   2A1     -34.49     1.6113    0.3887    |       -36.2     1.688     0.309
3   1B2     -16.82     1.0700    0.9300    |       -18.6     0.918     1.080
4   3A1     -12.29     1.6837    0.3163    |       -13.2     1.743     0.257
5   1B1     -10.63     2.0000    0.0000    |       -11.8     2.000

As an off-side note: I completely was unable to read the Mulliken analysis by Gaussian. I used MultiWFN instead. It is also not an equivalent approach because they expressed the hydrogen atoms with group orbitals.
The results don't differ by much. The basic approach of Mulliken is to split the overlap population to the orbitals symmetric between the elements. That is a principal problem of the method as the contributions to that MO can be quite different. Resulting problematic points are occupation values larger than two or smaller than zero, which have clearly no physical meaning. The analysis is especially ruined for diffuse functions.
At the time Mulliken certainly did not know about anything we are able to do today, and under which conditions his approach will break down, it still is funny to read such sentences today.

Actually, very small negative values occasionally occur [...]. [...] ideally to the population of the AO [...] should never exceed the number 2.00 of electrons in a closed atomic sub-shell. Actually, [the orbital population] in some instances does very slightly exceed 2.00 [...]. The reason why these slight but only slight imperfections exist is obscure. But since they are only slight, it appears that the gross atomic populations calculated using Eq. (6') may be taken as representing rather accurately the "true" populations in various AOs for an atom in a molecule. It should be realized, of course, that fundamentally there is no such thing as an atom in a molecule except in an approximate sense.

For much more on this I found an explanation of the Gaussian output along with the reference to F. Martin, H. Zipse, J. Comp. Chem. 2005, 26, 97 - 105, available as a copy. I have not read it though.
Scroll down until the bottom of the page for the image, read for more information: CHEM 2070, Michael K. Denk: UV-Vis & PES. (University of Guelph) If dead: Wayback Machine
S.Y. Truong, A.J. Yencha, A.M. Juarez, S.J. Cavanagh, P. Bolognesi, G.C. King, Chemical Physics 2009, 355 (2–3), 183-193. Or try this mirror.


Question:
I'm a children's book writer and illustrator, and I want to to create a book for young readers that exposes the beauty of mathematics. I recently read Paul Lockhart's essay "The Mathematician's Lament," and found that I, too, lament the uninspiring quality of my elementary math education.
I want to make a book that discredits the notion that math is merely a series of calculations, and inspires a sense of awe and genuine curiosity in young readers.
However, I myself am mathematically unsophisticated.

What was the first bit of mathematics that made you realize that math is beautiful?

For the purposes of this children's book, accessible answers would be appreciated.

This wasn't the first, but it's definitely awesome:

This is a proof of the Pythagorean theorem, and it uses no words!


Question:
I am having some trouble understanding how salt water, a simple solution, could so effectively remove the pains of a sore throat.
I do believe that the answer is closely related to hypo/hyper-tonic solutions, but why is this so, and how does this work?

Salt water may have anti-septic properties due to the effect it has on water potential.  Pure water has a water potential (Ψ) of zero.  A concentrated salt solution has a lower (more-negative) water potential.  The water potential of the salt solution is likely to be more negative than that of the pathogen's cytoplasm; the salt solution is therefore referred to as hypertonic.  Therefore water osmoses out of the cell (osmosis being the net movement of water from a higher water potential to a lower water potential across a semi-permeable membrane).  The loss of water from the pathogenic cells causes osmotic crenation - the cell becomes shrivelled and dies.
A hypotonic solution (for example cells placed into pure water) would cause the opposite effect - osmotic lysis.  This is the bursting of the cell due to the movement of water into the cell.  The bacterial cell wall would first have to be damaged (e.g. by penicillin).  This would not be the process by which a salt solution has effect, however.
The fact that the salt water is warm in order to improve solubility may also have the side-effect of causing vasodilation around the infection, increasing the rate at which white blood cells can arrive at the infection site.
It has been more difficult to find a theory as to why a salt solution would have analgesic properties, see the comments below & previous versions of this answer.


Question: I'm interested in examples of very effective methods in scientific computing that are the sum or naive combination of very ineffective or bad ones.

In W. Kahan, "Interval arithmetic options in the proposed IEEE floating point arithmetic standard". In: Karl L. E. Nickel (ed.), Interval Mathematics 1980, New York: Academic Press 1980, pp. 99-128, the author addresses some common fallacies with regard to floating-point computation, which he calls anti-theorems. One of these is the notion that if some intermediate results suffer from significant error compared to the corresponding mathematical results, then any final result strongly dependent on these must be wrong as well. He provides the following counterexample:
Assume we wish to compute $f(x) = (\exp(x) - 1) / x$. A novice might compute f (x) := if x = 0 then 1 else (exp (x) - 1) / x. Somebody who has taken an introductory course in numerics would realize immediately that this suffers from subtractive cancellation near zero. Kahan then proposes to fix this as follows: x := exp (x); if x ≠ 1 then x := (x - 1) / ln (x); f(x) := x (one can tell that Kahan comes from an era when both register and memory space were at a premium).
Most people's gut reaction upon seeing this for the first time is that this supposed fix is preposterous, as it compounds a bad idea with an even worse idea. Yet it works like a charm for $x$ near $0$. An example using IEEE-754 binary32 format (single precision), using $x = 3 \cdot 2^{-24} \approx$ $1.78813934 \cdot 10^{-7}.$ exp(x) - 1 evaluates to $2^{-22} \approx 2.38418579 \cdot 10^{-7}$ because of catastrophic cancellation. log (exp (x)) evaluates to $2.38418551 \cdot 10^{-7}$. (exp (x) - 1) / (log (exp (x)) thus produces a final result of $1.00000012$, which is basically accurate to single precision. The naive computation (exp(x) - 1) / x would instead produce a result of $1.33333337$.
Kahan simply explains that the trick consists in the cancellation of errors. But it took deep insight to come up with this solution. It is therefore not surprising that William Kahan subsequently became the “father of IEEE floating-point arithmetic”. A detailed numerical analysis of this algorithm is provided by Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms, Second Edition, SIAM 2002, section 1.14.1 on pp. 19-21.
The practical relevance of Kahan's counterexample is that it extends trivially to the accurate computation of $\exp(x)-1$ in the form of a function expm1(), which is frequently needed in finite-precision floating-point computation to avoid cases of subtractive cancellation. See example C code at the end. In the 1980s exp() and log() implementations were not necessarily faithfully rounded, but they were usually among the most accurate, well-tested, and fastest elementary math functions provided by computer math libraries, making expm1() implementations based on Kahan's algorithm sufficiently robust (compared to computing expm1 (x) = 2 * sinh (x/2) * exp (x/2), for example).
The ISO-C99 standard added the expm1() function to the standard C math library, and this was subsequently incorporated into the ISO-C++11 standard. A perusal of the Fortran 2008 standard shows that this function is not provided. There is a similar trick for the accurate computation of $\ln(1+x)$, usually called log1p(), from log(). It first appeared in Hewlett-Packard HP-15C Advanced Functions Handbook, Hewlett-Packard 1982, Appendix: Accuracy of Numerical Calculations, p. 193. Style and contents of this appendix strongly suggest that Kahan provided it.
/*
  The following is based on: W. Kahan, "Interval arithmetic options in the
  proposed IEEE floating point arithmetic standard". In: Karl L. E. Nickel
  (ed.), "Interval Mathematics 1980", New York: Academic Press 1980, pp.
  99-128. See pages 110-111. For a detailed explanation see Nicholas J.
  Higham, "Accuracy and Stability of Numerical Algorithms, Second Edition",
  SIAM 2002. In section 1.14.1 on pages 19-21.
*/
double my_expm1 (double x)
{
    double u, m;

    u = exp (x);
    m = u - 1.0;
    if (m == 0.0) {
        // x very close to zero
        m = x;
    } else if (fabs (x) < 1.0) {
        // x somewhat close zero
        u = log (u);
        m = m * x;
        m = m / u;
    }
    return m;
}


Question:
While revisiting some of my old notes about the Miller-Urey experiment, I stumbled across the "equation"...

Electricity + $\ce{CH4~/~ NH3~/~H2O~/~CO}$ = Amino Acids

This got me thinking.
Conventionally, why are molecules like $\ce{CH4}$ and $\ce{NH3}$'s molecular formula written differently (in H placement) than others like $\ce{H2O}$ and $\ce{HF}$? Is there a particular reason, or did it just happen to be?
NOTE: I realize the $\ce{H4C}$ or $\ce{H3N}$ make perfect sense, especially when drawing out molecules. It's just that these are rarely used in literature.

The choice of whether to write binary hydrides with the hydrogen first or second depends on whether that hydrogen is considered acidic, with water marking the delineation point.
By convention, if a binary hydride is more acidic than water, then they are written in the form $\ce{H}_{\text{n}}\ce{X}$. If a binary hydride is less acidic than water, they are written as $\ce{YH}_{\text{n}}$. It so happens that this changeover neatly divides the periodic table. Binary hydrides from groups 16 and 17 (VIA and VIIA) are written with the hydrogen atoms first: $\ce{H2O,~H2S,~H2Se,~H2Te,~HF,~HCl,~HBr,~HI}$.
Binary hydrides from groups 1 (IA) through 15 (VIA) are all written with the hydrogen atoms last, regardless of whether the hydride is ionic $(\ce{LiH,~NaH,~KH,~CaH2})$ or molecular $(\ce{BH3,~CH4,~SiH4,~NH3,~PH3})$.
This notation is in keeping with that for more complex compounds. If the compound is an acid, the acidic hydrogen atoms are put at the from of the formula, while nonacidic hydrogen atoms are placed in the main part of the formula. For example, the hydrogen atoms in phosphoric acid $(\ce{H3PO4})$ are considered acidic and the hydrogen atoms in octane $(\ce{C8H18})$ are not. Acetic acid $(\ce{HC2H3O2})$ has one hydrogen atom that is considered acidic and three that are not, this the formula $\ce{HC2H3O2}$ is considered more helpful than $\ce{C2H4O2}$, although both are "correct" by different sets of rules.


Question:
$\pi$ Pi
Pi is an infinite, nonrepeating $($sic$)$ decimal - meaning that
every possible number combination exists somewhere in pi.  Converted
into ASCII text, somewhere in that infinite string of digits is the
name of every person you will ever love, the date, time and manner
of your death, and the answers to all the great questions of
the universe.

Is this true? Does it make any sense ?

It is not true that an infinite, non-repeating decimal must contain ‘every possible number combination’. The decimal $0.011000111100000111111\dots$ is an easy counterexample. However, if the decimal expansion of $\pi$ contains every possible finite string of digits, which seems quite likely, then the rest of the statement is indeed correct. Of course, in that case it also contains numerical equivalents of every book that will never be written, among other things.


Question:
This has been bugging me for a while now...
Obviously, to calculate the volume/space occupied by a mole of (an ideal) gas, you'll have to specify temperature ($T$) and pressure ($P$), find the gas constant ($R$) value with the right units and plug them all in the ideal gas equation $$PV = nRT.$$
The problem? It seems to be some sort of common "wisdom" all over the Internet, that one mole of gas occupies $22.4$ liters of space. But the standard conditions (STP, NTP, or SATP) mentioned lack consistency over multiple sites/books. Common claims: A mole of gas occupies,

$\pu{22.4 L}$ at STP
$\pu{22.4 L}$ at NTP
$\pu{22.4 L}$ at SATP
$\pu{22.4 L}$ at both STP and NTP

Even Chem.SE is rife with the "fact" that a mole of ideal gas occupies $\pu{22.4 L}$, or some extension thereof.
Being so utterly frustrated with this situation, I decided to calculate the volumes occupied by a mole of ideal gas (based on the ideal gas equation) for each of the three standard conditions; namely: Standard Temperature and Pressure (STP), Normal Temperature and Pressure (NTP) and Standard Ambient Temperature and Pressure (SATP).
Knowing that,

STP: $\pu{0 ^\circ C}$ and $\pu{1 bar}$
NTP: $\pu{20 ^\circ C}$ and $\pu{1 atm}$
SATP: $\pu{25 ^\circ C}$ and $\pu{1 bar}$

And using the equation, $$V = \frac {nRT}{P},$$
where $n = \pu{1 mol}$, by default (since we're talking about one mole of gas).
I'll draw appropriate values of the gas constant $R$ from this Wikipedia table:

The volume occupied by a mole of gas should be:

At STP
\begin{align}
T &= \pu{273.0 K},&
P &= \pu{1 bar},&
R &= \pu{8.3144598 \times 10^-2 L bar K^-1 mol^-1}.
\end{align}
Plugging in all the values, I got
$$V = \pu{22.698475 L},$$
which to a reasonable approximation, gives
$$V = \pu{22.7 L}.$$
At NTP
\begin{align}
T &= \pu{293.0 K},&
P &= \pu{1 atm},&
R &= \pu{8.2057338 \times 10^-2 L atm K^-1 mol^-1}.
\end{align}
Plugging in all the values, I got
$$V = \pu{24.04280003 L},$$
which to a reasonable approximation, gives
$$V = \pu{24 L}.$$
At SATP
\begin{align}
T &= \pu{298.0 K},&
P &= \pu{1 bar},&
R &= \pu{8.3144598 \times 10^-2 L bar K^-1 mol^-1}.
\end{align}
Plugging in all the values, I got
$$V = \pu{24.7770902 L},$$
which to a reasonable approximation, gives
$$V = \pu{24.8 L}.$$

Nowhere does the magical "$\pu{22.4 L}$" figure in the three cases I've analyzed appear. Since I've seen the "one mole occupies $\pu{22.4 L}$ at STP/NTP" dictum so many times, I'm wondering if I've missed something.
My question(s):

Did I screw up with my calculations?
(If I didn't screw up) Why is it that the "one mole occupies $\pu{22.4 L}$" idea is so widespread, in spite of not being close (enough) to the values that I obtained?

The common saying is a hold over from when STP was defined to be $\pu{273.15 K}$ and $\pu{1 atm}$. However, IUPAC changed the definition in 1982 so that $\pu{1 atm}$ became $\pu{1 bar}$. I think the main issue is a lot of educators didn't get the memo and went right along either teaching STP as $\pu{1 atm}$ or continuing with the line they were taught ("$\pu{1  mol}$ of any gas under STP occupies $\pu{22.4 L}$") without realizing it didn't hold under the new conditions.
Just as a "proof" of this working for the old definition.
\begin{align}
V &=\frac{nRT}{P}\\
  &=\frac{\pu{1  mol} \times \pu{8.2057338 \times 10^-2 L * atm//K * mol}
    \times \pu{273.15 K}}{\pu{1 atm}}\\
  &=\pu{22.41396 L}\\
  &\approx \pu{22.4 L}
\end{align}


Question:
Of course, we've all heard the colloquialism "If a bunch of monkeys pound on a typewriter, eventually one of them will write Hamlet."
I have a (not very mathematically intelligent) friend who presented it as if it were a mathematical fact, which got me thinking... Is this really true?  Of course, I've learned that dealing with infinity can be tricky, but my intuition says that time is countably infinite while the number of works the monkeys could produce is uncountably infinite.  Therefore, it isn't necessarily given that the monkeys would write Hamlet.
Could someone who's better at this kind of math than me tell me if this is correct?  Or is there more to it than I'm thinking?

I found online the claim (which we may as well accept for this purpose) that there are $32241$ words in Hamlet.  Figuring $5$ characters and one space per word, this is $193446$ characters.  If the character set is $60$ including capitals and punctuation, a random string of $193446$ characters has a chance of $1$ in $60^{193446}$ (roughly $1$ in $10^{344000}$) of being Hamlet.  While very small, this is greater than zero.  So if you try enough times, and infinity times is certainly enough, you will probably produce Hamlet.  But don't hold your breath.  It doesn't even take an infinite number of monkeys or an infinite number of tries.  Only a product of $10^{344001}$ makes it very likely.  True, this is a very large number, but most numbers are larger.


Question:
I am a mathematics student with a hobby interest in physics. This means that I've taken graduate courses in quantum dynamics and general relativity without the bulk of undergraduate physics courses and sheer volume of education into the physical tools and mindset that the other students who took the course had, like Noether's theorem, Lagrangian and Hamiltonian mechanics, statistical methods, and so on.
The courses themselves went well enough. My mathematical experience more or less made up for a lacking physical understanding. However, I still haven't found an elementary explanation of gauge invariance (if there is such a thing). I am aware of some examples, like how the magnetic potential is unique only up to a (time-)constant gradient. I also came across it in linearised general relativity, where there are several different perturbations to the spacetime metric that give the same observable dynamics.
However, to really understand what's going on, I like to have simpler examples. Unfortunately, I haven't been able to find any. I guess, since "gauge invariance" is such a frightening phrase, no one use that word when writing to a high school student.
So, my (very simple) question is: In many high school physics calculations, you measure or calculate time, distance, potential energy, temperature, and other quantities. These calculations very often depend only on the difference between two values, not the concrete values themselves. You are therefore free to choose a zero to your liking. Is this an example of gauge invariance in the same sense as the graduate examples above? Or are these two different concepts?

The reason that it's so hard to understand what physicists mean when they talk about "gauge freedom" is that there are at least four inequivalent definitions that I've seen used:

Definition 1: A mathematical theory has a gauge freedom if some of the mathematical degrees of freedom are "redundant" in the sense that two different mathematical expressions describe the exact same physical system.  Then the redundant (or "gauge dependent") degrees of freedom are "unphysical" in the sense that no possible experiment could uniquely determine their values, even in principle.  One famous example is the overall phase of a quantum state - it's completely unmeasurable and two vectors in Hilbert space that differ only by an overall phase describe the exact same state.  Another example, as you mentioned, is any kind of potential which must be differentiated to yield a physical quantity - for example, a potential energy function.  (Although some of your other examples, like temperature, are not examples of gauge-dependent quantities, because there is a well-defined physical sense of zero temperature.)
For physical systems that are described by mathematical structures with a gauge freedom, the best way to mathematically define a specific physical configuration is as an equivalence class of gauge-dependent functions which differ only in their gauge degrees of freedom.  For example, in quantum mechanics, a physical state isn't actually described by a single vector in Hilbert space, but rather by an equivalence class of vectors that differ by an overall scalar multiple.  Or more simply, by a line of vectors in Hilbert space.  (If you want to get fancy, the space of physical states is called a "projective Hilbert space," which is the set of lines in Hilbert space, or more precisely a version of the Hilbert space in which vectors are identified if they are proportional to each other.)  I suppose you could also define "physical potential energies" as sets of potential energy functions that differ only by an additive constant, although in practice that's kind of overkill.  These equivalence classes remove the gauge freedom by construction, and so are "gauge invariant."
Sometimes (though not always) there's a simple mathematical operation that removes all the redundant degrees of freedom while preserving all the physical ones.  For example, given a potential energy, one can take the gradient to yield a force field, which is directly measurable.  And in the case of classical E&M, there are certain linear combinations of partial derivatives that reduce the potentials to directly measurable ${\bf E}$ and ${\bf B}$ fields without losing any physical information.  However, in the case of a vector in a quantum Hilbert space, there's no simple derivative operation that removes the phase freedom without losing anything else.
Definition 2: The same as Definition 1, but with the additional requirement that the redundant degrees of freedom be local.  What this means is that there exists some kind of mathematical operation that depends on an arbitrary smooth function $\lambda(x)$ on spacetime that leaves the physical degrees of freedom (i.e. the physically measurable quantities) invariant.  The canonical example of course is that if you take any smooth function $\lambda(x)$, then adding $\partial_\mu \lambda(x)$ to the electromagnetic four-potential $A_\mu(x)$ leaves the physical quantities (the ${\bf E}$ and ${\bf B}$ fields) unchanged.  (In field theory, the requirement that the "physical degrees of freedom" are unchanged is phrased as requiring that the Lagrangian density $\mathcal{L}[\varphi(x)]$ be unchanged, but other formulations are possible.)  This definition is clearly much stricter - the examples given above in Definition 1 don't count under this definition - and most of the time when physicists talk about "gauge freedom" this is the definition they mean.  In this case, instead of having just a few redundant/unphysical degrees of freedom (like the overall constant for your potential energy), you have a continuously infinite number.  (To make matters even more confusing, some people use the phrase "global gauge symmetry" in the sense of Definition 1 to describe things like the global phase freedom of a quantum state, which would clearly be a contradiction in terms in the sense of Definition 2.)
It turns out that in order to deal with this in quantum field theory, you need to substantially change your approach to quantization (technically, you need to "gauge fix your path integral") in order to eliminate all the unphysical degrees of freedom.  When people talk about "gauge invariant" quantities under this definition, in practice they usually mean the directly physically measurable derivatives, like the electromagnetic tensor $F_{\mu \nu}$, that remain unchanged ("invariant") under any gauge transformation.  But technically, there are other gauge-invariant quantities as well, e.g. a uniform quantum superposition of $A_\mu(x) + \partial_\mu \lambda(x)$ over all possible $\lambda(x)$ for some particular $A_\mu(x).$
See Terry Tao's blog post for a great explanation of this second sense of gauge symmetry from a more mathematical perspective.
Definition 3: A Lagrangian is sometimes said to posses a "gauge symmetry" if there exists some operation that depends on an arbitrary continuous function on spacetime that leaves it invariant, even if the degrees of freedom being changed are physically measurable.
Definition 4: For a "lattice gauge theory" defined on local lattice Hamiltonians, there exists an operator supported on each lattice site that commutes with the Hamiltonian.  In some cases, this operator corresponds to a physically measurable quantity.

The cases of Definitions 3 and 4 are a bit conceptually subtle so I won't go into them here - I can address them in a follow-up question if anyone's interested.
Update: I've written follow-up answers regarding whether there's any sense in which the gauge degrees of freedom can be physically measurable in the Hamiltonian case and the Lagrangian case.


Question:
I know plants are green due to chlorophyll.
Surely it would be more beneficial for plants to be red than green as by being green they reflect green light and do not absorb it even though green light has more energy than red light.
Is there no alternative to chlorophyll? Or is it something else?

Surely it would be even more beneficial for plants to be black instead of red or green, from an energy absorption point of view. And Solar cells are indeed pretty dark.
But, as Rory indicated, higher energy photons will only produce heat. This is because the chemical reactions powered by photosynthesis require only a certain amount of energy, and any excessive amount delivered by higher-energy photons cannot be simply used for another reaction1 but will yield heat. I don't know how much trouble that actually causes, but there is another point:
As explained, what determines the efficiency of solar energy conversion is not the energy per photon, but the amount of photons available. So you should take a look at the sunlight spectrum:

The Irradiance is an energy density, however we are interested in photon density, so you have to divide this curve by the energy per photon, which means multiply it by λ/(hc) (that is higher wavelengths need more photons to achieve the same Irradiance). If you compare that curve integrated over the high energy photons (say, λ < 580 nm) to the integration over the the low energy ones, you'll notice that despite the atmospheric losses (the red curve is what is left of the sunlight at sea level) there are a lot more "red" photons than "green" ones, so making leaves red would waste a lot of potentially converted energy2.
Of course, this is still no explanation why leaves are not simply black — absorbing all light is surely even more effective, no? I don't know enough about organic chemistry, but my guess would be that there are no organic substances with such a broad absorption spectrum and adding another kind of pigment might not pay off.3
1) Theoretically that is possible, but it's a highly non-linear process and thus too unlikely to be of real use (in plant medium at least)
2) Since water absorbs red light stronger than green and blue light deep sea plants are indeed better off being red, as Marta Cz-C mentioned.
3  And other alternatives, like the semiconductors used in Solar cells, are rather unlikely to be encountered in plants...
Additional reading, proposed by Dave Jarvis: