What is meant by the term "prior" in machine learning

Question: I am new to machine learning. I have read several papers where they have employed deep learning for various applications and have used the term "prior" in most of the model design cases, say prior in human body pose estimation. Can someone explain what does it actually means. I could only find the mathematical formulation of prior and posterior in the tutorials.
Comment: It's a mathematical concept so, yes, it's formulated mathematically. However, the [Wikipedia page](https://en.wikipedia.org/wiki/Prior_probability) seems to give plenty of intuition. Did you check it? If so, could you say more about what you didn't understand and what you're looking for in an answer?
Comment: [@David Richerby](https://cs.stackexchange.com/users/9550/david-richerby). Thank you for your response. Yes I had checked that [wikipedia page](https://en.wikipedia.org/wiki/Prior_probability) and I could gather a vague idea that its something about knowledge or information about a variable. I had been reading papers on body pose estimation where there were mentions of body pose priors, body kinematic prior, modeling of priors over 3D human pose, learning priors, prior to estimate 3D human pose. I could not clearly figure out what the term "prior" actually means in this context.
Comment: https://jonathanweisberg.org/pdf/VarietiesvF.pdf
Answer: Put simply, and without any mathematical symbols, prior means initial beliefs about an event in terms of probability distribution. You then set up an experiment and get some data, and then "update" your belief (and hence the probability distribution) according to the outcome of the experiment, (the posteriori probability distribution).
Example:
Assume we are given two coins. But we don't know which coin is fake. Coin 1 is unbiased (HEADS and TAILS have 50% probability), and Coin 2 is biased, say, we know it gives HEADS with probability 60%. Mathematically:
Given we have HEADS, the probability that it is Coin 1 is 0.4 $$p(H | Coin_1) = 0.4$$ and probability it is Coin 2 is 0.6 $$p(H| Coin_2) = 0.6$$
So, that is all what we know before we set up an experiment.
Now we are going to pick a coin toss it, and based on the information what we have (H or T) we are going to guess what coin we have chosen (Coin 1 or Coin 2).
Initially we assume $p(Coin_1) = p(Coin_2) = 0.5$ both coins have equal chances, because we have no information yet. This is our prior. It is a uniform distribution.
Now we take randomly one coin, toss it, and have a HEADS. At this moment everything happens. We compute posterior probability/distribution using Bayesian formula:
$$p(Coin_1 | H) = \frac{p(H | Coin_1)p(Coin_1)}{p(H | Coin_1)p(Coin_1) + p(H | Coin_2)p(Coin_2)} = \frac{0.4\times0.5}{0.4\times0.5 + 0.6\times0.5} = 0.4$$
$$p(Coin_2 | H) = \frac{p(H | Coin_2)p(Coin_2)}{p(H | Coin_1)p(Coin_1) + p(H | Coin_2)p(Coin_2)} = \frac{0.6\times0.5}{0.4\times0.5 + 0.6\times0.5} = 0.6$$
So, initially we had $0.5$ probability for each coin, but now after the experiment our beliefs has changed, now we believe that the coin is Coin 1 with probability 0.4 and it is Coin 2 with the probability 0.6. This is our posterior distribution, Bernoulli distribution.
This is the basic principle of Bayesian inference and statistics used in Machine learning.
Comment: You need to fix the example above.
That calculation shows that both coins are biased (First one with prob of Heads 40% and the second one with probability of heads 60%)
In case the first one is biased It is still a Bernoulli distribution but with probabilities
P(Coin1|H) =5/11 and P(Coin2|H)=6/11
Comment: Should *"Given we have HEADS, the probability that it is Coin 1 is 0.4"* be rewritten as *"Given that we have Coin 1, the probability that it is HEADS is 0.4"*?
Comment: The explanation doesn't explain in terms of machine learning.
Comment: I would also like to reiterate, the explanation doesn't explain in terms of machine learning.
Comment: Does it have to be a probability distribution? Can I say "CNNs are good architectural priors for image processing tasks"?
Comment: This answer is incomplete. I know what a prior is from Bayesian statistics but not how the concept applies in a machine learning context (where you may e.g. use a totally deterministic algorithm for training and thus how does "prior" even having meaning?), which I think was the heart of the question and is why I came here and looked at this answer. For myself I don't feel like I'm any closer to understanding than when I started reading this answer.
Comment: @user3023715 I took a stab at an answer; I love to know if it helps and if it could use any corrects / additional info.
Answer: It's roughly any pre-training choices you encode into your model
In machine learning a prior is, according to the book "Deep Learning" by Goodfellow, Bengio, and Courville, a probability distribution over the parameters of your machine learning model. So as I understand it according to this definition your priors determine how you randomly select your initial parameters before you start training. An alternative definition according to this website is more general, basically any configuration of parameters or model choices that you make prior to starting training.
So it looks like the term prior in machine learning is sometimes applied less rigorously than in statistics, though it is either based on, or at least inspired by the corresponding term in the field of statistics.
Answer: In Bayesian statistics, a "prior" represents the beliefs we have before observing some data.  Then, after we observe some data, we update our beliefs; those updated beliefs are called the "posterior".
Statistical machine learning can be viewed through this lens.  The "priors" are the beliefs we hold or we try to enforce/encourage a model to hold even before it is trained with any training data.  The observed data is the training data, and the machine learning model is trained on this data.  After it finishes training, the final model is the posterior.  Here are some examples:
In natural language processing, one "prior" belief we might have is that if two words tend to be used in the same context, there is a decent chance they are related.  For instance, even if you didn't know the meaning of "good" or "delicious", if I told you that "lip-smackingly" was often followed by either the word "good" or the word "delicious", you might suspect that "good" and "delicious" might mean something similar (or are somehow related).  That's a prior belief -- it's something we might believe is true, even before we've seen any data.  Starting from that prior, we might design a word embedding like GloVe, use it to encode sentences before feeding them to a machine learning model, and train the model.  In this way, we have build a model that respects our "priors" (our beliefs before we saw the training data).
In image classification, one "prior" belief we might have is that if it's useful to look for a particular pattern -- e.g., straight lines -- in the upper-right of an image, it's also useful to look for them everywhere in the image.  That's a "prior" because it's an assumption or belief or hypothesis we hold, even before training on any training data.  We might then build a neural network architecture, such as a convolutional neural network, that behaves in a way that is motivated by or is consistent with this "prior".  Then, we can train such a network on training data, to obtain a specific model.  This illustrates how an architecture can embed a prior (in this case, translation-equivarance), either deliberately or inadvertently.  Convolutional neural networks are biased towards performing well on types of images that are consistent with this "prior", and performing poorly on types of images that are inconsistent with this "prior".
In some applications of statistical modeling, one prior is that there are many features but only a few are relevant to the quantity we wish to predict.  Lasso regression was invented to deal with this situation: it is linear regression, but starting from a prior that the coefficients for most features should be zero, and probably only a few features should have a non-zero coefficient.  In contrast, linear regression doesn't start with any assumption or information about what the coefficients are likely to look like.  Lasso regression will perform better than linear regression on tasks where the assumption is appropriate.
In particular, having an informative "prior" can be a good thing.  It can help the model perform better, given a limited amount of training data, because the model starts with some knowledge -- it doesn't start from nothing.


Daily agenda notification in calendar?

Question: I want to receive notification every morning with list of things (daily agenda) for the day in my Macbook. I could not find a way to set that up in Calendar, so is there another option or can I use AppleScript to accomplish this?
Comment: @patrix, yes if it works I am open to the solution but I do not know how to do this in AppleScript.
Comment: Calendar doesn't support this, but it should be possible to script something like that using AppleScript or similar. Are you open for such a solution?
Answer: Maybe not exactly what you are looking for, but have a look at the "Today" view of the macOS Notification Center.

Personally, I use the calendar in iStat Menus.

You find further calendar options in this question.
Answer: It's pretty simple actually. Create a text document and name it daily agenda or whatever. Add your daily agenda items into that new text document.

Open calendar app and create a new event and name it "daily agenda"
or whatever

Then on the right side of the calendar app click where you see the
information and other items of that event

Edit the starts and ends times to what you would like them To be
Then click "repeats" and edit those values
Then click "alerts" and choose custom and select "Open file at time
of event" and select that new text document you created with your
itemized daily agenda items
Add multiple alerts if you would like

Now every time that calendar event runs, it will launch your daily agenda text document and any other alerts you have set up
Comment: hey, but i want the daily agenda to be the events of that specific day as a summary of things that are up ahead that day. I do not think this method makes it possible, does it?
Answer: Export your iCal to Google Mail.  It has a daily agenda feature.
Comment: It's much more helpful if you explain *how* in your answer.  Remember, our audience has a broad range of skill levels.

Daily agenda notification in calendar?


Can Android phones be set to automatically wipe all data after a certain amount of failed logins without an app?

Question: A new policy at my work is being drafted regarding email access on phones. A requirement will be that the phone must automatically have all data erased after a certain amount of failed login attempts. Let's ignore the fact that it's pretty silly to a.) be allowing work email access on personal phones when such stringent expectations are in place, and b.) expect to be able to enforce something like this across a variety of phone platforms. Is it possible to set this up in vanilla Android without any apps?
Comment: Not related to the number of logins, but if you use the default email app with Outlook, and Outlook is configured properly, you need to accept the ability for remote wiping. Presumably then the Outlook administrators can wipe the phone's data remotely. (There are other questions here about how to **prevent** that that might be useful for you.)
Comment: related: https://android.stackexchange.com/questions/69486/lock-screen-security-reboot-after-x-invalid-pins - if you encrypt the phone and reboot after a certain number of failed attempts, you force the attacker to potentially use a different, much stronger passphrase.
Answer: The problem is that wiping data requires to overwrite it. On todays devices with lots of in-device flash memory and large SD-cards this can take a while - up to several hours. This leaves a lot for the attacker to interrupt this process and try again. Therefore wiping triggered by false login attempts is only reasonable if your data is encrypted. Then you wipe the device by simply erase the key from memory that is required to read/write your data.
Since Android Honeycomb (3.0) you have the possibility to encrypt all your data and to erase the device if the wrong password/pin has been entered several times. Therefore what you want to achieve is only possible with android tablets at the moment. For smartphones you have to wait for Android (4.0) Ice Cream Sandwich.
Comment: Right on.  You can quickly make the device unusable without encryption, but you can't quickly make its data unrecoverable without encryption.
Comment: "Since Android Honeycomb (3.0) you have the possibility to encrypt all your data and to erase the device if the wrong password/pin has been entered several times.  For smartphones you have to wait for Android (4.0) Ice Cream Sandwich." --- could you shed some more lights here please? Is it actually available?
Comment: Most Android 4.x devices include encryption support. However this only applies to the internal memory. The encryption is based on your lock scree passwoard which there has to be 8+ chars to be secure. External memory on an SD-card can only be encrypted by certain Samsung devices.
Comment: @Robert: encryption is a good thing, but it's helpess against brute-force. If you've lost your device and it's locked by sim or gesture - then it will take less than a day to brute force **manually**. For 8 chars password you may use some intelligent way of bruteforce - I'm sure there are some. That's what the auto-wiping feature useful for. PS: not even mention that you'll get bored soon to enter 8 char password each time you unlock your phone
Answer: Apparently, this might not be a built-in security option in the OS itself, but Exchange ActiveSync can enforce this requirement.


Is the continuity equation valid for a diffusion current?

Question: On the one hand, we have the diffusion equation:
\begin{align}
\frac{\partial\rho}{\partial t}&=D \nabla^2  \rho
\end{align}
and on the other hand, we have Fick's first law:
\begin{align}
\vec J = - D \nabla \rho \, .
\end{align}
If we apply $\nabla$ to Fick's law:
\begin{align}
\nabla  \vec J = - D \nabla^2 \rho
\end{align}
and insert this into the diffusion equation, we find
\begin{align}
\frac{\partial\rho}{\partial t}&=\nabla  \vec J \, .
\end{align}
If we now assume that the current $\vec J$ can be described in terms of a velocity field $\vec u$:
$$ \vec J \equiv \rho \vec u,$$
this yields exactly the continuity equation:
\begin{align}
\frac{\partial\rho}{\partial t}&=D \nabla (\rho \vec u)  \, .
\end{align}
Is there any error in the steps above? I'm somewhat puzzled by the result because the continuity equation is typically associated with advection and not with diffusion.
Comment: Shouldn't your 3rd equation be applying a divergence, not a gradient?  Then the 4th equation should be a negative on the RHS making it the continuity equation (i.e., time variation of a density plus the divergence of a flux equals zero in the absence of sources or sinks).
Comment: Related: (average velocity in Fokker Planck equation) https://physics.stackexchange.com/q/556859/226902 , https://physics.stackexchange.com/q/559653/226902 , https://physics.stackexchange.com/q/566778/226902
Answer: Yes, indeed, Diffusion equation is essentially a continuity equation. More general Fokker-PLanck type equation (i.e. a diffusion equation with a drift term),
$$\partial_t \rho(\mathbf{r},t) = \nabla \cdot[\mathbf{f}(\mathbf{r})\rho(\mathbf{r},t)] + D\nabla^2\rho(\mathbf{r},t)$$
can be written as a continuity equation
$$\partial_t \rho(\mathbf{r},t) = -\nabla\mathbf{J}(\mathbf{r},t),$$
where the current is defined as
$$\mathbf{J}(\mathbf{r},t) = -\mathbf{f}(\mathbf{r})\rho(\mathbf{r},t) - D\nabla\rho(\mathbf{r},t).$$
Thus, converting a diffusion-like equation to a continuity equation is a qquestion of correctly defining the current.


How to remove part of an image in the shape of a font without affecting the background?

Question: I am entirely new to graphic design. I have a background image and a "foreground" image. I want to modify the foreground image by omitting parts of it (so that the background takes its place); in particular I want the omitted parts to be in the form of a font. I don't have Adobe Photoshop, and I am looking for a free way to do this. I would appreciate your suggestions on how to do this.
Answer: You can do this with other raster image editing software, such as GIMP which is free. It can be done by using layers and layer masks. In fact almost any raster image editor which has layer support could be used.
Here's an example below made in GIMP. The idea here was to have the word "Hannibal" reveal an image of the Alps, through an image of an elephant.
The bottom layer is the background layer, and the foreground layer is above that. I turned the text layer into a selection, inverted the selection, then applied it as a layer mask to the foreground layer. The background shows through the mask applied to the foreground.

This could be taken further. In the following example, I also duplicated the a white version of the text layer, stroked it with a 10px stroke, and masked that out using the same mask I made earlier, to create an outline around the text.
Comment: @tesujin, I upvoted yours anyway. It's cool.
Comment: Yours works better than mine - I discovered a colour-clash in my 'S' too late to do much about it ;)
Comment: Thank you. In here I do often feel I'm paddling at the shallow end of this particular pool, as my only 'graphics skill' is a bit of photo manipulation. ;)
Answer: Billy beat me to a good answer, but I thought I'd post examples I'd already finished - once you have your mask you can quickly flip it to show either style…
colour clash below bothered me, so I spent another 4 minutes re-jigging ;))

original version...
Answer: There's no need to clip nor mask holes to the main image. As well you can paste pieces of the other image as new layers over the background. Visually the result is the same.
The result - which image looks like it's in the background depends on the perspectives and sizes. If the main image is for ex. a flat wall or otherwise shallow and the letters are big and there's a recognizable deep scene the letters definitely are the background. (see NOTE1)
You can select good contrast pieces to different places differently if the pieces do not have too much texture details. If the  texture image of the letters is wanted to be recognized as whole the letters must be big and clipped as one piece.
An opinion: Having both in the main image and the letters rich details with high contrast, equal apparent depth and nearly the same size makes the text difficult to read. The letters need outlines if one wants the text content is recognized first.
In the next image the text is clearly in the front because the main image has solid landscape look which fades to the horizon and the text has very little anything that can be seen as depth.
I used only one image, but that doesn't harm showing the idea. The text was written and used only to make selections from the background image and then removed. The selection was moved to a good place, copy was clicked and pasted as a new layer.

A couple of words have shadows to make them readable. Shadow is another copy taken from darker place and moved few pixels apart.
BTW. The text and image present nothing, they are random.
The program is a freebie - it's web service https://www.photopea.com which duplicates a good amount of Photoshop's functionality for RGB images including layers, layer masks, layer styles, adjustment layers and smart objects.
NOTE1: The same landscape seen through a shallow scene. A piece of landscape is pasted on the image of rocks:

As you see the rocks have much contrast like some letters in the text and they seem to have blueish general color cast. One extra trick to make the text more easily readable is to have color difference. The text contains no red. Making the main image a little reddish by adjusting the color balance increases readability:
Comment: Although the first option will work, if you don't cut holes or mask out the image, then you won't be able to scale or move the image underneath. So that's a definite disadvantage.  It's nice to be able to reposition the content.


Are there equivalent calcium imaging molecules that fluoresce in the presence of neurotransmitters between axons?

Question: Molecules like GCaMP fluoresce when calcium ions attach to them. I was wondering if this can work with the other neurotransmitters in the brain or compounds that transmit signals outside of neurons.
Answer: Yes, for example there is the, uhh, creatively named "glue sniffer": GluSnFRs that responds to glutamate by fluorescing, and a couple other varieties as well (also mentioned on that Wikipedia page).
The concept is similar to the calcium-sensitive dyes: couple a motif that binds to the target of interest and causes a conformational change with a motif related to fluorescent proteins like GFP/YFP, such that the binding of the target molecule/ion allows the fluorescent motif to be active.


Difference between harmonic mean of arithmetic means and arithmetic mean of harmonic means

Question: Let $S=\{(x_i, y_i)\}_{i=1...n} \in [0,1]^{2n}$ bet a tuple of ordered pairs, and let $A, H$ denote the arithmetic and harmonic mean. Then
$$
\sup_S (H(\underset{i}{A}(x_i),\underset{i}{A}(y_i)) - \underset{i}{A}(H(x_i, y_i))) =
  \begin{cases}
   0.5,n\text{ is even}\\
      0.5 - \frac{1}{2n^2},\text{else}
     \end{cases}
$$
We found a proof (Opitz and Burst, 2019: Macro F1 and Macro F1) by showing that the difference can be increased by intelligently swapping variables and then setting them to either 0 or 1.
The proof is fairly long, and we are wondering: Is there a simple way to show this bound?
Comment: I have a very simple proof for the even case but the odd case is a bit trickier (although I think the main ideas can be adapted with patience).
Answer: $
\newcommand{\R}{\mathbb{R}}
\newcommand{\la}{\lambda}
\newcommand{\p}{\partial}
\newcommand{\PP}{\mathcal{P}}$
Let $x:=(x_1,\dots,x_n)\in[0,1]^n$, $y:=(y_1,\dots,y_n)\in[0,1]^n$, $h:=(h_1,\dots,h_n)$,
\begin{equation*}
 h_i:=H(x_i,y_i),\quad H(u,v):=\frac2{\frac1u+\frac1v}=\frac{2uv}{u+v}
\end{equation*}
for $u>0$ and $v>0$, and, by continuity, $H(u,v):=0$ for $u\ge0$ and $v\ge0$ with $u v=0$. Let $Az:=\frac1n\sum_1^n z_i$ for $z:=(z_1,\dots,z_n)$. Then the result in question can written as
\begin{equation*}
 L:=L(x,y):=H(Ax,Ay)-Ah\le L^*_n:=
 \left\{
   \begin{alignedat}{2}
   &\frac12&&\text{ if $n$ is even}\\
  & \frac12-\frac1{2n^2}&&\text{ if $n$ is odd},
     \end{alignedat}
     \right. \tag{0}
\end{equation*}
with equality for some $x,y$ in $[0,1]^n$.
The maximum of $L(x,y)$ over all $(x,y)\in[0,1]^n\times[0,1]^n$ is attained. In what follows, let $(x,y)$ be such a maximizer.
With $[n]:=\{1,\dots,n\}$, $p$ and $q$ in $\{0,1\}$, and $|K|:=(\text{cardinality of $K$)}$, let
\begin{gather*}
 I:=\{i\in[n]\colon 0<x_i<1\},\quad J:=\{i\in[n]\colon 0<y_i<1\},\\
 I_p:=\{i\in[n]\colon x_i=p\},\quad J_q:=\{i\in[n]\colon y_i=q\},\\
s_{pq}:=\tfrac1n|I_p\cap J_q|,
\end{gather*}
so that $s_{00}+s_{01}+s_{10}+s_{11}\le1$.
If $Ax=0$, then $x=0$ and hence $h=0$ and $L=0$, which makes the inequality in (0) trivial. So, without loss of generality (wlog), $Ax>0$. Similarly, wlog $Ay>0$. So,
\begin{equation*}
 r:=Ay/Ax\in(0,\infty). \tag{1}
\end{equation*}
Let $\p_u$ denote the partial derivative with respect to a variable $u$.
Then
\begin{equation*}
 \p_u H(u,v)=2\Big(\frac v{u+v}\Big)^2
\end{equation*}
for $u>0$ and $v>0$.
So, for any $i\in I$
\begin{equation*}
 \frac n2\,\p_{x_i}L
 =\Big(\frac r{r+1}\Big)^2-\Big(\frac{y_i}{x_i+y_i}\Big)^2=0,
\end{equation*}
because $(x,y)$ is a maximizer of $L$. So, $y=rx>0$ on $I$. Similarly, $y=rx>0$ on $J$, and hence $y=rx>0$ on $I\cup J$.
So, with $\xi:=\frac1n\,\sum_{i\in I\cup J}x_i$,
\begin{alignat*}{5}
&Ax=&&    &&s_{10}&+&s_{11}&&+\xi, \tag{Ax}\\
&Ay=&&s_{01}&&    &+&s_{11}&&+\xi r, \tag{Ay}\\
&Ah=&&    &&   &&s_{11}&&+\xi\frac{2r}{1+r}.
\end{alignat*}
So,
\begin{align*}
 L&=\frac{2 Ax\,Ay}{Ax+Ay}-Ah \\
 &=Ax\frac{2r}{1+r}-\Big(s_{11}+\xi\frac{2r}{1+r}\Big) \\
 &=(s_{10}+s_{11})\frac{2r}{1+r}-s_{11}. \tag{2}
\end{align*}
It also follows from (Ax) and (Ay) that the equality in (1) can be rewritten as
\begin{equation*}
s_{01}+s_{11}=r(s_{10}+s_{11}).
\end{equation*}
So, if $s_{10}+s_{11}=0$, then $s_{11}=0$ and hence, by (2), $L=0$. So, wlog $s_{10}+s_{11}>0$ and hence
$r=\frac{s_{01}+s_{11}}{s_{10}+s_{11}}$. Using this expression for $r$, we get from (2):
\begin{align*}
 L=M:=\frac{2 s_{01} s_{10} + (s_{01}+ s_{10})s_{11}}{s_{01} + s_{10} + 2 s_{11}}.
\end{align*}
Next,
\begin{equation*}
 \p_{s_{11}}M:=\frac{(s_{01}-s_{10})^2}{(s_{01} + s_{10} + 2 s_{11})^2}\ge0.
\end{equation*}
So, wlog one may replace $s_{11}$ by its largest possible value, $1-s_{01}-s_{10}$:
\begin{equation*}
 L=M\le N:=M|_{s_{11}=1-s_{01}-s_{10}}=
 \frac{(1-s_{01})s_{01}+(1-s_{10})s_{10}}{2-s_{01}- s_{10}}.
\end{equation*}
Further,
\begin{equation*}
 (\p_{s_{01}}+\p_{s_{10}})N=
 \frac{4(1-s_{01})(1-s_{10})}{(2-s_{01}-s_{10})^2}\ge0.
\end{equation*}
So, if we increase $s_{01}$ and $s_{10}$ by the same amount, while keeping $s_{01}+s_{10}\le1$, the value of $N$ may only increase. So,
\begin{equation*}
 L\le N|_{s_{10}=1-s_{01}}=2(1-s_{10})s_{10}
 \le2(1-\tfrac mn)\tfrac mn=L^*_n,
\end{equation*}
where $m:=\lfloor n/2\rfloor$; the latter inequality follows because $(1-u)u$ is decreasing in $|u-1/2|$ for $u\in[0,1]$.
The inequality in (0) turns into the equality if $(x_i,y_i)=(1,0)$ for $i=1,\dots,m$ and $(x_i,y_i)=(0,1)$ for $i=m+1,\dots,n$.
The entire proof is now complete.
Comment: I have added a couple of details to the proof, and also fixed a couple of typos.
Answer: I will give you a short proof for the even case. I think it may be possible to imitate the steps for $n$ odd.
Restating your problem in a math-olympiad fashion, one has to prove that for $0< x_i,y_i\leq 1$, $1\leq i\leq n$, the following holds:
$$ \frac{1}{n} \cdot \frac{2\left(\sum_{i=1}^n x_i\right) \left(\sum_{i=1}^n y_i\right)}{\left(\sum_{i=1}^n x_i\right) + \left(\sum_{i=1}^n y_i\right)} - \frac{2}{n} \sum_{i=1}^n \frac{x_iy_i}{x_i+y_i} \leq \frac{1}{2}$$
Which in turn, using the inequalities between harmonic and arithmetic means in the first summand, means that it is enough to prove:
$$ \frac{1}{2n} \left(\sum_{i=1}^n x_i + \sum_{i=1}^n y_i\right) - \frac{2}{n} \sum_{i=1}^n \frac{x_iy_i}{x_i+y_i} \leq \frac{1}{2}$$
And this is equivalent to this:
$$ \sum_{i=1}^n (x_i + y_i) - 4 \sum_{i=1}^n \frac{x_iy_i}{x_i+y_i} \leq n$$
Which, rewriting is just to prove:
$$ \sum_{i=1}^n \frac{(x_i-y_i)^2}{x_i+y_i} \leq n$$
And it is sufficient to verify that each summand is $\leq 1$, which is pretty simple given that $(x_i-y_i)^2\leq x_i+y_i$, since this is just equivalent to $x_i^2+y_i^2 \leq x_i+y_i + 2x_iy_i$, and the last inequality follows directly from the fact that $x_i^2\leq x_i$ and $y_i^2\leq y_i$, for $x_i,y_i\in [0,1]$.
Interestingly, the case of equality is straightforward to construct, since we only need that $(x_i-y_i)^2= x_i+y_i$ which is easy to see only can happen for $x_i=1$ and $y_i=0$ or viceversa, and that $\sum x_i = \sum y_i$.
Comment: Interesting! It would probably have never occurred to me that simply bounding the harmonic mean (of the arithmetic means) by the corresponding arithmetic mean would work, even for even $n$. However, after that, you are only rewriting the bound on the difference, and I don't see how this could be made work for odd $n$.


Age Rating: female nipples poking through clothing?

Question: Pretty simple and straightforward question, what rating would a game get for something like this?
Comment: Ironically, the question is neither simple nor straightforward. Things like context are considered, e.g., whether the depiction is sexualized or not. There isn't a specific rule like "+1 age points per obvious nipple" or anything like that; it's all subjective and can depend on all kinds of factors outside your control, like the mood of the reviewer and how good your team is at arguing appeals to the review board. If you're worried about ratings, don't ask how to toe the line; just stay the hell away from the line in the first place. :)
Comment: From which rating board in which country? Different cultures have very different ideas regarding which grade of lewdness is appropriate for which age group.
Comment: I guess ESRB and/or Pegi? Those seem to be the most common.
Comment: As far as I know, erect nipples covered by clothing isn't differentiated by sex for rating purposes. But there's almost never any guarantee with the rating review boards: It's very subjective and often depend on the overall context.
Answer: The age rating system for games and movies is not just a max() function where the highest offending item sets the rating.
Some things will automatically give you an Adult-Only rating and some will automatically go to PG or Teen, but there's a vague point system for intermediate ratings.
These rules changes often and some of the items are somewhat subjective and will be slightly influenced by the reviewer and the target market. Australia, America, Europe, China, Korea, and Japan to name a few regions all have different rating/point systems. It also depends on cultural factors and current political mood.
The answer is there is no answer: For the final items it's often a back-and-forth with the review board (eg: "tone down one of those 3 items") to reach the target age rating.
Poking nipples (regardless gender) are generally around the everyone/teen (age 10-14) rating range due to the surrounding context and overall tone of the game that often goes with it but adding too many other risqué items can raise the rating and even then it varies by cultural region.


Closing in a window opening on a cinderblock wall

Question: I am having a window closed in, on a cinderblock wall. My contractor laid mortar horizontally when he put up the wall. But he left gaps on all the vertical sides of the cinderblocks. When I questioned him about it he said it was excepible to fill those gaps after all the bricks were laid. His guys tried the rest of the day to force mortar into the gaps. I can now stick a small rod into lots of holes they left. I also noticed when I put a straight edge to the side of the wall the bricks are not aligned. Some are pushed back as they stagger upwards. I called him the next day to ask questions. He called my husband and I crazy and told us that "they are not done". Should I continue to let him keep adding mortar? I can not tell if there is anything between some of the bricks. There is however lots all over the fronts of the bricks.  Will that hold them up over time? I am not sure how to move forward.
Comment: Can you add some images of the holes and the window? It would help us to advise you.
Answer: You have several issues: 1) proper mortar installation, 2) mortar on face of bricks, 3) contractor's license.
1) Laying bricks is not just sticking mortar between the bricks. Bricks are embedded into mortar. The bricks should be clean and wetted prior to COVERING the bricks...it's not acceptable to jam a little mortar between the bricks because it will not bond, will not be watertight and will be susceptible to spalling due to frost, moisture, etc.
2) Mortar must be removed immediately from brick faces or it will stain the face. The only way mortar, that has aged on the face, can be removed is with acid. Using acid will remove the finish and cause the brick to leak (water penetrate into the brick). Then, a strong wind will drive rain into the bricks causing damage from moisture, mold, etc. Also, frost will crack the bricks.
3) I would check with your local Builders Board and see if they are licensed contractors. I doubt it. You can see if they have claims against them and you can file a claim against them. The builders board will investigate and make a determination. I'd call your local Building Code Office.
Comment: I agree, it's crazy to think you could build a proper wall section that way.


When citing a paper with a lot of authors; is it OK to shorten the author list in the references section?

Question: I want to cite a paper that has a lot of authors. The list of authors take up half a page in my reference list, and considering the prospect of paying for extra pages, I would like to shorten it, if possible. Is is okay to shorten the author list? If so, how many authors should be included?
Comment: Use a reference manager and let it figure it out for you based on your chosen/required citation style :)
Comment: The answers all suggest you should follow some predefined style. But if you had a style guide to follow, why would you be unsure about what to do? In my field, most journals don't bother to follow any widespread format, but just define their own house style. And since they fail to come up with examples for every conceivable possibility, they normally just end up accepting anything more or less corresponding to their proposed format. If your journal of choice doesn't make any explicit stipulations, just do whatever you want. The worst that can happen is that a sub-editor asks you to change it.
Comment: Some citation styles demand full list, some use Smith, J. et.al. for 3 and more authors, some for 5 authors. In some styles you refer a paper just by journal abbreviation, volume, pages and year.
Comment: @tonysdg: I'm using the AIP LaTeX class revtex4-1, which includes a bibliography style -- still includes all the authors...
Comment: @Arnfinn I'd look for the answer here: http://tex.stackexchange.com/questions/121625/biblatex-modify-maxcitenames-to-work-in-three-cases
Answer: Every citation style has some threshold at which it is OK to change a long list into an "et al." citation ("et al." is an abbreviation of the Latin "et alia" meaning "and others").  The particular threshold depends on the citation style, but if you've got half a page of authors it's certainly over any reasonable threshold.
You then simply convert your citation of, e.g.:

A, B, C, E, ... , Z, "Massive Joint Study," Journal of Big Science, 1(4), 2012.

into:

A, et al., "Massive Joint Study," Journal of Big Science, 1(4), 2012.
Comment: Tangentially "alia" is the neuter form and it may be considered uncommon in reference to persons,  "alii" and "aliae"  are male and female, respectively. Yet "et al." abbreviates all three,so that's convenient and always right.
Answer: As mentioned by @jakebeal, the correct approach is dependent on your citation style. Here is an example of 6th Edition APA Style.
Quoting the following post from the official APA style blog, the following rule applies to articles with more than 7  authors:

The first six
  authors are listed; all subsequent authors except the last are omitted
  and replaced with an ellipsis; and then the name of the last author is
  listed.   Here's an example of the new reference list style, for a
  study with 87 authors (yes, 87!):
Terracciano, A., Abdel-Khalek, A. M., Adam, N., Adamovova, L., Ahn,
  C.,   Ahn, H., . . . McCrae, R. R. (2005, October 7). National
  character   does not reflect mean personality trait levels in 49
  cultures.   Science, 310, 96–100. doi:10.1126/science.1117199
Comment: @dan1111 The first author of an alphabetically ordered paper with lots of authors does actually get quite a bit more recognition. If you're the nth author of the paper that everybody in your field knows as "Aardvark et al.", you don't get nearly as much credit in people's minds as Prof  Aardvark does.
Comment: This is how it is supposed to go in the *reference* for APA 6th edition. In the citation, it would just be Terracciano et al. 2005
Comment: @BenoîtKloeckner I'm not aware of citation styles which differentiate between author ordering conventions.  In any case the main benefit to authors comes from 1) Being an author on the paper 2) having their paper cited.  It doesn't come from having their name mentioned in someone else's bibliography.  So I don't think it is an issue.
Comment: I am not sure this guideline is adequate here: the given paper lists the authors alphabetically, so being last (or first) author has no special meaning.
Comment: Likewise, the last author has a special meaning in several institutions - it may be the institution's director for example, who perhaps didn't actively participate in the research, but supplied the lab and access to funding.
Answer: You should follow a style guide.  If your editor, instructor, etc. didn't tell you what style to use, pick one.  In this case pick one that doesn't insist on full author lists.
When in doubt I use the Physical Review style.  On page 7 of the linked guide you'll find the example for a listing a large collaboration of authors:
J. M. Smith et al. (XYZ Collaboration), Phys. Rev. D 46, 1 (1992).
For the paper you link it would be:
B. P. Abbott et al. (The LIGO Scientific Collaboration), Rep. Prog. Phys. 72 (2009).


Electroreception for human beings

Question: Having been looking into scientifically plausible forms of telepathy, I stumbled across the electroreception senses that exist in some electric fish (and in a few land-dwelling marsupials). My question is whether it's feasible for a human-like species to evolve the same kind of thing, and what limitations would be imposed by living on land where there wouldn't be a consistent source of water to be used as a conductor as for the electric fishes.
Comment: Overcoming the permittivity of air would take considerable electric potentials, which means the intake of large amounts of elements like sodium and potassium.  You could get around this a bit by limiting the range drastically.  Think Near-Field Communication - two humans put their heads near each other to send thoughts.  This also helps with the "going insane because I can hear everyone's thoughts" problem.
Comment: Migratory birds can also sense the magnetic field of the earth, so it's not unreasonable that humans could evolve (or be engineered if you're starting with current day earth) the ability to sense electr(omagnet)ic fields.
However this will still be VERY different from telepathy.
Comment: @Nicolai yes I think that in order to qualify as telepathy there must exist the ability to send a signal as well, and in this case to overcome the fact that air isn't a very good electrical conductor.
Comment: @ChrisM. I'm not opposed to drastically limiting range, and I'm considering the possibility of having most people needing close proximity or skin-to-skin contact for telepathy, with other people specializing and building up the capacity to send a stronger signal (the way some people specialize in building up greater muscular strength irl, for example)
Answer: Magnetoreception might be easier. You might be interested in magnetic implants which enable you to feel not only magnetic fields, but also (alternate) electric currents, and do not need a conducting environment. The nice thing is that your brain soon internalizes the new feeling and it looks like a new, separate sense.
You can even use non-invasive magnetic rings.
So, it is at least remotely plausible that evolution can lead to (magnetized) magnetite concentration in some part of the body - but that's still far from telepathy.
Answer: What the fish you mention do is likely more akin to an iPhone screen, they send preferably alternating current through a conductive medium and recognize any changes in resistance and capacitance. This is mostly not viable unless you share a circuit with the thing you hope to detect.  Nevertheless, some touch devices can sense your fingers through air, though I don't know what that kind of accuracy requires. That failing, you can use induction to detect charge without a circuit but not capacitance. You wouldn't be easily able to discern between distance and magnitude without two sensors.
If you also hope to detect the presence of charge, here are some options. Be aware that the charge of neurons would interfere and is highly dynamic.
Introduction to the vicinity of charge will induce a motion of electrons through certain materials. This is why our hair becomes positively charged near lightning, and is an event that facilitates the jump of electrons from the clouds. It works at a small scale incredibly well. Look up "induction".
Changes in charge will also induce magnetic fields that can then affect the motion of charge within them.
I suspect that charge is far easier for relevant biological life to maintain than a solid state magnetic field, because most magnetization is easily lost. Lodestones are made by lightning and wouldn't be the most common thing in the world, yet every animal creates charge to move neurotransmitters through and between neurons. Baking destroys most high quality magnets like those used in motors. Electromagnetism might even be more viable than synthesizing one for some applications. You could have magnetite seeking hermit crabs though.
Answer: Actually humans can sense electrical fields and magnetic fields.  Look up electrical sense gurus on google. It's something most people aren't aware of, but it's there. With my autism I feel the resistance of everything around me weakly. I see strong charges from moving cars, etc. it's certainly weak compared to sharks sense. Like, by a millionth. I have thought about telepathy but realistically, I'd have to be a strong generator of electrical energy to be heard over the other signals around me. Most people are pretty basic electrical grounds. And yes, seriously, it's stupid and not precise, but I've done repeated tests, and will, but got tired of doing it. It's just like your touch doesn't end at your skin. The most realistic way I'd see it occurring is something like Morse code. More than that and the brain would need to evolve to handle the sense more complicated than I have.
Comment: I looked up electrical sense gurus and funnily enough all that came up was stuff on electroreception. Do you have a source?
Answer: Check out the "aquatic ape hypothesis". It is plausible that humanoids evolve with water being an essential part of their lives and still live on land. In this case, something like electroreception might evolve given the right circumstances of course - there need to be electrical fields for starters. I hope I read your question correctly, it could be interpreted as "my humanoids live in the desert with almost no water" - in which case it is kind of obsolete but not really. Just ignore all the water bits. Yes, some land animals on earth have that ability, but there must be a reason why we didn't evolve that sense - so I conclude that it wasn't enough stimulation/need for it. But also note that you can sometimes feel electrical fields, when all your body hair starts to spread out because your body is charged - you can feel that actually.
Here is what I would do, but I'm no evolutionary biologist. I hope this would be plausible to enough readers:
There is this organism (say a plant) that is poisonous and produces a weak electrical field. There is another plant/fish whatever that copies that electrical field to scare off predators. Your humanoids and their ancestors love to eat that organism. Variations are countless, from the initial plant not being poisonous to the humanoids to food growing where there are natural electrical fields (different question how they might get there) and so on.
I think one should have this in a more aquatic setting. Yes, there is no reason why this wouldn't work in air, but I think your question has a bit of a "what is the most likely way" quality to it.
The problem with non-aquatic electrical fields of course is that they need to be stronger, maybe resulting in regular shock. If you go for the desert option with little water, maybe choose an environment where not getting electrocuted is essential. How to construct this planet is a different question.
You could imagine a completely different reason for electric fields on your planet. For example your humanoids needed to go someplace for seasonal change and that is made obvious by regular strong solar winds that charge the atmosphere or strong storms. The options really are limitless, but I still feel the most intuitive way is having your land-living humanoids be in water a lot which is even how we might have evolved.
Answer: Your main problem is that water conducts electricity really well, whereas air conducts electricity really poorly - air is effectively an insulator. Otherwise you wouldn't need to touch a live electrical wire to be electrocuted, you would just have to stand nearby. (Although large voltages can cause sparks to jump a gap, but we're talking machinery not biology in those cases).
Therefore the distance over which your humans could sense anything with electrosenses is so short as to be useless. Years back I read some papers about rattlesnakes - someone suggested that the rattling tail could generate electrostatic charges which the snake could use to sense things with its tongue. But another scientist calculated the effective range and it was only a couple of centimetres. The snake would be able to see and smell its prey long before it could electrosense it. Sorry, this is the only reference I can find on the discussion.
So the Vulcan Mind Meld is possible - you touch the person. Knowing what someone across the street is thinking is not feasible.
Comment: While it's absolutely true that you can't pass an electric *current* through the air, you can still quite easily pass an electric *field*, in fact electric fields pass quite happily through insulating materials in the same ease that magnetic fields do. There is even [a non-contact electromyograph](https://www.theengineer.co.uk/issues/november-2010-online/non-contact-sensor-detects-changes-in-muscle-movement/) can supposedly sense people through walls (it also looks the part of a mind probe). So it's possible, just bloomin' difficult.
Comment: @Samwise Well, you can have arcs but probably not so useful or healthy for communications.
Answer: For inspiration, bees can be an example of "inland electroreception."
Honeybees perceive electric field changes via receptors in their antennae and use this information to know if a flower has been recently visited by another bee and is likely to have a reduced concentration of nectar.
They detect electric fields through insulating air by mechano-reception, so it's not technically electroreception. They distinguish different temporal patterns and learn them. During the waggle dance, honeybees appear to use the electric field emanating from the dancing bee for distance communication.
https://en.wikipedia.org/wiki/Electroreception#Bees
Answer: Electroreception is present in humans. various humans have shown it. I have it. I'm autistic though. Autism can come with oddly connected parts of the brain. For instance I see beams in walls and ceiling. I always thought it was due to painting or something, till I realized I don't see it in photos. I also see disruptions in cars and in the sky. I suspect it's what pigeons have in their eyes. They're called cryptochromes that allow them to see magnetic lines in blue light. I also feel everything at a distance. It may be more common than known, but if you don't know it's not normal, or you're different you don't know to tell anyone. I can't imagine my sense of touch ending at my skin. I thought it was normal. And there are definitely people who have a much stronger field than others. As a kid I use to cheat at hide and go seek because I could feel the direction people were in. Of course I didn't know it was cheating, I just did it. I also have consciously at times controlled my heartbeat, and my interference with radio signals by causing static at will. It was easier as a kid, but many of our senses dull over time.

Electroreception for human beings


How to open a new tab on the left end of the existing tabs in Firefox

Question: How do I make Mozilla Firefox open new tabs (using the command Ctrl+T) at the near left end of the tab strip?
Answer: There is no way to do it without an add-on.
I installed Tab Mix Plus 0.4.1.0 and this solved the problem by adding the desired functionality.
Edit: After installing Tab Mix PLus 0.4.1.0, in order to open a new tab right after the tab you are currently in, you have to:
1. right-click on the current tab
2. choose the first option - "New Tab (After This Tab)"

Comment: Care to explain how you have done it? I can't find the option inside TabMixPlus
Comment: @Sekhemty done.
Comment: Oh well, I knew that; I wrongly understood that you wanted to open a new tab at the absolute left side of the tab-bar instead of directly to the right of the current one.
Answer: I don't think this is possible in one step, but you can move the new tab left with Ctrl+Shift+Page Up and to the right with Ctrl+Shift+Page Down.
Comment: Yes, I also came to the conclusion that it is not possible. Thanks for the advice though, it would be useful. I installed an add-on which permits opening a tab next to the current.
Comment: @Rayhunter: Cool. Please share this as a solution by by posting your own answer. It may help future visitors.
Answer: I'm fairly certain that it is not possible. The behavior of Ctrl + T is to open a new tab in the same way that the new tab button opens a new tab. It automatically defaults to the right side because of how the space is occupied. The left side is occupied so it starts to fill in the right. We also read left to right. Other than some crazy macro that creates the new tab and then shifts it to the left I don't think there is a simple way to do this. Why are you trying to do this?
Comment: You and I read from left to right, but you never know about the next guy.
Comment: Fair enough. Arabic is read right to left.
Comment: When I have opened a lot of tabs and then open new blank tab for some reason, I must go to the end and bring it back which is very annoying. Anyway, I installed an addon which adds the desired functionality. Thanks for the response.
Comment: I don't think your made it clear that your intention was simply to have a tab open next to the current tab and not at the end. That's probably why no one suggested such a plugin. Anyway, you should answer your own question and post the solution to help anyone who finds this question later.
Answer: No addons needed, simply visit about:config and toggle browser.tabs.insertRelatedAfterCurrent to false to load tabs on the far right. or true for relative (close to your tab on the left).
Comment: The option you mention only affects tabs that are opened, by clicking a link inside the webpage. When opening a new tab, you must use the option `browser.tabs.insertAfterCurrent`.


Resolution Issue on install

Question:
I'm unable to install elementary OS due to this resolution issue, does anyone know how I can fix it?
Comment: Does "Try elementary OS" work fine?
Comment: Not a good sign that no one has answered this. I'm having the same problem now trying to install elementary OS on a Lenovo Yoga Pro 2.
Comment: You can try to try XD Elementaryos from a live USB or CD and then install it from their. It works for my! I have a HDMI TV and old Acer desktop.
Comment: It looks like your install is not recognizing the correct display resolution for your computer. If you have the ability, I would say try to use a different display port (I.E. DVI-VGA or HDMI-DVI) while in a live environment to make sure that your monitor is sending the correct info to the computer. Let me know if you need more help.
Answer: You might want to start the elementary OS live mode from the installation medium so that you can check System Settings/Displays to fix this problem.
Even if you cannot fix the resolution you can move the installation window if you drag it with the windows key held down.

Resolution Issue on install


Google maps to gpx

Question: I have taravel map created in google maps. Now I need to save way points in GPX format to make them available for my GPS Osmand application. How to solve this problem?
Comment: is this map in fusion tables? or json?
Comment: This might help: http://labs.coruscantconsulting.co.uk/garmin/gpxgmap/convert.php
Answer: There are a variety of approaches you could take, including:

Save your map as a KML file, open that file in QGIS, and save as
gpx.
Use an online converter like GPS Visualizer. You can paste your
map's URL directly into the tool as presented in this tutorial. Other possible converters include GMapToGPX, TakeItWithMe, and several others available via search.
Comment: But how to save to KML file using google maps. I can't find  menu command like that. I'm working on China map
Comment: @vico Does this help: https://support.google.com/mymaps/answer/3109452?hl=en

Google maps to gpx


How many chances do you get to become a Vampire Lord

Question: So, I am working on a new playthrough of Skyrim with the two new DLCs and I would like to work in being a vampire lord early into the game. Doing a bit of reading however it seems I have to select to be a dawnguard if I want to be able to craft crossbows and bolts... which I do want..
Can I choose to join the dawnguard up front and then become a vampire lord later down the road or is this the only time this option will come up?
Answer: Once you've finished the Chasing Echoes quest you'll be given another opportunity to become a Vampire Lord, even if you originally sided with the Dawnguard.
Details that may be considered plot spoilers:

 Before you can enter the Soul Cairn, Serana will tell you that you need to be "dead." At this point, you can choose to let her turn you into a Vampire Lord or let her partially soul trap you. Using the former will (obviously) turn you into a Vampire Lord. In addition, you can choose to ask her to transform you at any point after this quest, regardless of what you choose for accessing the Soul Cairn. However, it's also worth noting that there is a dialogue that will give you the option to convince Serana to cure her vampirism. If you do so, you will lose the ability to have her transform you at later points since she is of course no longer a vampire herself.

I'll also note that this was how I played it, and I hadn't finished some of the Dawnguard sidequests before becoming a Vampire Lord, causing them to become blocked unless I cured myself (so be wary of that).
Comment: @AliceRees Crossbow and Bolt recipes.
Comment: Perfect, that will allow me to pursue this avenue and not miss out on the crafting recipes. Thanks!
Comment: @James what crafting recipes?
Answer: Choose the dawnguard because after the main quest you can get serana to bite a infinite number of times, even after you are cured, and you still get the benefits of being a dawnguard.
Answer: If you join and finish the dawnguard questline you can still become a vampire lord through Serana. However, if you do this, the dawnguard won't help you anymore and tell you to cure yourself.


Electromagnetic Waves - Amplitude

Question: If light travels as a wave rather than a straight line there should be a width limit for it to travel and penetrate matter   - like a hight limit for automobils in roads due to bridges -
My question is1.How to calculate this specific width !
2. Can you use this formula to calculate the filtration percent of a sheet (on a beam of light passing through the sheet)?
Tnx!
Comment: You need to be aware that the "wavy nature" of light is because the electric and magnetic fields of light are oscillating wrt time and space. The light doesn't follow a wavy path - it is the $E$- and $B$ field strength that has a e.g. $sin$ dependence. The direction in which light travels is still a straight line (and always perpendicular to the direction of $E$ and $B$ for a plane wave).
Comment: Light is an EM wave
Answer: It seems you misinterpreted the wave nature of light.
It doesn't say that light follows a wavy path. Instead, light travels in a straight line, and it is the magnetic and electric fields that oscillate.
If you'd focus on one specific point in space, it would seem as if the magnetic and electric fields are getting stronger and weaker, and repeat in the other direction. Plotting the field strength and direction over time would result in a $sin$-curve for each field component. The same result you'd get if you froze the light wave and plotted the field strength and direction with respect to the position.

So, each part of the EM wave does in fact wave, but what about the whole light wave?
For this we can calculate the Poynting vector, which tells us the energy flow:
$$\vec S = \vec E \times \vec H$$
For a plane wave, we have the following expressions for $E$ and $H$ with propagation in $z$-direction:
$$\vec E(z,t) = \vec E_0 \sin(kz - \omega t)$$
$$\vec H(z,t) = \frac{\vec E_0}{Z_0} \sin(kz - \omega t)$$
where $Z_0$ is the impedance of free space ($377~\Omega$), which tells us the ratio of magnetic and electric field.
From the above formula we can see that the direction of the energy flow will be completely perpendicular to $\vec E$ and $\vec H$, since the cross product ($\times$) of two vectors returns a vector perpendicular to both. The remaining term gives the strength of the energy flow, which now oscillates at twice the frequency and has an average value of $$\langle S \rangle = \frac{1}{2Z_0} |E_0|^2$$

But in fact a light wave doesn't "fit" through arbitrarily small holes (or "apertures"). Light falling on an edge is diffracted and doesn't throw a neat, clear shadow line on a screen behind it. Instead, we see a diffraction pattern, which varies in intensity.
The same happens when light travels though a hole. Light falling on the edge of the hole is diffracted, changing direction and interfering with waves from other parts of the aperture. The smaller the aperture is, the more significant this effect becomes.
There is a limit to how small an aperture can be, given by the Fraunhofer diffraction limit:
$$\alpha = \frac{1.22 \lambda}{d}$$
where $\alpha$ is the angle of the first dark ring (constructive interference), $\lambda$ is the wavelength and $d$ the diameter of the aperture.

For a given wavelength, a decrease in size of the aperture will quickly increase the angle of the first dark fringe and therefore increase the size of the spot of transmitted light. The light is spread out over an enormous area, and therefore very dim.
What if we have "more light"? An increase in intensity shows up as an increased amplitude of $E$ and $H$ fields. This in turn means that each spot on the screen is proportionally brighter if the amplitude of the incoming light wave is larger. However, the fraction of intensity on any given point to the total incoming intensity is determined only by the wavelength of the light and the aperture size - not the intensity/amplitude.
As you can see, the critical parameter that determines if light "fits through a hole" is the wavelength $\lambda$ and not the amplitude $E, H$ of the wave.
Comment: Would be nice to add, that the meaning of the amplitude of light is occupied by the probility to find the particle somewhere on the observation screen (in the dark and bright fringes). The extent of the photons electric and magnetic field components is per definition infinite.
Comment: @HolgerFiedler Thanks for the input! I added a short paragraph that I think picks up your suggestions, but leaves out the photon part. Since we are dealing with classical wave optics, it might be a bit confusing and not so fruitful to introduce photons into this answer.
Comment: @ahemmetter    I sincrerely thank you for your thourogh answer, I feel like I found the holes in my own knowledge of EM waves, I would start by following your suggestions of formulas to get a better grip of my question.

Electromagnetic Waves - Amplitude


How to interpret 'hcitool afh' (AFH map)

Question: Sometimes, I have problems when I use Wlan and Bluetooth concurrently. I wanted to check if they use the same frequencies and found out that I can check the current AFH-map with hcitool afh.
The result looks something like
user@device:~$ hcitool afh xx:xx:xx:xx:xx:xx
AFH map: 0xff4f28000000f0fe0000

So now, what does that mean, where is that documented?
Comment: If this is a wifi/bt combo card, add the results from `lspci -nnk | grep -iA2 net` to the question as your issue may be fixed by changing the default parameter for bt coexistence.  I can't find where to decode the info from that command either
Comment: Yes, it is a combo card, it is an Intel Dual Band Wireless-AC 7265 card.
Next question: What is "Bluetooth coexistence"? I have already found this approach (with bt_coex_active=0) and I believe that it has helped but I am trying to understand, not only to find/copy a solution.
Comment: Sometimes the default parameter doesn't work as it is supposed to minimize the interference between wifi and bluetooth but it doesn't always work.  It seems that bluetooth uses 70+ frequencies and hops from channel to channel
Answer: I just came across this question looking for the meaning of "AFH map". Although the question is quite old, I'd like to share my findings.
There are (at least) two different mechanisms that help to reduce the interference between Bluetooth and WiFi:
1. Adaptive Frequency Hopping (AFH)
Bluetooth devices transmit on 79 different channels, spaced 1 MHz apart between 2,402 MHz and 2,480 MHz. During data transfer, the sender changes the used channel very quickly in a pseudo-random order ("hopping sequence") to reduce the chance of interference caused by other radio services using the same frequency range. The receiver knows the sequence and "hops" the channels synchronously with the sender.
The basic principle of AFH is simple: Channels with known interference are simply left out of the hopping sequence. The AFH map simply tells both communication devices which of the 79 channels are good to use and which to leave out. The AFH map consists of 80 bits (20 hex digits) corresponding to the 79 channels (and 1 reserved bit).
Channels usable for Bluetooth have the corresponding bit in the AFH map set. That is, the more "1" bits you see, the less interference is there and consequently the more throughput your Bluetooth link will have.
AFH was introduced with Bluetooth 1.2. You can find more details e.g. in the  Bluetooth 5.0 Core Specification (search for "AFH channel map" in the PDF file).
2. Bluetooth Coexistence
While AFH covers any (probably external) source of interference, BT coexistence is designed to minimize interference caused by a Bluetooth interface and a WiFi interface that are co-located in the same device (i.e. laptop, smartphone). Basically there is a wire running from the WiFi chip to the Bluetooth chip. Whenever the WiFi chip is transmitting a frame, it tells the Bluetooth chip to "shut up for a moment" until the WiFi transmission is over.
Over time, different, more elaborate variants of this basic scheme were developed (2-wire, 3-wire, unidirectional, bi-directional etc.)


Any list of $n+1$ vectors of an $n-$dimensional vector space is not linearly independent

Question: Theorem: Suppose $V$ is an $n-$dimensional vector space. Then any collection of $n+1$ vectors $\{v_1,v_2,\dots,v_n,v_{n+1}\}$ is linearly dependent (or not linearly independent).
Proof. Suppose $V$ is an $n-$dimensional vector space and consider the collection of vectors $\{v_1,\dots,v_{n+1}\}$. Since $V$ is $n-$dimensional, by definition, there exists a basis for $V$ with $n$ vectors, i.e. there exists a collection of basis vectors $\{b_1,\dots,b_n\}$ such that $\displaystyle\sum_{i=1}^n r_ib_i=v_i$ for any $b_i \in V$ and for some scalar $r_i \in \mathbb{R}$ or $\mathbb{C}$ (without loss of generality).
Consider the statement
$$a_1v_1+a_2v_2+\dots+a_nv_n+a_{n+1}v_{n+1}=\hat{0}$$
If we can show that some $v_i$ is a multiple of another vector(s), we are done. Since $b_1,\dots,b_n$ form a basis for $V$, each $v_i$ can be rewritten as a linear combination of $b_1,\dots,b_n$. Thus,
$$a_1(r_1b_1)+a_2(r_2b_2)+\dots+a_n(r_nb_n)+a_{n+1}(r_{n+1}b_{n+1})=\hat{0}$$
$$a_{n+1}(r_{n+1}b_{n+1})=-(a_1r_1)b_1-(a_2r_2)b_2-\dots-(a_nr_n)b_n$$
$$a_{n+1}v_{n+1}=-a_1v_1-\dots-a_nv_n$$
If $v_{n+1} = \hat{0}$, then the vectors $\{v_1,\dots,v_{n+1}\}$ are linearly dependent since $\hat{0}$ is a multiple of every vector. So suppose $v_{n+1} \neq \hat{0}$. Since $v_{n+1} \neq 0, a_{n+1} \neq 0$, and thus, in either case, the vectors are linearly dependent. $\hspace{1cm} \square$

My proof seems like it's in the right ballpark, but my ending paragraph seems to fail to connect to any of my previous work; in other words, my ending conclusion fails to incorporate the notion of a collection of $n+1$ vectors. Am I missing anything here?
Comment: Probably your argument would be clearer if you wound up showing a linear dependence relation among the $b_i$'s, which (as a basis) were supposed to be linearly independent.
Comment: $$\sum_{i=1}^{n} r_ib_i=v_i$$ has two conflicting usages of $i.$ What you want is:$$v_i=\sum_{j=1}^n r_{ij}b_j.$$
Answer:
You wrote "$\sum_{i = 1}^{n} r_{i}b_{i} = v_{i}$" which should be $\sum_{i = 1}^{n} r_{i,j}b_{i} = v_{j}$

It's not clear why $a_{1}(r_{1}b_{1}) + a_{2}(r_{2}b_{2}) + ... + a_{n}(r_{n}b_{n}) + a_{n + 1}(r_{n + 1}b_{n + 1}) = 0$ since $v_{i} \not = r_{i}b_{i}$

You can start with the assumption that the set $A = \{v_{1},...,v_{n + 1}\}$ is linearly independent. Then use the dimension of V to see that the set $A \setminus \{v_{i}\}$ is a basis for V, for all $i = 1,2,..,n + 1$. From that, conclude that $v_{i} \in \text{span}(A \setminus  \{v_{i}\})$ for all $i = 1,...,n + 1$
Comment: Is the purpose of this proof to arrive at a contradiction? Because, in the end, I seek to show that the set $\{v_1,\dots,v_{n+1}\}$ is linearly dependent.
Comment: Yes, by showing that $A \setminus \{v_{1}\}$ is a basis. You can argue that the set A cannot be linearly independent. This is a contradiction because we assume that A is linearly independent.


MySQL limiting user disk space by tablespace

Question: I am trying to figure out how to set a limit of disk space for users in MySQL. What I want is, for example, administrator assign 1G disk space for user A, if A used up the 1G disk space, MySQL would not allow A insert anything. I googled this problem, and someone mentioned that it can be solved by using tablespace, but did not mention how. Any help is appreciated.
Answer: As far as I know there is no native MySQL disk quota support (and limiting disk usage for a database with hard quota sounds like a recipe for disaster).
You can report on disk usage though with the MySQL disk usage utility  https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysqldiskusage.html
Answer: You can put mysql/datadir on each user home example
/home/user1
or DATADIR="/var/www/${VHOST}/mysql/datadir"
then put a limit on the disk space for each user
Also like that each user will have his sock and pid file
I use to do it like this:
<code>mysqld --skip-ndbcluster --user=mysql --skip-grant-tables --basedir=/usr --datadir=${DATADIR} --skip-innodb --skip-bdb --skip-networking --max_allowed_packet=8M --net_buffer_length=16K --socket=${sockfile} --pid-file=${pidfile} &>/dev/null
</code>


Suggestion: sticky posts for topical questions

Question: I'm pretty new here but I was struck by the number of duplicate questions about gravitational waves in the wake of the LIGO discovery a few days ago. This lead me to wonder, perhaps not uniquely, whether it might be prudent to have some sort of temporarily sticky FAQ type posts associated with such high profile news. If these posts stayed at the top for as long as the associated news item remained popular and if previous questions on the subject were collated in them that might discourage reposting of the same questions at least to some degree.
Comment: There's also the [tag:ligo] tag as well
Comment: I don't see how sticky posts would help at all. The front page is a very fluid thing, and having posts stick to the top of it would give them much too much exposure.
Comment: And probably related: http://meta.physics.stackexchange.com/q/7522
Comment: It's now been almost a week since the announcement. If you look at the top questions for the past week, over 60% are about GWs and LIGO. By this metric they overshadowed all other subjects combined during the past week. Does that not warrant a single FAQ post where most common queries about the topic can be collated? Furthermore, I would suggest that the opposite of what you're claiming might happen: collecting the most common queries about the topic in one place might free the rest of the front page for other content instead of it being inundated by post after post on this one topic.
Comment: In principle, when you type a title containing "LIGO" you should immediately be presented with a bunch of "possible duplicates". If we ensure that the titles of "not closed" questions are as descriptive as possible, that may do all we need?
Comment: @Floris, Two issues here. First, the scope of questions can be wider than just having to do with the particular experiment, say. E.g. for LIGO there might be general questions about GWs that wouldn't have LIGO in the title/tags. Second, I think once you begin to write your own question, the threshold for looking at other questions that pop up might become higher than it is when you first come to the site. Once you start you have already invested some mental energy; especially, I suspect, for the type of poster who comes hot from having read some news item and doesn't search prior to posting.
Comment: @KyleKanos, thank you for linking the other discussion. I thought there must have been similar thoughts but didn't find any.
Comment: @Philo - the moment you type your question title, a bunch of suggestions pops up... I am hoping we are encouraging people to be thoughtful enough to look at those suggestions, but perhaps this is the "a year in the lab can save you a day in the library" crowd...
Comment: @Floris The fact that duplicates do appear to pile up would suggest that there is a contingent of posters who do not look at those questions. I'm suggesting that having a sticky post like what I have described might whittle that remaining crowd some more.
Comment: @EmilioPisanty, I would suggest that posters who come here having read some news item might be less inclined to ask basic questions that end up as duplicates if they saw a FAQ post relating to the area of their inquiry right at the top. There have been half a dozen basic questions relating to GWs and LIGO in the last 24 hours alone. I'm not suggesting that the post would stay sticky indefinitely, just for as long as the news item remains popular. I'm not sure what you mean by getting "too much exposure" but if you mean votes/views/other statistics those counts could be disabled for such posts.
Comment: The site is much bigger than just LIGO - for instance, there's currently only one LIGO question on the front page. Placing a post permanently at the top would be to the detriment of the attention of all the other topics we discuss. The top of the front page is never used for static content, even on ~week timescales, and such sticky posts are completely unheard of on Stack Exchange (which is who you'd need to convince). I'm not saying that some form of temporal waymarker to topical tags would be a bad thing - I'm just saying that sticky posts would be a terrible idea.
Answer: The system doesn't have the technical capability to do this. There are two options we do have for giving a question more exposure than usual:

Put a bounty on it, which causes it to show up on the "featured" tab and to get higher placement in the list of active questions
Put a link in the community bulletin, the yellow(?) box off to the right

Neither of these automatically catches the eye of every visitor the way a stickied question would.
Now, in principle this feature could be added by the SE developers, but I suspect they wouldn't do it. Sticky posts are one of those forum-like features that I think they would consider to distract from the core Q&A mission. And they'd be right, on Stack Overflow, but I do kind of see how that could be a useful feature (mod-only, presumably) on smaller communities like ours which actually have major events. Basically, it wouldn't hurt to bring it up, I just don't think there's much of a chance that would happen.
As for the underlying issue of reposted questions: the core problem seems to be that a lot of people just don't read. The SE people have been studying this for a long time. There are a lot of cases where very obviously placed notices don't stop people from doing exactly what the notices tell them not to do. Of course sticky posts wouldn't have to completely block duplicate questions to be worthwhile, but it's quite possible that they would barely make a difference at all.
Comment: It's true that it might not have a significant effect, it's hard for me to predict what would happen and probably a guess of more experienced people would be better than mine. But I feel it might have a noticeable effect. Given that it would be an very easy thing to do coding-wise, it might be worth a try. Also, it might serve better those who come here to ask basic questions following a high profile news story. I wasn't sure how much power the Phys.SE community had over the site features, though, and if it can only be done globally by SE then that makes it more complicated for sure.


Finding solenoid box

Question: Hello I have an err 1 on my rain bird controller and all the zones work except for one and two which are in the same place could this be a solenoid gone bad. If so I have found the wire that runs out of the controller does this run to the solenoid box?
Answer: Welcome to Stack exchange Brandon. Have you had any frost recently, this often causes damage to solenoid valves in irrigation systems? I would work out which pipes should water the broken zones and trace those back to the solenoid. This solenoid is most likely the faulty part and should be replaced.
Comment: It has been warmer here as of recent I'm actually trying to locate my solenoid box which I am have a tough time finding. I found the wire tuning from my controller does that run directly to the solenoids?
Comment: what's the model number of your rain bird controller?

Finding solenoid box


How can I install Blender on a different disc than C entirely?

Question: I would like to install Blender on a different disc than C, with no residual files on C at all, because I don't have any space on my C drive. Is there an option to do that? I tried changing the install directory, but it didn't work. Thanks.
Comment: I will note that if your C drive is so full that Blender will not fit on it, you really should delete some files: That's dangerously overfull, and could cause problems later.
Comment: There are a lot of options. You can download Blender from Steam or Microsoft store or you can download the portable zip version from the official site.
Answer: You can install Blender anywhere you wish if you download it's installer from https://www.blender.org/download/
You need to specify your desired location during the installation:

You can also download the portable version if you choose it from the drop down menu in the middle of the download page:

In that case you can just extract the zip file anywhere you wish and just run it without installing at all.
Like others have noticed in the comments, you probably want to address the issue of low space in your C drive anyway, because many programs including Blender usually use it for temporary storage(in Blender's case even autosaves) and you will experience issues if it's completely full sooner or latter. You can use free tools like SpaceSniffer and similar to find out what uses all your space and BleachBit to help you clean it automatically. You should be mindful of what you delete obviously in order not to lose something that you want to keep.
Answer: I'm surprised the installer did not put Blender on a different disk when you told it to. You can always use the portable version of Blender, put the folder where you want, and just put a shortcut to the executable in your start menu or on your desktop.


Scrambled Xen Console on dom0

Question: I installed Xen using the recommended procedure on Ubuntu's site using motherboard Supermicro X7SBL-LN2 and Ubuntu 13.04 amd64. After the installing it and rebooting my console looks like this: https://www.youtube.com/watch?v=-UbZt7Gix2Q I've had this happen also with CentOS 6 as well. Everything on the server works fine but the console is unusable. If I switch back to the stock kernel it goes back to normal and I can use the console again but then I can't use Xen. This is a fresh install of Ubuntu 13.04. Any help troubleshooting this problem is appreciated.
Answer: I contacted Supermicro about the problem and they gave me a beta BIOS for the motherboard to try. Surprisingly it actually fixed the problem. Since the BIOS isn't posted on their site I'll just leave a link here to it in case anyone else is having this problem. Use BIOS at your own risk as it is a beta BIOS.
http://geo.animounted.net/X7SBL1.113.zip

Scrambled Xen Console on dom0


Is there a way to make the comment module email the administrators when a comment needs approval?

Question: I'd like to be notified whenever comments are made on the site which require administrator approval before publishing; basically, I'd like to know when something new appears in the Approval Queue. I can't see any obvious settings for this.
Answer: Sounds like something Rules should be able to do.
Comment: Is it possible to define a rule that will send a message only if the comment needs approval? in my case, some comments (e.g. by registered users) don't need approval.
Answer: Check out the Comment Mail module -- if you're going to get an email each time there is a comment you might as well simplify the process by adding approval functionality:

The Comment Mail module allows an email to be sent to the site
  administrator(s) when new comments are posted. A link in the email
  allows quick approval, editing, deletion, and/or banning of the
  poster's IP address.

Word of caution: I've used this method before but quickly turned it off after the spam comments broke my spirit. Make sure you've got a robust anti-spam strategy setup (ex. antispam, mollom, captcha/recaptcha, etc.)
Answer: Yes; "rules" in your Drupal is the way to go: easiest and fastest.


Linux offline installation

Question: I am working on building a Linux server offline with no internet connection. However, every time I try to install an app RH wants to check online for items and fails the installation. How do you configure so yum or rpm only look for local repos and bin Thanks
Answer: https://fritshoogland.wordpress.com/2012/05/26/using-your-dvd-as-a-yum-repository-on-a-rpm-based-linux/ "Using your DVD as a yum repository on a RPM based Linux"
In a nutshell, edit repo files in /etc/yum.repos.d to point at the DVD, baseurl=file://media/Server
Comment: I tried that and now get a error repodata/repomd.xml.src cannot be opened.
Comment: @user148685 Suggest you update question to show the contents of your repo file and the command+error you're getting.
Answer: I had to set the baseurl gpg to point to local locations such as this.
[media]
name=Red Hat Enterprise Server DVD Media
baseurl=file:///run/media/user/RHEL-7.2\ Server.x86_64/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-Key-redhat-release

Linux offline installation


Security Identifer

Question: I have very basic knowledge about ISINs, Tickers, SEDOLs etc. But I am still unable to understand if there is a unique combination of ISIN_Ticker that exists for each security. For example, if I want to identify a security from a particular exchange and type of security, should I assume that the ISIN_ticker will identify me the security? Or, does the combination of ISIN and ticker make NO sense?
Answer: ISIN and ticker are usually different ways of representing the same information with ISIN being supposedly an international standard whereas tickers are provider (such as Bloomberg code or RIC) or market (such as XIST or XEUR) specific. In general an ISIN is a good way of uniquely determining equity instruments but is not sufficient to determine a derivative as, in many cases, the ISIN for the derivative only represents the underlying security and there are multiple derivatives for the same ISIN. Ticker symbols such as BBV-C/X17 (future) or FESA/P/22.23 (option) are used to uniquely identify the derivative. In come cases ISIN + maturity code + strike price are also used but this is uncommon.
Additionally not all US securities have an ISIN but this is becoming less of an issue.
Note that to completely identify an exact security you will need to have ticker/ISIN, MIC/Market code, and currency as some instruments trade on multiple markets with the same ISIN and different (or the same) currency.
Comment: Thanks, I think your answer your answer cleared my doubt mostly.
Comment: let me know what I didn't cover and I can edit it in

Security Identifer


How do I add embedded YouTube videos in a field?

Question: I would like to have a field for adding YouTube videos; however, I do not want to use the Media module because it is very buggy at this point. Is there any alternative for Drupal 7?
Comment: I don't see the question as too localized; I see it as a question about embedding videos without to use the Media module.
Comment: I just experimented with it for about two hours encountering several bugs including not being about to change the preset image dimensions. I'm just going to let the pros work on it a little more before I start to bother with it.
Comment: Saying its "very buggy at this point" makes this question too localized. The Media module is where all effort for D7 media is being made, and most people using the most recent dev version have had great success.
Answer: Just use the Video Filter module, here is a quote from its project page:

This is a highly flexible and easily extendable filter module to embed any type of video in your site using a simple token. Other modules can add video sites/formats (called codecs) using an easy plugin architecture.
With WYSIWYG installed, you can use the Video Filter button to easily add videos in a rich text editor.
Answer: In Drupal 6, you would use Embedded Media Field (emfield) to do this, but that module is being replaced with Media module in D7. Some people are arguing that emfield should be ported to D7 for the time being, until Media reaches a stable version.
An interesting workaround is that of the Vimeo Link Formatter module, which is a formatter for the link field provided by Link module. If you can write php, it might not be too hard to alter that module and make a youtube-equivalent for yourself (and maybe the rest of the community).
Comment: I think that I will be able to create a youtube version of this.
Comment: Great. If you can, please share it with the community, either as a separate contrib module or as part of the Vimeo Link Formatter module.
Answer: What worked for me on D7 was the Video Embed Field. The media field was too complex, and emfield D7 port didn't work at all. The video filter mentioned above seems great but it doesn't provide a field, so it was not an option for me.
Answer: I'm having issues with the media - youtube module as well (D7). I think you could just create 2 fields: one for the youtube embed code and one for the youtube image thumbnail. Then show the thumbnail in the teaser display and the embed code in the full display.


IR-near visible light detection

Question: I want to detect light near 10 micrometer wavelength. It seems like photodiodes are mainly targeted for 1 micrometer range. Is there any detector/sensor for 10 micrometer wavelength ?
Answer: Certainly there are microbolometers for this spectral range. They are called PIR sensor and are cheap and readily available as they are used in motion detectors.
See for example this (first Google result) sensor: 5-14µm
Comment: Thanks Andre. I did not know PIR sensors work this way.
Answer: The lower ends of the Near-IR spectrum (which goes up to about 3uM) can be detected with common CMOS type circuits.  These generally aren't effective past 1uM though which is why you see so many at that wavelength.
10uM is in the Mid-IR region, detecting it is not easy.  Historically it required exotic materials and generally cooling of the sensor (think liquid nitrogen).
There are uncooled devices available now that work in this range called microbolometers.  They are primarily built in arrays for use in thermal cameras and similar applications.  I don't know of any "single cell microbolometers" out there but you may be able to find one.  I doubt it would still be called a microbolometer at that point but i'm not sure what the terminology would be.
I think you'll have a hard time finding such a device off the shelf.  Other than the thermal imaging applications (which will always be arrays of sensors) the only applications i know of for such wavelengths are chemical sensing / spectrometry analysis and those sensor are likely custom built, very sensitive and very expensive.
Comment: Actually, single-element "microbolometers" are simply called "bolometers", since there is no need to miniaturize them. And they are in wide use -- almost all commercial motion sensors use these single-element bolometers and not microbolometer arrays.

IR-near visible light detection


What is the process transforming $K_L$ mesons into $K_S$ mesons?

Question: First of all, I could not find any good book/webpage where I can read about K mesons, can somebody point me to a good reading?
The second point is about $K_L$ and $K_S$ mesons. As I can read, they are eigenstates of $K^0$ with opposite strangeness. In principle they should decay into pions, but I was wondering if a $K_L$ can spontaneously change into a $K_S$ instead of decay into pions or there would be an interaction with protons/nuclei needed for this transformation to occur.
Comment: [Your link](https://en.wikipedia.org/wiki/Kaon#Regeneration) already explains regeneration: The freely flying $K_L$ and $K_S$ of course do not mix--that's the point of them being free hamiltonian eigenstates! But interaction of $K_L$ with a nuclear target regenerates $K_S$. What are you asking? [Related](https://physics.stackexchange.com/questions/210736/understanding-kaon-mixing?noredirect=1&lq=1). Have you tried *any* introductory ***book*** on particle physics?
Comment: my question is what is the _process_ taking place in the generation of K_S, could you explain it using a Feynmann diagram?
Comment: Again, there is ***no regeneration in vacuum***, as indicated in the WP article you cite, which has all the Feynman diagrams you'd ever need. The book by Perkins explains how, in matter, coherent strong interactions---think zillions of pions, gluons, etc---interact differently with the *notional* (fake, strong eigen-)states $K^0$ (elastic & charge-exchange scattering) and $\bar{K}^0$ (absorption)  so treat these two differently and "tilt" $K_L$ back to $K_S$ by a bit. But if you wish to further understand that, you must remove the crank stuff from your question and say so.
Answer:
$K_L$s cannot spontaneously transform to $K_S$s in free space. They are eigenstates of the free hamiltonian and maintain their identity. Their mass difference is $\Delta m \sim 10^{-14} m$.  To effect a
$K_L\to K_S$ transformation ("regeneration") they must go through matter and interact coherently and strongly with its nuclei: absolutely nothing spontaneous about it. I would strongly recommend changing your title, as the present one is odd.

Let's ignore CP violation to avoid mission creep and muddying the waters in the process, so just call
$$  |K_{L}\rangle \sim \dfrac{1}{\sqrt2}\left( |K^{0}\rangle - |\bar{K^{0}}\rangle \right)  \\   |K_{S}\rangle \sim\dfrac{1}{\sqrt2}\left(|K^{0}\rangle + |\bar{K^{0}}\rangle \right).$$
The $|K^{0}\rangle ,  |\bar{K^{0}}\rangle $ states are production states, that is they have well-defined strangeness, but they do not propagate or decay. The $|K^{0}\rangle\sim \bar{s} d$ is the isopartner of $K^+$, with S=1; while  the  $|\bar{K^{0}}\rangle\sim \bar{d}s$ is the isopartner of $K^-$, with S=-1.
They differ in strangeness by two, so only a doubly weak interaction mixes them, the celebrated box diagram. When this is  taken into account, the free eigenstates are $K_L, K_S$ with very different lifetimes, so a beam of neutral kaons will quickly purify to a beam of surviving $K_L$, which are longer lived. In vacuum, no conversion to $K_S$s.
As this beam enters a nuclear target,
the two "strongly distinct"  states (since strangeness is preserved in the strong interactions) are treated very very differently. The $K^0$ scatters its quarks by the exchange of gluons, pions, whatever, and exchanges quarks with the nucleons and back: elastic & charge-exchange scattering. You may write 137000 Feynman diagrams. Coherently, and then goes out, slightly diminished.
The $\bar{K^{0}}$ is different. It may do all of the above, but it also has additional channels: Its s quark may replace a nucleon quark to form a hyperon, Λ or Σ, so it is absorbed and gone. Whatever the hyperon does (decay), it does not return to the original state, so the absorption crudely degrades the $\bar{K^{0}}$ beam more, and increases strangeness, if you must think of it that way. (People would frown, with justice).
The crucial thing is that, since the two components of the $K_L$ wave function were absorbed and phase-shifted differently, many times (coherent scattering), the outgoing wave function is not $\dfrac{1}{\sqrt2}\left( |K^{0}\rangle - |\bar{K^{0}}\rangle \right) $ anymore, but a slightly distorted version thereof. When resolved to free propagation eigenstates, the distortion amounts to a component of $K_S$ now present: $K_S$ has been regenerated after strong interaction with matter.
The standard textbook by D. Perkins should answer any questions you might have.
Comment: Is the 137000 number related to the fine structure constant? :p
Comment: Indeed; the secret handshake of physicists underscoring good-faith communication channels.


Making fun of someone's sexuality in a magazine subscription

Question: What kind of crime is it considered to fill out a magazine subscription for someone else giving them a provocative false name? Addressing it to someone who is very annoying, and happen to be gay. They received the magazine addressed to an insulting fictitious name and the police found out who sent it. Now the receiver wants to press charges for discrimination and harassment.
Comment: In the US, using the mail to harass someone is a federal crime. https://legalbeagle.com/5909952-report-harassing-mail-postmaster-general.html
Answer: Merely sending someone a subscription to a magazine in an inaccurate name isn't inherently a crime. It would typically require a showing of a larger course of conduct amounting to harassment, and an intent to harass.
Discrimination charges would normally require a showing that someone has power to make decisions concerning the recipient, which wouldn't usually be the case and which even if it was the case, would typically be grounds of a lawsuit against the person discriminating, but not a crime.
As a comment notes, harassing someone through the mail is a crime in the United States, although a single inaccurately named subscription would often not, by itself suffice to prove harassment. The line between a legal joke in bad taste, and criminal harassment, can sometimes be subtle and may turn on the intent of the person engaging in the conduct.


Ubuntu not present after install?

Question: I recently got a new laptop (TOSHIBA Satellite C50-B-14D) and just installed a new HDD for it and intended to install Ubuntu 14.04.1 on it. I must have done this about 5 times now, but after inserting my bootable usb and going through the install process and restarting my laptop it comes up with the message "Reboot and select proper boot device or Insert boot Media in selected Boot device and press a key" and when I install it again it says Ubuntu is already there.
Comment: Completely new HD
Comment: Yes. But i also tried manual partitioning but nothing seems to work.
Comment: WD Mainstream 2.5" Internal Hard Drive - 1 TB
I dont think that is the problem though. I've also tried installation on my the old HDD and came up with the same issue.
Comment: I already changed it to CSM boot.
Comment: K - the site is asking us to move to chat, but you don't have enough reputation for that.  I'll delete a few of my prior comments.  The attached link is for a different toshiba, but may be applicable to your problem  http://linuxontoshiba.blogspot.se/2014/05/getting-ubuntu-1404-to-boot-from.html
Answer: Change the boot order in you BIOS settings.
Make sure that the drive you installed Ubuntu on is on top of the list. If it works, you can move the drive further down until it's not working anymore. That way you can see what's causing the problem.
Comment: I cant seem to access my BIOS settings. I've tried F2, ESC+F1 and F8, but nothing seems to work.
Comment: It should say which key to press as soon as you power on the PC. Maybe also try DEL.
Comment: It's F12 and HDD is at the top of the list. And even from booting from HDD i still get the same message.
Answer: I've had this error message before. Toshiba's fail-safe is:
Power off device.
Hold 0 (zero).
While holding 0, power on device.
While holding 0 you can press F2 (or F12) to enter BIOS (or the Boot Menu).

Ubuntu not present after install?


Verb + object + verb

Question: Which one of this two sentences is correct?

I need you to help me do this job
I need you to help me to do this job

Can you also provide me some explanation?
Answer: This is a licensing matter, which is discussed in a little more detail here. Briefly, the types of construction which you may employ in subordinate clauses are determined by the verb which the clause complements: each verb licenses (permits) some types of construction and prohibits others.
In your example, the constructions licensed by the verb need are those with a marked infinitive (to + VERB) :

 I need to help you.
   I need you to help me.
   I need for you to help me. ... BUT NOT
✲I need you help me.

In contrast, the verb help licenses constructions with the bare infinitive:

 Help me do this job.

At one time, help also licensed constructions with the marked infinitive, but this use is less common today, and has an old-fashioned ring.

?Help me to do this job.

It's not exactly wrong, and you should not be disturbed if you encounter it; but I recommend that you restrict yourself to constructions with the unmarked infinitive.
Note that this is entirely different from constructions in which to acts as a preposition rather than an infinitive marker:

 John helped his father to his feet. ... meaning John helped his father rise
   John helped us to London. ... meaning John helped us make our way to London

✲ marks an utterance as unacceptable ? marks an utterance as possibly unacceptable
Answer: Some verbs are commonly followed by an object and the base form of another verb. Verbs are let, make, have, help. Examples:

Please HELP me call people.
Could you HAVE her text me?

Some verbs are commonly followed by an object and an infinitive. Verbs are invite, ask, tell, remind. Examples:

Could you REMIND them to come early?
I INVITED you to come.

Verb + object + verb