Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{Mg^2+}$) be closer in radius to $\ce{Li+}$ than its isoelectronic neighbor ($\ce{Be^2+}$) with just one extra proton?
Tuesday, November 27, 2018
organic chemistry - How to change CO₂ to a less polluting gas?
I want to change $\ce{CO2}$ coming out of the tailpipe of a car to some other compound that is considerably less harmful to the environment with a filter of some sort.
What are some ways that this is possible?
$\ce{CO2}$ to carbon and oxygen?
Sunday, November 25, 2018
organic chemistry - How would substitution reaction results differ between reacting halides with a tertiary bromoalkane vs reacting it with a primary bromoalkane?
Say, you conducted two separate reactions; in one, you combined $\mathrm{50~mmol}$ saturated $\ce{KCl}$ solution with $\mathrm{10~mmol}$ 1-bromooctane (assume heating), and in the other you combined $\mathrm{10~mmol}$ saturated $\ce{KI}$ solution with $\mathrm{10~mmol}$ 1-bromoctane. In both cases $\mathrm{0.5~mmol}$ hexadecyltributylphosphonium bromide was used as a catalyst.
So, due to relative charge densities and the fact that the electrophillic carbon is primary, you would have a low yield of 1-chloroocatane vs starting material in reaction 1 and you would have a high yield of 1-iodooctane vs starting material in reaction 2, both cases obtained via SN2 reaction.
Now, suppose you would have repeated the same two reactions, only this time you would have reacted the $\ce{KCl}$ and $\ce{KI}$ with 2-bromo, 2-methyloctane, how exactly would the results differ from the results of the previous two reactions, or would they have been the same?
I know that the reaction would have no "choice" but to react via the SN1 (or perhaps E1) route, as the electrophillic carbon is tertiary and thus very sterically hindered. Also, I know that $\ce{I-}$ ions are good nucleophiles, but that doesn't matter in this case, does it?
Perhaps this reaction would go slower than the previous, owing to the fact that it requires the $\ce{Br-}$ to dissociate, and therefore there would be lower yields of both haloalkane products. But then again, wouldn't it go faster owing to the fact that it is in a polar protic solvent, and that the formed carbocation would be tertiary?
filters - Is up-sampling prior to cross-correlation useless?
Consider a simple case where two signals from two different sensors are cross-correlated, and the time-delay-of-arrival computed from the absissa of the peak of their cross-correlation function.
Now let us further assume that due to the dimensionality constraints of both antennas and the constraints on maximum possible sampling rate, the maximum attainable delay possible is $D$, corresponding to 10 samples.
The problem:
Because of those constraints, your computed delay may vary from any integer value between 0 and 10 samples, that is: $0 \le D \le 10$. This is problematic because what I really want is fractional-delay discrimination of the delay between the two signals impinging on my antennas, and changing the dimensions or the sampling rate are not an option.
Some thoughts:
Naturally, the first thing I think of for this case is upsampling the signals before performing a cross-correlation. However I think this is 'cheating' somehow, because I am not really adding any new information into the system.
I do not understand how upsampling is not 'cheating' in a sense. Yes, we are reconstructing our signal based on its currently observed frequency information, but how does this give one knowledge of where a signal truly started between, say, $D=7$ and $D=8$? Where was this information contained in the original signal that determined that the true fractional-delay start of the signal was actually at $D=7.751$?
The question(s):
Is this truly 'cheating'?
- If not, then where is this new 'information' coming from?
- If yes, then what other options are available for estimating fractional-delay times?
I am aware of upsampling the result of the cross-correlation, in an attempt to garner sub-sample answers to the delay, but is this too not also a form of 'cheating'? Why is it different from upsampling prior to the cross-correlation?
If indeed it is the case that the upsampling is not 'cheating', then why would we ever need to increase our sampling rate? (Isnt having a higher sampling rate always better in a sense than interpolating a low sampled signal?)
It would seem then that we could just sample at a very low rate and interpolate as much as we want. Would this then not make increasing the sample rate 'useless' in light of simply interpolating a signal to our heart's desire? I realize that interpolation takes computational time and simply starting with a higher sample rate would not, but is that then the only reason?
Thanks.
Answer
It's not cheating, and it's also not adding any new information. What you are doing is the same thing that any upsampling LPF is doing- adding zeros and then reconstructing the waveform with the already known frequency information. Thus, there is no new information, but there is still finer time resolution.
Upsampling the result is similar- no new information but finer time resolution. You can do something very similar through quadratic interpolation.
All of these methods- upsampling and polynomial interpolation- get their information on where the fractional peak is from both the peak itself and its neighbors. A quick pictorial example. 
The blue line in the picture above is my simulated cross-correlation data (though it could be any result, not just a cross-correlation). It is what I call a "balanced" peak because the neighbors are symmetric. As you might expect, the resulting quadratic interpolation (red line) indicates that the true peak is at zero.
The image below, on the other hand, shows an unbalanced peak. Please note that nothing has changed in the result except for the values of the two nearest neighbors. This causes the interpolator, though, to shift its estimate of the fractional peak. 
A nifty side benefit of these methods (polynomial interpolation and upsampling) is that it also gives you an estimate of the true peak value, though we are usually more interested in the location.
If indeed it is the case that the upsampling is not 'cheating', then why would we ever need to increase our sampling rate?
To satisfy the Nyquist criterion.
Isn't having a higher sampling rate always better in a sense than interpolating a low sampled signal?
No. From a theoretical standpoint, as long as the Nyquist criterion is satisfied it doesn't matter what the sample rate is. From a practical standpoint you generally go with as low a sample rate as you can get away with to reduce the storage requirements and computational load, which in turn reduces the resources that are needed and power consumption.
adaptive algorithms - Kalman filter in practice
I have read the description of the Kalman filter, but I am not clear on how it comes together in practice. It appears to be primarily targeted at mechanical or electrical systems since it wants linear state transitions and that it is not useful for anomaly detection or locating state transitions for the same reason (it wants linear state transitions), is that correct? In practice, how does one typically find the components that are expected to be known in advance to use a Kalman filter. I have listed the components, please correct me if my understanding of what needs to be known in advance is incorrect.
I believe these do not need to be known "in advance":
- Process noise $\mathbf w$
- Observation noise $\mathbf v$
- Actual state $\mathbf x$ (this is what the Kalman filter tries to estimate)
I believe these need to be known "in advance" to use a Kalman filter:
- The linear state transition model which we apply to $\mathbf x$ (we need to know this in advance, so our states must be governed by known laws, i.e. the Kalman filter is useful for correcting measurements when the transition from one state to another is well understood and deterministic up to a bit of noise - it is not an anomaly finder or a tool to find random state changes)
- Control vector $\mathbf u$
- Control input model which is applied to control vector $\mathbf u$ (we need to know this in advance, so to use a Kalman filter we also need to know in advance how our controls values affect the model, up to at most some gaussian noise, and the effect needs to be linear)
- Covariance $\mathbf Q$ of the process noise (which appears to be time dependent in the wikipedia article, i.e. it depends on the time $k$) - it appears we need to know this in advance and over time, I assume in practice it is taken as being constant?
- A (linear) observation model $\mathbf H$
- Covariance $\mathbf R$ (which appears to also be time dependent in the wikipedia article) - similar issues to $\mathbf Q$
P.S. And yes I know many of these depend on time, I just dropped all the subscript clutter. Feel free to imagine small letter $k$ to the right and down from each variable name if you would like to.
Answer
For some context, let's go back to the Kalman Filter equations:
$\mathbf{x}(k+1) = \mathbf{F}(k) \mathbf{x}(k) + \mathbf{G}(k) \mathbf{u}(k) + \mathbf{w}(k) \\ \mathbf{z}(k) = \mathbf{H}(k) \mathbf{x}(k) + \mathbf{v}(k)$.
In short, for a plain vanilla KF:
$\mathbf{F}(k)$ must be fully defined. This comes straight from the differential equations of the system. If not, you have a dual estimation problem (i.e. estimate both the state and the system model). If you don't have differential equations of the system, then a KF isn't for you!
$\mathbf{x}(k)$ is, by definition, unknowable. After all, if you knew it, it wouldn't be an estimation problem!
The control vector $\mathbf{u}(k)$ must be fully defined. Without additional system modelling, the only uncertainty on the control vector may be AWGN, which may be incorporated into the process noise. Known matrix $\mathbf{G}(k)$ relates the control input to the states - for example, how aileron movement affects the roll of an aircraft. This is mathematically modelled as part of the KF development.
The system process noise $\mathbf{w}(k)$ is also, by definition, unknowable (since it is random noise!). However, the statistics of the noise must be known which, for a plain vanilla KF, must be zero mean AWGN with known covariance $\mathbf{Q}(k)$. Sometimes, the covariance of the noise may change between samples, but in many cases it is fixed and therefore $\mathbf{Q}$ is a constant. In some instances, this will be known, but in many instances, this will be "tuned" during system development.
Observations are a similar story. The matrix that relates your measurements to the states $\mathbf{H}(k)$ must be fully defined. Your measurements $\mathbf{z}(k)$ are also known because that's the reading from your sensors!
The sensor measurements, however, are corrupted by AWGN $\mathbf{v}(k)$, which, being random noise, is by definition unknown. The statistics of the noise must be known, which is zero mean with covariance $\mathbf{R}(k)$. Once again, the covariance may change with time, but for many applications, it is a fixed value. Often, your sensors will have known noise characteristics from the datasheet. Otherwise, it's not too hard to determine the mean and variance of your sensors that you need to use. Yes, this can also be "tuned" empirically.
There are a huge number of "tricks" that can be done to work around the restrictions in a plain vanilla KF, but these are far beyond the scope of this question.
Afterthought:
Whilst googling for "Kalman Filter" results in a million hits, there are a couple of things that I think are worth looking at. The wikipedia page is a too cluttered to learn from effectively :(
On AVR Freaks, there is an "equation free" intro to the Kalman Filter that I wrote some time ago to try to introduce where it is used for real.
If you're not afraid of maths, there are several books worth reading that are at the senior undergraduate/early postgraduate level. Try either Brown and Hwang which includes all the theory and plenty of example systems. The other that comes highly recommended but I have not read is Gelb, which has the distinct advantage of being cheap!
Saturday, November 24, 2018
homework - Help balancing reaction between Iron (II) chloride and potassium phosphate
Very rusty with chemistry and looking to review some basics. Came across the following:
Iron(II) chloride and potassium phosphate react. Write and balance the molecular, ionic, and net ionic equations.
What I have so far (guessing, basically):
$$\ce{FeCl2 + K(H2PO4) -> KCl + Fe(H2PO4)2}$$ [still need to balance but correct right hand side?]
I can't remember the exact rules for forming the right hand side. I just put this in place to match ion charges. What prevents me from writing the right hand side as something else entirely (not sure what but I'm asking, "well, couldn't I figure something out if I break everything apart and re-arrange into another option?").
EDIT: Additional Question Below
Ok, so assume the above reaction was balanced (it's not) and valid. Then, my question is does the reaction go both ways ($\ce{<-->}$)? If so, when/why/how? I'm trying to think back many years ago and it has something to do with "reactivity" and the row of the elements on the periodic table, correct? I'm going to look into it more myself but if someone has a quick "30 second" answer I'm sure it'd be of help to me!
[Assuming this is OK and valid in the forward direction. Again, needs to be balanced.]
$$\ce{FeCl2 + K(H2PO4) -> KCl + Fe(H2PO4)2}$$
[Is this ever ok/possible?]
$$\ce{KCl + Fe(H2PO4)2 -> FeCl2 + K(H2PO4)}$$
halacha - Being exposed to Christmas music
I understand that for many people, this is almost impossible to do - as long as you go shopping anywhere outside a Jewish neighborhood, or if you turn on the television, you will be exposed to Christmas music. Similarly, if you work in an office and someone puts on the easy listening station for people to listen to, you will be exposed to a LOT of Christmas music.
Assuming you're able to avoid actively seeking out such music (for example, not shopping at Macy's Department Store during this time of the year), are there any other halachic things a person should be aware of if there is the potential for being exposed to Christmas music? For example, are we enjoined not to watch a television show if there is the possibility of some Christmas music being featured?
halacha - Guitar during public weekday prayers
Is anyone aware of any halakhic opinion regarding the playing of musical instruments, guitar for example, in shul on a weekday, not shabbo. Does it have the same religious stigma and opposition as having an organ in shul did at the beginning of the reform movement? Is it still seen as a move towards the practices of other religions?
bayesian estimation - Kalman Filter Covariance
I've recently started playing with the Kalman filter for a simple 2D (x,y,dx,dy) tracking toy problem. But I seem to have some misunderstanding on what I can expect from the filter. I'm interested in plotting the uncertainty ellipse from the corrected covariance matrix but noticed a few observations:
The covariance decreases to a steady state regardless of how much error I introduce into the measurement.
The variance for x and y are exactly the same even though I introduce more measurement errors in y.
Staring at the maths for a bit it seems that this is how the vanilla Kalman Filter works. What I'm expecting is the opposite of the two points mentioned above. In the end I want to plot an uncertainty ellipse that reflects the error I'm observing. Is this possible at all? Do I have to do some post processing on the covariance matrix?
ANSWER:
It occurred to me what I needed was a Kalman Filter that has the ability to adapt its covariance. I found this paper that details a few different methods to do this.
http://www.gmat.unsw.edu.au/snap/publications/almagbile_etal2010a.pdf
acid base - Why does potassium react the most vigorously with water?
Which metal reacts most vigorously with water?
(A) Ca (B) K (C) Mg (D) Na
The given answer is B and the reasoning is that is is the most electropositive since it the furthest left and down according to periodic trends.
However, isn't $\ce{K}$ the conjugate acid from a strong base -- $\ce{KOH}$? So isn't the conjugate base of a strong acid quite weak? So why would $\ce{K}$ react strongly?
Answer
I might be wrong here, but I believe that the question asks about the metals in their atomic (non ionic) form.
In order for a $\ce{KOH}$ bond to form, the K must be ionized (since the $\ce{KOH}$ bond is ionic). This means that when $\ce{KOH}$ dissolves in water it'll form the $\ce{K}^+$ electrolyte, which is not the same thing as a pure $\ce{K}$ atom with its 19th electron.
A $\ce{K}$ atom, then, since it's the most electropositive of that list, is the one to react "more vigorously" (which I guess it refers to more speed/energy) with water (a polar molecule).
I hope this helped you. I'm sorry if I'm wrong!
physical chemistry - Is activation energy temperature-independent?
I know that activation energy for a reaction is the extra energy given to the reactants to reach the threshold energy so that they can collide and react. But then, why is it said that the activation energy does not depend on the temperature?
If the temperature is higher, the reactant molecules have a higher kinetic energy, and thus the energy difference between the threshold energy and the energy of the molecules will decrease, that is, the activation energy will decrease.
Answer
There is a simple (some might say simplistic) way to get an intuition about this and it involves thinking at the molecular or atomic level rather than about the bulk properties of the reaction (the thermodynamic view).
For a simple reaction where molecule A has to bang into molecule B to create molecule C, the reaction will only happen if the amount of energy involved in the collision is large enough. The amount of energy involved depends on the nature of the reaction which is determined by the electronic structures of A and B. Within limits, those electronic structures don't vary with temperature and a given reaction will only occur when there is enough energy in the collision for the reaction to happen.
What changes with temperature isn't the energy required for the reaction to occur, it is the number of molecules that have enough energy to overcome the barrier. At higher temperatures more molecules have that energy, but the amount of energy required doesn't change. The amount of energy require to initiate the reaction is roughly equivalent to the activation energy. It can be calculated by looking at the way the overall rate of the reaction changes with temperature. So the rate of reaction changes with temperature but not the barrier to the reaction happening.
This view is a little simplified but it gives the right intuition about the problem.
Friday, November 23, 2018
Which bodily fluids are kosher?
The only secretion from the human body that I know to be kosher is human milk. I am curious to know which other bodily fluids are kosher.
For example, is it kosher to drink sweat or tears? What about mucus?
Assume that a person has only eaten pareve kosher food, and later vomits it out. Is this vomit kosher?
There's at least a dozen other related questions that come to mind, but I'll stop here to avoid being gratuitously gross. In general, which bodily fluids are kosher and which ones are not?
slang - Is being called an オタク derogatory?
This question spawns from the comments here.
I've heard that オタク could or could not be derogatory. During the times I've been in Japan and heard it used, I didn't think that it had any connotation of being an insulting term, but is this true?
I'm not sure about other countries, but in America as a borrowed word, many people are proud to be called an "オタク" depending on the circumstance. Is it not the same in Japan?
publications - Are magazine subscriptions ribbis?
There are many Jewish weekly or monthly publications (e.g. magazines) that offer the following deal:
Individual copies of the magazine are priced at say, $5 each. But, if you "subscribe" by paying in advance for the entire year, you get a discounted price which comes out to say, $3 each week.
It seems that this is a classic case of ribbis in the form of poskin al hapeiros we find in Bava Metzia. The only way out of it is either (1) the product has had a price setting in the form of yatza hashaar, which I do not think applies to most commercial products these days, or (2) the publisher already has the copies of all the magazines you are buying (yesh lo), which is clearly not the case here.
How are the publishers of these Jewsih publications and their subscribers not violating the prohibition of ribbis?
Answer
This issue is discussed here.
Summary: Magazine subscriptions to Jewish-owned publications are forbidden only where the discount is explicitly or obviously linked to the advance payment. In this case, the discount is usually linked to other factors, so most poskim permit it.
A little research online shows that the primary reasons that magazine publishers offer discounted (often severely discounted) prices for subscription is to raise advertising revenue (as advertisers pay more to be featured in magazines with more subscribers), and to be guaranteed the purchase for the whole year. This would then be permitted for Jewish publications.
However, if the subscription discount is advertised in a way that highlights the fact that the discount is for advance payment (e.g. "Subscription price is contingent on prepayment in full," or, "Pay for a year and save 45%") this would be problematic.
In the discussion here (note 43) though, an interesting problem is brought up:
If the price of the periodical increases during the subscription period, the subscribers could not be indemnified from the increase. In this case, a new subscriber who joins after the price increase is charged a higher price than the person who subscribed earlier. All of the outside motivations...apply to both subscribers. The only reason that those who subscribed earlier are protected from the increase is because they advanced funds at an earlier time. This benefit is prohibited.
The practical solution given there is that the publisher should offer the subscriber the option of paying the publisher itself or to place the money in escrow to be withdrawn by the publisher at the appropriate time. This eliminates the possibility that the discount is motivated by the advance payment. [It is also recommended that a heter iska klali be used.]
purim torah in jest - Can a person increase in joy before Adar?
It is written:
משנכנס אדר מרבין בשמחה (When Adar comes we increase in joy)
If a person started to get happy on Tu b'Shevat instead, is this permissible b'dieved (after the fact)? What if someone had an intention beforehand to increase joy before Adar and carried it out, for example, they told Purim Torah (offline) in Shevat?
history - Diaspora of Egypt: has it already happened?
I have read in Ezechiel 29:12-15 that
"And I will make the land of Egypt desolate in the midst of the countries that are desolate, and her cities among the cities that are laid waste shall be desolate forty years; and I will scatter the Egyptians among the nations, and will disperse them through the countries. Yet thus saith the Lord GOD: At the end of forty years will I gather the Egyptians from the peoples whither they were scattered; and I will turn the captivity of Egypt, and will cause them to return into the land of Pathros, into the land of their origin; and they shall be there a lowly kingdom. It shall be the lowliest of the kingdoms; neither shall it any more lift itself up above the nations; and I will diminish them, that they shall no more rule over the nations."
Has this prophecy already been fulfilled? If yes, when and how?
Answer
According to Abarbanel, the several prophecies in Chapters 29-32 of Ezekiel are all concerning the future of Egypt (the future from Ezekiel's perspective), but they will not all happen at the same time. The first prophecies were realized during the reign of Nebuchadnezzar and his conquering Egypt, and the later prophecies will be realized before the coming of the Messiah.
The verses you quoted are from the first prophesy about Egypt, and thus Abarbanel interprets them as referring to when Nebuchadnezzar conquered Egypt, which is more clearly related in the subsequent (but connected) prophesy (29:19).
Nebuchadnezzar conquered Egypt and exiled its inhabitants such that they were "scattered among the nations" and Egypt "laid waste and was desolate" for 40 years. The calculation of 40 years is: 18 remaining years of Nebuchadnezzar's reign + 22 years of his son's reign.
After that began Belshazzar's reign, at the beginning of which Daniel's prophesy occurred, and then the Egyptians began to return to their homeland, fulfilling verse 13. However, the "new Egypt" was never again as powerful as it was originally, warranting a description as a "lowly kingdom" in verse 14, and even as "the lowliest of the kingdoms" in verse 15.
word requests - What does it mean to end a sentence with ひとつだけ?
I came across a sentence that ends with ひとつだけ in a book and searching on jisho gave me zero results (https://jisho.org/search/ひとつだけ); nor did searching for the individual parsing of what I remember from the audio of the VN (i.e. hitotsu--DakE) give me any helpful results that would make sense in context.
しかも、出入り口は錆の浮いた鉄扉がひとつだけ。
TDLR: What does the sentence end(?) ひとつだけ mean in the above context and does it have a general meaning when used at the end of a sentence as opposed to being used elsewhere in the sentence?
Edit:
Context: Narrator is describing a unfamiliar room he wakes up in. I think that ひとつだけ in the above context will not work as individual parsings as ひとつ most likely means either the "adverbial noun – just" or the numeric one in the above context that adverbially/numerically describes the 鉄扉 (iron door). The next bit, だけ most likely is a particle ("only") but I don't see how the "only" can affect the 鉄扉 as the ひとつ is already doing that to the "iron door". The only way I can see both affecting 鉄扉 is if ひとつだけ is a qualifier sentence (technically a qualifier phrase) being used in reverse-order.
word choice - What's the difference between 最後 and 最終?
While reviewing my 漢字, I noticed that for "last", I have (at least) two words, either 最後{さいご} or 最終{さいしゅう}. I was wondering, is there any difference in usage, or can I use them equivalently?
Answer
最: most; extreme
後: later; latter
終: end
最後 is used as a noun or a の-adjective. (e.g. 列の最後, 最後の晩餐) In the form of Verb+が/たら+最後, it means once (e.g. 彼は外に出たが最後... Once he goes out...)
最終 is used as an adjective right before noun. (e.g. 最終列車, 最終的)
When they are adjectives, they are usually interchangeable. (e.g. 最後のバス is interchangeable with 最終バス)
However, while 最終 means to just happen after all other things, 最後 often implies that it is the end of things and that it will never happen again. For example, 最終試合 is just a last game of championships on which someone will be a champion; 最後の試合 is the final game for someone.
bo - How isolated was Israel in Goshen?
We know that Israel was still in Goshen during their enslavement, because the text tells us that the plague of hail didn't affect Goshen "where b'nai Yisrael were" (Shemot 9:26). It sounds like they are still living apart from the Egyptians, else some Egyptians would have been spared by the hail (if they lived in Goshen too) or some of Israel would have been affected (if they lived outside of Goshen).
Right before the exodus, God instructs the people to borrow silver and gold from their neighbors (Shemot 11:1-3). "Neighbors" sounds like people who live nearby. In chapter 12 the Egyptians urge them to leave quickly, and that's when the borrowing occurs.
How isolated or how intermingled were Israel and the Egyptians at the time of the exodus? Did Israel have Egyptian neighbors, or did they actually borrow silver and gold from random Egyptians they encountered on the way out that night?
periodic trends - Comparing radii in lithium, beryllium, magnesium, aluminium and sodium ions
Apparently the of last four, $\ce{Mg^2+}$ is closest in radius to $\ce{Li+}$. Is this true, and if so, why would a whole larger shell ($\ce{...
-
I've been reading bits and pieces online but I just can't piece it all together. I have some background knowledge of signals / DSP s...
-
彼ならそれくらいの事はいいかねない Translation: He can say such things. I don’t understand what this なら is added to 彼. I’ve seen it more than once too. Answ...
-
Genesis 2:7 And the Lord G-d formed man of the dust of the ground vs. :19 And out of the ground the Lord G-d formed every beast of the ...
-
Answers to Decrease in temperature of a aqueous salt solution decreases conductivity indicate that the electrical conductivity of salt solu...
