Monday 29 February 2016

fft - Is possible to compare to audio samples with cross-correlation



Is it possible to compare two audio samples(meaning find word from one in another) realtime with cross-correlation?




shabbat - Talking on the phone when it's shabbos for the other person



I am not religious, but I have relatives who are. I live in the US and some of my relatives live in Israel. Can they talk to me when it is after shabbos in Israel, but it's still shabbos in the US?


They would not be causing me to violate shabbos, I never keep it anyways. I really want to talk to them, and it's hard to find a time to do so because of the time difference.


Thanks!




talmud gemara - Why not "Where is Achashverosh in the Torah"?


In Chullin 139b, the Gemara asks about hints in the Torah for several of the figures in the Megillah, and provides answers:



"Where is {Haman, Esther, Mordechai} hinted at in the Torah?" (המן\אסתר\מרדכי מן התורה מנין?‏)



Why doesn't it ask about Achashverosh as well? He's certainly as major a character in the story as any of them. (And in fact, while by name he's mentioned only about half as many times as each of them - 29, as compared to 50+ for each of the other three - his title המלך appears by itself some 160 times.)



Answer



I see where Maharsha explains this Gemara in a way that apparently answers the question indirectly.



He says that each of the four personages mentioned in the Gemara there (it starts with Moshe) is known by other names as well. Moshe had a bunch; the others are also called, respectively, Memuchan, Hadassah and Pesachyah. Furthermore, the common names for all four of them come from other languages: Moshe from Egyptian, the other three from Persian (whereas the secondary names are all Hebrew).


So the point of the question, he says, is: from where do we see that these foreign names are truly significant from the Torah's point of view? And so for each one, the verse that the Gemara cites indicates an underlying connection between their accomplishments (or, in Haman's case, his character flaws) and common name.


Which, then, presumably answers the question why Achashverosh isn't listed: there aren't any other names for him in the Megillah.


minhag - Covering eyes when saying Shema Yisrael


When saying Kriyas Shema many have the custom of covering their eyes when saying Shema Yisrael. What is the reason this is done?




grammar - Grammatically correct but good writing?


The following sentence comes from 中上級の日本語 magazine for february:



新聞記事は、記者がコツコツと取材をしてデータを集め、それをもとに出来事を調べたり、関係者の話を聞いたりして書かれています。




It is grammatically correct but I find the change from active to passive voice, ie from extensively describing journalists' activities in the active voice to connecting those activities to the topic of newspaper articles in the passive, quite jarring.


Is this just because I am not a native speaker, who would find this quite natural, or is it just not very good writing? (Given that this is a magazine for students of Japanese you would not expect bad writing in the explanatory passages by the magazine's staff.)



Answer



Having read it several times, I could only say that that is good writing. It contains no errors, ambiguity or unnaturalness; therefore, it would not cause any misunderstanding among the readers.


Mixing active voice with passive voice in a sentence is nothing new in English, is it? Consider the following sentence.



"Tofu is made by coagulating soy milk and then pressing to remove the liquid. "



I find the structure of this English sentence similar to that of the Japanese sentence in question. Only, the passive voice verb phrase "is made" (「書かれています」 in the Japanese) will come at the end of the sentence in the Japanese.



fourier transform - Complex conjugate and IFFT


I asked a question over on stack overflow.


I'm having a slight problem however. As suggested by Paul R I am mirroring my lower $n/2$ bins into the upper $n/2$ bins.


I have a few questions however.



  • I'm assuming $n$ is $2^{fftOrder}$? Thus for an order 10 IFFT I would be mirroring the bottom 512 frequency bins in to the top 512? This would also produce me 1024 real samples in the end?

  • When mirroring does this mean that bin 0 would go to bin $n - 1$, bin 1 to bin $n - 2$ and so on?

  • I appear to be getting some form of reflection at a quarter of my sampling frequency? This means that the top half of my frequency range is actually appearing over the bottom half. Has anyone any ideas why?

  • Does anyone have any idea why I am getting a striping effect where I get 512 samples of one magnitude and the next 512 of a different? (This "could" be where my mirroring is coming from)



I think thats it for now. Any help would be hugely helpful!!


Edit: Giving you an image of the reflection will be near enough impossible as its very hard to see! Basically I'm sampling at 22 kHz and getting nothing but "noise" above 11 kHz. What "ought" (though obviously I'm doing something wrong) to be above 11 kHz seems to get reflected down from 11 kHz to 0. Its very odd.


As for the image of the stripes they can be seen here


Each stripe, I believe, is 512 samples wide.



Answer



I'm not sure what you're getting at with "reflection" or "striping," but you want to duplicate your data points such that the frequency-domain signal (the input to the IFFT) is conjugate symmetric. That means, for $N$ even:


$$ X[k] = X^*[N-k], k = 1, 2, \ldots, \frac{N}{2}-1 $$


Note that $k$ is zero-based; the first element in the vector is $X[0]$. The above indicates that you do not duplicate the zeroth and $\frac{N}{2}$-th elements in the input vector. This relationship is based on the periodicity of the discrete Fourier transform; the first half of the frequency-domain vector corresponds to "positive" frequencies covering the angular frequency range from $0$ to $\frac{(N-1)\pi}{N}$. The second half covers from $\pi$ to $\frac{(N-1)2\pi}{N}$, which, taking advantage of the $2\pi$ periodicity in the frequency domain, is equivalent to $-\pi$ to $\frac{-2\pi}{N}$. In order for the frequency-domain vector to have conjugate symmetry, then it can be easily shown that the above relationship must be true.


Speaking to your original goal of converting a spectrogram into an audio signal that sounds meaningful, there's no guarantee that what you get out will be in any way pleasing. As was pointed out on Stack Overflow, the spectrogram has no phase information; the method suggested there assumes the phase of each frequency-domain bin is zero (so the conjugate operation shown above is superfluous). While the human ear isn't terribly sensitive to phase distortion in audio, you might have to do something else depending upon exactly what you're hoping to achieve.


thermodynamics - How to measure quantities at standard state when this state is a hypothetical one?


Consider the reaction


$$\ce{A(g) + H2O(l) <=> B(aq) + C(g)}$$



If all gases and solutions were ideal, the standard state would be pure water, the solute B at a concentration of 1 M, the gases A and C each at a pressure of 1 bar, and the system at a pressure of 1 bar.


For non-ideal gases and solutions, it would be the hypothetical state where all the activities are 1 (i.e. equal to the activity of an ideal gas at 1 bar, activity of a solvent with infinitely diluted solutes, and equal to the activity of a solute behaving ideally at a concentration of 1 M).


This hypothetical state can be quite different from a real state. How can the pressure be 1 bar while two gases are at a partial pressure of 1 bar each? What if the solute B is barely soluble, how do you get an activity of 1? How can you have pure water when it is acting as a solvent?


So how to you measure quantities like $\Delta_\mathrm{r} G^\circ$ when the standard state is a hypothetical one?



Answer



The standard states are limiting states. In these limits you can write the chemical potential of the component as


$\mu = \mu^\circ+RT\log(x)$


where $x$ is a measure of the concentration of solute (for Henry's law, where the standard state is a hypothetical state related to the behavior as $x \rightarrow 0$) or solvent (for Raoult's law, where the standard state is approached as $x \rightarrow 1$). In other words, in the limiting states the activity goes to 1. The meaning of $\mu^\circ$ depends on the limiting law (hypothetical with properties of an infinitely dilute solution or pure solvent).


A standard state can be hypothetical (as may happen when Henry's law is invoked), but it can also be real (as in Raoult's law, for a pure solvent). It is a state in which the sample behaves ideally as defined by the above equation, in the limit of infinite dilution or of a pure solvent. This limiting behavior provides a convenient and predictable reference, like setting the potential energy to zero when particles are separated by an infinite distance. In the case of Raoult's law, the standard state is the (not particularly mysterious) pure substance. In the case of Henry's law, the reference state is found by extrapolating behaviour at infinite dilution to the standard concentration (1 molal or 1 M, conventionally). This may be a hypothetical state.


Using reference standard states (at 1 bar of course) can simplify combining or comparing data for different substances or conditions. Of course when considering real solutions, activities may diverge from concentrations and activity coefficients deviate from unity.



For a mixture of substances, for each component you can describe individual thermodynamic properties relative to the ideal standard states. By ideal it is also meant that individual solutes do not interact.


electrons - Sulfur trioxide - vacant d-orbitals


Sulfur trioxide violates the octet rule. Upon drawing the Lewis dot structure for sulfur trioxide, we see that the central sulfur atom is bonded to three other oxygen atoms by double covalent bonds. Therefore, sulfur is in fact surrouded by 12 electrons and not 8 as per the octet rule. This is explained by the fact that the excited state of sulfur has the following electronic configuration: $1s^22s^22p^63s^13p^34s^03d^2$. As there are 3 oxygen atoms, $sp^2$ hybridised orbitals take part in single $\sigma$ covalent bonds with the unpaired $p_y$ orbitals of the oxygen atoms. In sulfur, there still exist one unpaired $p$ orbital and 2 unpaired $d$ orbitals. These remaining unpaired orbitals take part in $\pi$ covalent bonds with the unpaired $p_z$ orbitals of the oxygen atoms. My question is, why do the electrons in sulfur from the $3s$ and $3p$ orbitals in the ground state promote themselves to the $d$ orbitals rather than one electron going into the intermediate $4s$ orbital and the next electron going into the first $3d$ orbital? After all, according to the Aufbau Principle, $4s$ is less energetic when compared to $3d$.




purim torah in jest - Which side was the Llama of Yetziat Mitzrayim on?



I am wondering about the role of the Llama in Yetziat Mitzrayim.


Shmot 5:4:



ויאמר אליהם, מלך מצרים, למה משה ואהרון, תפריעו את-העם ממעשיו לכו, לסבלותיכם


And the King of Egypt said to them: Llama, Moshe, and Aharon, you are disrupting the people from their work! Go to your burdens.




This paints a picture of the Llama as an ally of Bnei Yisrael. However, after Bnei Yisrael's workload is harshened, Pasuk 15 states:



ויבאו, שטרי בני ישראל, ויצעקו אל-פרעה, לאמר: למה תעשה כה, לעבדיך


And the (Israelite) officers of Bnei Yisrael came, and they cried out to Pharaoh saying: "A Llama has done this to your servants!"



How are we to solve this contradiction? Was the Llama Pro-Bnei Yisrael, or Pro-Pharaoh?




As a side point, the Pasuk (Shmot 32:11) seems to imply that the Llama somehow poisoned Moshe:



ויחל משה... ויאמר למה



And Moshe fell sick... and he said, "(It was the) Llama!"





This question is Purim Torah and is not intended to be taken completely seriously. See the Purim Torah policy.



Answer



There seems to be a misunderstanding here -- The word is not "llama" but "Lama"(with only one lamed), short for Deli Lama, the pastrami, corned beef, and beef tongue King. Once this is understood, the quotes are all easily explained:


Shemot 5:4 - Of course there was a work disruption. The sight and smell of the cooking meat, and Moshe and Aharon helping the Lama distribute the sandwich platters led to long lunches, and all that meat made the Israelites ready for a good nap, instead of working.


Shemot 5:15 - Of course Pharoah and the taskmasters figured that with such a protein-heavy diet, provided by the Lama, they could therefore work harder and longer.


Shemot 32:9 - Moshe was not poisoned - since he was (per Bamidbar 12:3)very meek/humble, he just couldn't take the chance of offending the Lama by leaving leftovers on his plate when he made Moshe a special triple decker pastrami, corned beef, and tongue sandwich. He "couldn't believe he ate the whole thing", and Alka-Seltzer wasn't available then, so the indigestion from eating all that meat nearly paralyzed him, causing him to cry out "It was the Lama" when they tried to rouse him to action.


I hope this clears things up - he was definitely on the Israelites' side, providing noshes as necessary during those tough days in Mitzraim..



filters - Matlab `filtfilt` provides excessive transient


I observed that filtfilt suffers from an undesired behavior when I provide IIR bandpass filters having steep transition bands. Specifically, the output signal exhibits excessive transient response; nevertheless, this behaviour does not emerge if I use a 'home-made' version of zero phase filtering based on filter. I guess that it is not a numerical issue involving the filter coefficients or structure, nor the filter function.


% design bandpass filter having transition bandwidth of 200 Hz (Fs = 8000)
bp = designfilt('bandpassiir', 'StopbandFrequency1', 50, 'PassbandFrequency1', 250,...
'PassbandFrequency2', 3600, 'StopbandFrequency2', 3800, 'StopbandAttenuation1', 30,...

'PassbandRipple', 0.1, 'StopbandAttenuation2', 30, 'SampleRate', 8000, 'DesignMethod', 'cheby2');
% check stability
assert(isstable(bp),'Unstable filter');
% apply filtfilt to a random (white) long input signal; output signal shows an undesirable transient
x = randn(2^20,1);
y = filtfilt(bp,x);
% apply 'home-made' filtfilt to the same input; output signal shows a more acceptable transient
y2 = flipud(filter(bp,flipud(filter(bp,x))));
% compare effects
figure; semilogy(abs(y-y2));


As a rule of thumb, the effect grows as the transition bands get narrower, while it tends to vanish as they get broader.


Where is the problem? Have I missed some recommendations or hints in the function's help?




Sunday 28 February 2016

gas laws - Volume of gas in containers


If gases occupy all the volume in a container then how can we define 'volume percent' as all different gases will have same volume?




maseches kesubos - Nowadays, do we write "besulah" & "200 zuz" in the ketubah for every woman's first marriage?


I remember once hearing that even though the mishnah & gemara in Maseches Ketubah state that a besulah/ virgin maiden gets 200 zuz for a ketubah (and a a be'ulah/non-virgin maiden gets 100 zuz)-- nevertheless so as not to embarrass the bride (ie if she were a ba'al teshuva etc),
the practice nowadays for a first marriage is to write 200 zuz in every ketubah.


Is this true/ source?




enthalpy - Why is heating increasing the solubility of sodium hydroxide?


\begin{align} \ce{NaOH &-> Na+ + OH-} & \Delta H^\circ &= \pu{-44.51 kJ/mol} \end{align}


The dissolution of sodium hydroxide in water is an exothermic process, and so, according to Le Chatelier’s principle, cooling the container should shift the reaction to the right. Shouldn’t this mean that cooling the container will increase the solubility?


According to a solubility chart for sodium hydroxide, heating the container will increase the solubility; why is this the case?



Answer



The question to the Newton - Ask a Scientist program by Danna C Griffiths (to be found via the Internet Archive) has an answer for it.


What I understood from the explanation on that site:


Solubility is defined as the concentration of the solute in a saturated solution. So when considering the increase in solubility with temperature, you have to check the enthalpy of solution of $\ce{NaOH}$ in a saturated solution of $\ce{NaOH}$.


When you dissolve $\ce{NaOH}$ in pure water, the process is highly exothermic, but as the concentration of $\ce{NaOH}$ increases, the process becomes less exothermic and eventually near the saturation point it becomes endothermic (it becomes less favourable for more $\ce{NaOH}$ to dissolve).



So according to Le Chatelier’s Principle, although the dissolution process is overall exothermic, since solubility is determined only at the saturation point, the solubility increases with increase in temperature.


quantum chemistry - How do Electrons Cross Nodes in Orbitals?


I was wondering in orbitals that have nodes such as the p orbital, how does the electron move from one lobe to the other? I know that people say it is because of the wave/particle nature of electrons but they don't actually explain how they travel across the node without actually passing it.


My teacher says it is because that electrons are able to act like waves and hence like how EM waves can pass through a wall, electrons are able to pass through the node. However when he says that electrons are like a wave, does he mean that it is literally a wave so does an electron have a wavelength, amplitude, frequency, etc? Because I remember reading somewhere which stated that electrons aren't literally like waves. However they can be mathematically described using concepts that apply to waves. Is this true?



From the comments, they state that electrons can be thought as standing waves. After looking at the internet I came across the following image which explained how electrons act as a standing wave:


electron as a standing wave


However this doesn't make sense to me. Don't electrons exist in orbitals not in orbits around the nucleus? If so, isn't this wrong? Also, since electrons move in orbitals, how can there be any end points as it can move anywhere and its movement isn't restricted to a close loop. Hence how can it act as a standing wave?



Answer



Electrons (indeed all matter and energy) behave both as wave and as particle, depending how the observation is made. The most obvious example is the single-electron interference pattern.


"In 1974 the Italian physicists Pier Giorgio Merli, Gian Franco Missiroli, and Giulio Pozzi repeated the [interference] experiment using single electrons, showing that each electron interferes with itself as predicted by quantum theory. In 2002, the single-electron version of the experiment was voted "the most beautiful experiment" by readers of Physics World." Wikipedia.


Why do strong acids have weak conjugate bases?


This question is based on the Brønsted-Lowry model. I saw many answers to similar questions online. However none of them have given a detailed answer that is based on molecular structure (the answers all told the OP to rely on a reference table for a way to identify strong and weak acids).



Answer



All chemical processes are reversible at least to some extent.



Keeping this in mind, a strong acid must have a weak conjugate base (I think you mean strong acids have weak conjugate bases).


Why? Let's try to prove by contradiction. If a strong acid had a strong conjugate base, then the base would quickly re-associate itself with a hydrogen proton. This reverses what the acid just did - dissociate itself from a hydrogen proton!


To illustrate this concept, consider hydrochloric acid - the oft-cited strong acid. $\ce{HCl}$ is a strong acid because in water solution it dissociates (nearly) completely into chloride ion and hydrogen protons (which are then solvated by water).


$\ce{HCl + H_2O ->H_3O^+ + Cl^-}$


That is the reaction of hydrochloric acid with water. Note the one-way arrow; the reaction is a one way street. $\ce{HCl}$ is the acid; $\ce{Cl^-}$ is the conjugate base; water is the base and hydronium ion is the conjugate acid. In other words, this is the generalized reaction:


$\ce{(strong)~acid + base -> conjugate ~acid + conjugate ~base}$


In bite-size pieces:


$\ce{(strong)~acid -> conjugate ~base}$


and


$\ce{base -> conjugate ~acid }$



Add the above two "half-reactions" together and you get a complete Brønsted acid/base reaction.


So back to the dissociation of $\ce{HCl}$.


If this reaction (the reverse reaction) happened to a significant extent:


$\ce{HCl + H_2O <- H_3O^+ + Cl^-}$


Then that would be antagonistic to the dissociation of $\ce{HCl}$! $\ce{HCl}$ would no longer be nearly completely deprotonated in water solution since the reverse reaction is significant!


Therefore, we conclude that if one has a strong acid, then its conjugate base must be weak. The converse is also true; if an acid's conjugate base is weak, then the acid must be strong.


minhag - Is a convert free to choose his own minhagim?


Back when Jews lived in the same communities for generations, they were obligated to follow the minhagim (customs) of their community. The classic example is that East European Jews held that one cannot eat dairy until after 6 hours following a meat meal, but that German Jews held that it was sufficient to wait 3 hours, and Dutch Jews wait only 1 hour. Now, Jewish communities in many countries include Jews from the four corners of the Earth and many people observe different minhagim.


Given that, how does a convert to Judaism know which minhagim are required of him? Would he look to the customs of his rav? Or would he look back at his geneology and adopt the customs of Jews from the area in which his non-Jewish ancestors lived? Could he choose the easiest or the strictest customs on his own?



Answer



Rav Nebontzol(Kuntres Hahanhagos-Minhagim 23,quotes Rav Shlomo Zalman Aurbach who held a convert can choose for himself either like the Shulchan Aruch or the Rama.


Chacham Ovadia in Yechavei Daas 5:32 held if a convert converts in Eretz Yisroel he should follow the rulings of the Mechaber whether stringencies or leniencies since he was accepted as the Mora Dassra and was the final psak there.


organic chemistry - Which tautomer of hexane-2,4-dione is more stable?


Tautomers


Which tautomer will be more stable?


Both 1 and 2 show intramolecular hydrogen bonding and form 6 membered cyclic ring, thus increasing the stability.


I think I need to compare the effect of the two alkyl groups ,ie, methyl and ethyl but how?



Answer



TL;DR
The question you are asking is not worth asking. Systems like these are hard to judge and the equilibrium between these structures is extremely fast. Considering any structure as more stable than another is certainly a mistake, because it completely ignores that the molecule is not static.


The double minimum of the tautomers of acetylacetone

Long time it was believed, that for the equilibrium of acetylacetone (AcAc) the enol tautomer (4-hydroxypent-3-en-2-one) has a symmetric hydrogen bond and shows therefore only one minimum, like the following scheme by DMacks from Wikipedia suggests: keto enol tautomery of acetyl actetone
A quite recent publication by Howard et. al. nicely explores the potential energy surface of this molecule and manages to explain the transitional barrier.[1] They find the barrier to be around 10.5 kJ/mol (2.5 kcal/mol) which translates to a rate of 1011 s-1, which is ultrafast. At room temperature you are not able to distinguish between those structures.[2,3]


The equilibrium of hexane-2,4-dione
When we move away from the symmetrically substituted case, we can expect things to be similar, but a bit more complicated. First of all, we would expect a transition barrier to be roughly around the same size, so the transition from one form to the other is still ultrafast.[4]


equilibrium structures of AcAc


I did a few, very rudimentary calculations on the subject and I have to admit, that they were far more complicated than I have anticipated. For reasons I will explain in the notes section, I choose to only discuss the electronic energies on the DF-BP86/def2-SVP level of theory.[5]


First of all it should be noted, that the dione open form 3 is more than 35 kJ/mol higher in energy and will play an insignificant role in the whole mixture. However, I chose this to be the reference state.
The (4Z)-5-hydroxyhex-4-en-3-one 1 is therefore 39.3 kJ/mol lower in energy, while (3Z)-4-hydroxyhex-3-en-2-one 2 is 37.2 kJ/mol lower in energy. This separates the two states by just 2.1 kJ/mol. At room temperature it is impossible to really distinguish those two. It is an incredibly shallow potential energy surface. The transition state 4 is at -36.5 kJ/mol, which makes the activation barrier less than one kJ/mol. Now we should not trust these values absolute, but they give us a rough idea about the whole process. The virtual mode in the transition state is depicted below.


imaginary mode of the transition state


The same mode in 1 looks like this:



OH stretch mode of 1


And in 2 it looks like this:


OH stretch mode of 2


You can see how these modes are all essentially the same. Again you will probably have to cool your system to below 50 K to actually see a separation of those.


One remarkable feature is that against the predictions of judging the +I effect, this level of theory would actually predict 1 being more stable than 2. This is not even surprising since the ethylene chain is also rotating out of plane in this structure.[6]


Conclusion
The tautomers of hexane-2,4-one are in a very fast equilibrium with each other. Based on simple models, like +I effect, it is impossible to judge which tautomer would be more stable, i.e. which tautomer has the lowest absolute energy. Not even higher level approximations like density functional theory are reliable enough to predict this.


Notes and References



  1. Daryl L. Howard, Henrik G. Kjaergaard, Jing Huang, and Markus Meuwly, J. Phys. Chem. A 2015, 119 (29), 7980–7990.


  2. Assuming that every transition leads to the formation of the associated structure, i.e. $\kappa =1$, which is reasonable for this small a barrier, we can approximate via transition state theory the rate for a reaction with a barrier of around 10 kJ/mol: $$ k = \kappa\frac{k_\mathrm{B}T}{h}e^{\frac{- \Delta G^{\ddagger }}{RT}}\approx 1\times10^{11}~\mathrm{\frac{1}{s}}.$$

  3. You might need to cool the system to about 50 K to actually see the formation of two minima. Of course for the symmetric case these two would be identical, so you would still need to mark one of the sides with an heavier isotope. This of course will influence the measurement, but I think you can get where this is going to.

  4. If you are as confused as me about the correct IUPAC nomenclature of the compound see: How to name the tautomers of hexane-2,4-dione correctly according to IUPAC rules?

  5. This system is incredibly hard to treat with DFT. It might be also very hard with more elaborate quantum chemical methods. The transition state is easily obtained, but a caluculation following the intrinsic reaction coordinate seems to be impossible. The reason for this is that the transition state itself is in very close proximity to the structure of 2. The position of the proton does differ by less than 0.2 Å. See a figure of the superimposed structures.
    Accordingly all calculations involving frequencies will fail, since the harmonic treatment is simply not enough for this system. This is actually an interesting case, where the structures are in very close proximity, so that adding thermal contributions leads to completely nonsensical results. Here it is, that the activation Gibbs energy between the tautomers is negative.
    Fast equilibria like these cannot any longer be described accurately in the Born-Oppenheimer approximation, hence molecular dynamics need to be involved, or at least high level geometry optimisations on the coupled-cluster level with a triple zeta basis set. (The last time I tried that, it already took forever.)

  6. Reasons for this to happen are plenty. It is partially discussed in Why is the eclipsed conformer more stable than the bisected conformer in 1-butene? Also related to this is Why do sp2 carbons tend to prefer eclipsed conformations whereas sp3 carbons prefer staggered?


Saturday 27 February 2016

quantum chemistry - What are datasets containing molecules with more than 38 heavy atoms?


I have been testing a machine learning approach for molecular energy prediction. The current dataset that I have is QM9, which is consist of molecules with up to 9 heavy atoms.


I was wondering if anyone knows of available datasets that contain molecules with large numbers of heavy atoms. I will be testing ZINC, which has up to 38 atoms. Anyone knows of a larger dataset available?



Answer



The ISOL24 database (http://www.thch.uni-bonn.de/tc.old/downloads/GMTKN/GMTKN55/ISOL24.html) contains molecules with up to 81 atoms!



The other answer says that there's a database called "OE" with molecules that have up to 174 atoms, but it is "not yet publicly available".


image processing - 2D DWT computation order


In 2D the discrete wavelet transform (DWT) of an image using lifting based 5/3 filter, if I perform a row-wise operation first then perform column-wise operation then I will get 4 sub-band LL, LH and HL and HH.



  • During reconstruction, that is IDWT, should I maintain the order in reverse direction that is column first and then row?

  • Or any order I can maintain?

  • In JPEG 2000 there is no order information found in the header. Then how I can main the order during reconstruction?





word choice - What is the difference between 出す and 始める when used as a suffix?


Judging from examples I've seen, these are some differences I think there are:


始める:
1: More formal than 出す
2: When the focus in more on the beginning of the verb than the verb itself
3: When the action is deliberate and/or under control.


出す:
1: When the action occurs spontaneously or without ones control.
2: More colloquial than 始める
3: Less focus on the beginning itself than 始める

Are any of the observations I made incorrect, or is there perhaps some differences I've missed?



Answer



The primary difference is that 出す implies something sudden or unexpected. For example, consider the sentence 私は泣き出した and 私は泣きはじめた. In the first we get a natural expression which implies that you (beyond your control) started crying. The second one is grammatically correct, but by using 始めた you're implying a sense of purpose, like you're making yourself cry for some reason. You cannot use 出す to express will or volition, so the sentence 歩き出しましょう would be strange.


The tricky part about trying to find a distinction here is that no matter how many rules you try to apply you're going to be finding exceptions. At the very basic level you can think of 出す as something unexpected or sudden, possibly both, possibly just one. I'm going to borrow a citation from one of the pages below:




講談社インターナショナルの『日本語使い分け辞典』からの引用です。 「~だす」は「~始める」よりも客観的で、自分の意志での動作や行動には使いません。また、「~始める」は単に、ある動作・行動・状態の初期だということですが、「~だす」は、その動作・行動・状態を予想していなかったという「軽い驚きや戸惑い」の感情を含んでいます。(引用終わり)



I agree with the bit that suggests a slight surprise or confusion, even in situations like スタートの合図が鳴り、彼らはいっせいに走り出した。 Even if you expect them to start running, there's still an air of unexpectedness to it because the signal comes suddenly. 出す suggests that they were still and suddenly started moving. If it were 走り始めた then it would have the same general meaning but that nuance of sudden change is gone.


Also just to briefly mention it, 出す also has a spatial meaning of movement from inside to outside, like in ポケットからナイフを取り出す, but that's unrelated to the sense of beginning.


As for your other points, I don't think there is a real difference in formality. I can imagine both being used in formal speech as long as the occasion calls for the nuances associated. You mentioned the part about deliberateness and control which is correct for 始める in some situations, but it's important to note that it can have general connotation of expectedness when it's out of the control of the speaker, like 太陽が沈み始める. And I agree that there is more of an emphasis on the 'beginning' of an action with 始める while 出す tends to express more of the sudden change between two states.


Check these sources out for more info:



  1. http://nihongo-online.jp/bbs/artview.cgi?id=30&mode=view&page=2&num=640&sort=1&back=tree

  2. http://nihongo-online.jp/tree02/treebbs.cgi?log=9657

  3. http://nihongo-online.jp/tree02/treebbs.cgi?log=9659


  4. http://nihongo-online.jp/tree02/treebbs.cgi?log=9660


Usage of kanji for words usually written in kana


From a small discussion on chat, I currently can think of three categories where the word is usually written in:




  1. Hiragana but have kanji (成る, 有る, [炬燵]{こたつ}, etc)

  2. Katakana but have kanji ([頁]{ページ}, [米]{メートル}, 亜米利加, 亜細亜, etc)

  3. Katakana but have an alternate word that can be written with kanji (米国, etc)


I have a few questions about these:



  • How commonly are these kanji used instead of their kana?

  • In what situations are these kanji used instead of their kana?

  • I've seen some of the #1 types used in some doujinshi with some written using the kanji and others written with the kana. Is there some kind of difference between writing some in kanji and others in kana such as if using some feels like old writing?

  • I've seen some of the #2 types used on some websites, specifically 頁, such as this one (「106頁」) but then they don't use it again elsewhere (「ページ数」). Why is this?



Also, assume I'm talking about jouyou or otherwise relatively simple kanji.



Answer



I think possible reasons are:



  1. Writer may be aiming for a particular kanji/kana balance.

  2. Use of a kanji version over hiragana may supply a particular nuance or reduce ambiguity.

  3. Use of the kanji form may reduce overall character count.

  4. Use of the kanji may just indicate personal preference on the part of the writer (particularly in non-official works like doujinshi).



For something like ある you would have to be careful as there are different options with different nuances (在る for existence and 有る for possession). Using 成る for なる is not that uncommon when it is standing alone but should generally not be used if it's a case like できなくなる, only for the verb standing alone. There are cases like 居{い}る・要{い}る where you have completely different words (there's a joke I know that relies on this particular ambiguity), and so there may be occasions where the use of kanji makes the meaning clearer.


In some of the other examples, as pointed out on chat already, it's just a matter of brevity. 米国 and 頁 are shorter than the alternatives. Traditionally newspapers, and nowadays places like twitter, are very concerned about character count, so tend to use a kanji-heavy, condensed style. In fact you can use just 米 for "America/USA" (仏 for France, 露 for Russia etc). There is an alternative condensed way to write メートル in kana: ㍍ and I think 米 for "meter" is less common than 頁.


In addition, as kurosekai32 pointed out, 頁 is being used as a counter in your linked example, and I have a feeling (which I can't substantiate), that it's more likely to turn up as a counter than as a noun (e.g. in something like ページを開く).


Since 亜米利加 and 亜細亜 don't have the advantage of reducing the character count, they are not often used compared to something like 米国. (Although there is a 亜細亜大学 and other proper noun cases where using the katakana would be incorrect).


When people are writing for themselves and therefore not constrained by a style guide/publishers requirements (particularly given that computers make writing in kanji much easier), you will see an increase in the use of non-standard variants. It may be just author preference - I used to read a cooking blog where the author continuously used words like 胡麻{ごま} (sesame) and 胡椒{こしょう} (pepper), and I don't think there was a deeper reason for it than that she preferred the kanji versions. 炬燵{こたつ} will fall into this section.


There are particular examples like きれい・奇麗・綺麗 where the "official" version is often avoided. 奇麗 is the "joyo" version, where 奇 is used for sound, replacing 綺 but has a different meaning which doesn't really fit with the word - so some people will use きれい to avoid the use of 奇, and others will use 綺麗.


halacha - May one have augmentative cosmetic surgery?


I realize much of the discussion on plastic surgery can be found in the answers to this question. However, the actual question was only addressing nose surgery. I would like to to know:





  1. If there are any modern (no older than 10 years) teshuvot regarding cosmetic surgery. Most of the teshuvot quoted in the aforementioned question are nearly 50 years old. Societal demands and medical dangers involved have certainly changed.




  2. Is there a differentiation between cosmetic surgery to "fix" something (ie shorten a nose) as opposed to augmenting something that is not necessarily "broken" (ie breast implants).






halacha - Must one give maaser from virtual money?


If a person achieves a gain or a payment of a currency that that is purely virtual and does not have any physical counterpart (ie it is not associated with a financial institution) must one give ma'aser from that currency?


For example if my salary was paid entirely through bitcoin or if I engaged in virtual gold farming would I then have to pay real, physical maaser from my earnings?




learning - Why do children call themselves by their name?


Why is that young children call themselves by their first name when referring to themselves? This question is similar to Speaking in the third person; however, young children do not understand the connotations of speaking in the third person.


My fiance's cousin who is six refers to herself as ゆりちゃん. Is the only reason she calls herself by her own name because everyone calls her ゆりちゃん when talking to her? When do children stop referring to themselves in the third person and why?



Answer



@JesseGood's answer is correct, but just to add to it:


Not only will other people refer to kids by their name, they will often also refer to themselves by title when speaking to them. I.e. their mother/father will likely refer to themselves as "お母さん/お父さん" or "ママ/パパ" and their teacher to him/herself as "先生" when speaking to them. They might not hear personal pronouns much at all in their daily lives.


Thus, it's not surprising that kids learn that people have a label which is used independently from who is using it. Kids have to learn to use pronouns at all, which is quite different from the problem of learning to use I/you correctly, which seems to be common in languages where pronouns are more commonly used.


trop cantillation - Why do a few tribes in a list have different trope from the rest?


In the first aliya of B'midbar the chiefs of the tribes are listed. Nine have the zakeif gadol trope and three -- Yisachar, Binyamin, and Naftali -- have different trope. This isn't driven by word count (e.g. the Yosef tribes, even though they have more words, still use the same trope, just with some additions).


I wondered if there were something special about these three tribes that the trope is trying to call out. Another place where representatives of tribes are listed is in Sh'lach l'cha, and there also there is a majority trope with some variation -- but it's not the same tribes there (Yehudah and Manashe there).


Why do these three tribes have different trope in B'midbar? Is there a meaning or is it just melodic variation? And if there is meaning behind it, where can I find commentaries that address it? Most of the common commentaries (or at least the ones I have) focus on text and don't address trope.




Answer



The alternation you are speaking of is between a zakef gadol (on the many, short names) and a 'pashta'-zakef katon (on somewhat longer words). Both of these are really a zakef. When the zakef comes on the first word of a clause, or of a pasuk, as it does here, then there is no place for the servus. This is where we typically see a zakef gadol version of the zakef.


The 'pashta'-zakef katon is caused by purely musical concerns, based on characteristics of the syllables. But it is really just an equivalent of the zakef. Here is what William Wickes has to say about it:



If there is a closed syllable in the word, separated by one or more others — or, at least, by vocal Sh'va — from the tone-syllable, an emphatic intonation (a high tone, as the position of its sign above the word implies) was introduced, serving as a forebeat ( Vorschlag) to Zaqeph, in the absence of the foretone. It was known as Methiga, being like an upper Metheg (comp. the use of the term in the accentuation of the three books, Taamei Emeth, pg. 70).



Keep reading at the link for more information about the Methiga. But consider: Le-Yis-sas(?)-char. That is a closed syllable, Yis, separated by one other syllable - sa - from the tone syllable, char. So too Bin, a closed syllable, ya, a separating syllable, and min, the tone syllable. And so too Naf, a closed syllable, ta, a separating syllable, and li, the tone syllable.


halacha - V'kara zeh el zeh v'amar - When does who bow left then right here?


At the beginning of Kedusha, the Chazzan says v'kara zeh el zeh v'amar. I've seen three types of chazzanim with regard to bowing left at the first zeh and right at the second:




  1. bow left and right at vkara zeh... every time.

  2. never bow at vkara zeh...

  3. bow left and right at vkara zeh, but only on Shabbos.


Which is correct, if any? And if this bowing is correct, should a non-Chazzan also do it?




Friday 26 February 2016

The process behind キャ in loanwords from English


I'm curious why many English words that are borrowed into Japanese which have the "ca" sound as in "can" or "canvas" end up with that being mapped to キャ:




  • キャンバス (canvas)

  • キャビネット (cabinet)

  • キャンセル (cancel)

  • キャンピング (camping)

  • キャメラ (camera)

  • ...


Gya also:



  • ギャラリー (gallery)


  • ギャラクシー (galaxy)


also, not at the start of a word:



  • スキャン (scan)

  • スキャンダル (scandal)


(and why is 缶 かん rather than きゃん).


The kya sound doesn't resemble the original in any major English dialects.


It's not hard to pick up the intuition for it, but is there a linguistic explanation?



Does this choice help to avoid some ambiguity with native morphemes, essentially flagging these words as being loanwords?


There don't seem to be very many native words that start with kya; a large number of them are compounds of 客, so these prefixes do seem to occupy a sparsely populated space.



Answer



In more linguisticky terms, you might say that velar stops before /æ/ are sometimes palatalized in loans from English. Why?


We can find our answer in Adaptation and Transmission in Japanese Loanword Phonology, Clifford James Crawford's doctoral dissertation, in section 2.3.3 "Palatalization of velars before /æ/". Quoted below:



[T]here is an allophonic variation in English between velars with a relatively front place of articulation, as in key, that occur before front vowels, and velars with a relatively back place of articulation, as in coo (Keating & Lahiri 1993). Fronted velars are thus likely to be perceived as palatalized by Japanese listeners, given their similarity in articulation (Akamatsu 1997).12 (emphasis added)



So when these words were borrowed, it's likely that native speakers of Japanese did perceive a resemblance to the original, even though you, as a native speaker of English, do not.


Why does this occur only before /æ/? Crawford continues:




[O]nly velars before /æ/ actually can be palatalized; the other possible source sequences here (/ki, kɪ, ke, kɛ/) are always adapted with a (phonologically) plain velar instead. This is because Japanese phonology does not make a palatalization contrast before front vowels (Ito & Mester 1995).13



Crawford also attempts to address the question of why palatalization occurs only some of the time. He shows relationships between the date of borrowing and likelihood, and he also shows that words with "similar enough" cognates in other languages available for borrowing tend not to exhibit palatalization. These two factors combined, he says, give us a relatively strong way to predict whether velar stops before /æ/ will end up palatalized in Japanese. For details, please see his dissertation, linked above.


agada stories legends - Source for story about R' Yishmael ben Elisha's mother?


This article tells us the following story about R' Yishmael ben Elisha and his mother:




Rabbi Ishmael's mother was a very pious woman, and she worshipped her son. But one day she astonished the Sages when she appeared before them to complain about her son. Said she, "Rebuke my son, Ishmael, for he does not show me honor." The faces of the Sages turned pale, and they asked her, "Is it possible that Rabbi Ishmael should not show honor to his mother? What has he done to you?" She replied, "Before he goes to the Beth Hamidrash, I want to wash his feet, and to drink the water with which I have washed them, but he will not permit it!" Then the Sages said to Rabbi Ishmael, "Since this is her wish, honor her by permitting it.



What is the source for this story?



Answer



Straight out of the Yerushalmi Talmud: Pe'a 1:1 and repeated in Qiddushin 1:7.



אמו של רבי ישמעאל באת ואמרה וקבלה עליו לרבותינו אמרה גערו בישמעאל בני שאינו נוהג בי כבוד באותה שעה נתכרכמו פניהן של רבותינו אמרין איפשר לית רבי ישמעאל נוהג בכבוד אבותיו אמרו לה מהו עביד ליך אמרה כד נפיק מבית וועדא אנא בעה משזנה ריגלוהי ומישתי מהן ולא שבק לי אמרין הואיל והוא רצונה הוא כיבודה



halacha - Dancing and singing on Shabbos



Halacha seems to imply it is problematic to partake in these activities on Shabbos yet of late I have noticed it has become a Mitzvah to do it. What is the Halachic Basis for it? And which Posek talks about it? What does he say?




parashas shemos - Why did God choose Moshe?


Why did God choose Moshe? The Torah says very little about him, other than that he was extremely humble. However, I heard from a tape by Rabbi Kardozo that his humility stemmed from his being in such close contact with God, hence he was not as humble before God spoke to him.


Is there a source for why God specifically chose him? Or perhaps he was simply destined from birth?




grammar - Positioning of quantities (using counters)


Example 1



ビール一杯を飲む


一杯のビールを飲む



ビールを一杯飲む



Example 2



ネジ2本を取り付ける


2本のネジを取り付ける


ネジを2本取り付ける



Is there any difference between the above examples with the positioning of the quantity?




Why do men or boys have to cover their hair, but not unmarried women?


Whatever the reasons for covering hair (e.g. fear of heaven), they seem to equally apply to men and women. So why don't unmarried women have to cover their hair?





halacha theory - Should Moshiach be Gdol Hador according to Rambam and R' Akiva?


Rambam Melachim 11 states that Moshiach should be one who studies Torah:



"וְאִם יַעֲמֹד מֶלֶךְ מִבֵּית דָּוִד הוֹגֶה בַּתּוֹרָה וְעוֹסֵק בְּמִצְוֹת כְּדָוִד אָבִיו."


"Now, if a king should arise from the House of David who is versed in Torah and engages in Commandments, as did David his forefather"




[Strangely in Hichos Teshuvah (9:2)] Rambam also shows how great should Moshiach be in Torah study and prophecy:



"מִפְּנֵי שֶׁאוֹתוֹ הַמֶּלֶךְ שֶׁיַּעֲמֹד מִזֶּרַע דָּוִד בַּעַל חָכְמָה יִהְיֶה יֶתֶר מִשְּׁלֹמֹה.
וְנָבִיא גָּדוֹל הוּא קָרוֹב לְמשֶׁה רַבֵּנוּ. וּלְפִיכָךְ יְלַמֵּד כָּל הָעָם וְיוֹרֶה אוֹתָם דֶּרֶךְ ה'."


"as that king who will arise from the seed of David will be gifted with wisdom more than Solomon, and great in prophecy nigh unto Moses. He will, therefore, teach the whole people and point out to them the Lord's path"



However, from the following statement of his (in Melachim, based on the Gemmorah Yerushalmi Taanit 4:5):



"... רַבִּי עֲקִיבָא חָכָם גָּדוֹל מֵחַכְמֵי מִשְׁנָה הָיָה. וְהוּא הָיָה נוֹשֵׂא כֵּלָיו שֶׁל בֶּן כּוֹזִיבָא הַמֶּלֶךְ. וְהוּא הָיָה אוֹמֵר עָלָיו שֶׁהוּא הַמֶּלֶךְ הַמָּשִׁיחַ. וְדִמָּה הוּא וְכָל חַכְמֵי דּוֹרוֹ שֶׁהוּא הַמֶּלֶךְ הַמָּשִׁיחַ. עַד שֶׁנֶּהֱרַג בַּעֲוֹנוֹת.


For Rabbi Akiva, one of the wisest of the Sages of the Mishna, was King Ben Coziba’s arms-bearer and said that he was the King Messiah. He and all the Sages of his generation thought that he was the King Messiah, until he was killed because of his sins"




As we know, R' Akivah was the Gdol Hador and other Sages were far more knowledgeable than Bar Kochbah to say the least. I could not find any mentioning of B"K's sayings or wisdom in the Talmud, instead, he's only mentioned as a purely military leader, not a Chacham.


First, is there a contradiction in Rambam betweens his first view that the Moshiach should be "more intelligent than King Salomon" and R"Akiva's view that Bar Cochbah was the Moshiach despite his mediocracy?


Second, which way do we hold LeHalachah - should the Moshiach be Gdol Hador or just an exceptional military leader?




terminology - What are the units of 85000 Molecular Weight of a polymer


I have a PVA bottle, which says that the molecular weight (Mw) of PVA is between 85000 - 124000.



I know that this means that there are repeated chains of the PVA monomer, but what are the units to the molecular weight (of PVA). Is it $\frac{\mathrm{g}}{\mathrm{mol}}$? I am having trouble grasping this concept. Or does 85000 - 124000 mean the number of monomers in the chain of this PVA?



Answer



First of all $M_w$ is not the number of monomers in a chain of PVA. The number of monomers in a chain is called the degree of polymerization. $\overline {M_w}$ is the weight average molecular weight. It is a way of determining the molecular mass of a polymer. As polymer molecules have different chain lengths, the average molecular mass will depend on the method of averaging. For example, we can use the number average molecular weight which is based on different type of averaging.


As for the unit, it's as you mentioned: g/mol. In biochemistry, they use the dalton (Da) as a mass unit for biopolymers (1 $N_a.$Da= g/mol, where $N_a.$ is the Avogadro number). So, when we say a protein has a molecular weight of 64000 g·mol$^{−1}$, it has also a mass of 64 kDa.


P.S. To be rigorous, we have to say ** molecular mass** instead of ** molecular weight**. But this was an old way of naming things.


halacha - Is one permitted to report inflated driving hours?


In the United States, all applicants for a driver license (and permit) must have driven a certain number of hours, which varies per state. In some states the number of required hours is very high, presumably to get people to actually hit a lower target that the state really wants. For example, if a state that wants a requirement of 30 hours but assumes people will only do half, then it might state a requirement of 60 hours. (I have no basis for saying that this is what goes on in the states' minds, but I am pretty sure that a lot of people don't do all the required hours.)


Is someone allowed according to halacha to only do half (or some other incomplete amount) of the required hours and report having done all of them? I've heard he might be.




negation - Let's not do this


I wonder how to interpret the following sentence: "The weather is bad so let's not go out?". Basically, I want to stay as literal as possible and not end up saying "let's stay home" or using "if the weather's bad we better not go out".


Basically it would be something like:



天気が悪いので、出かけません+しよう


Can someone help me out on this? If it cannot be literally translated, what are the other ways of expressing this?



Answer



I think you could say something like this:



  出かけないでおこう     (plain)
  出かけないでおきましょう  (polite)



Since your example includes 出かけません, I assume you want the polite version.


halacha - Eating in a restaurant that is not under the beth din


Can one eat in a resturaunt that claims to be kosher, yet does not have a certified kashrut certificate from the local beth din?


Is this a violation of a prohibition by the owner? Does the owner have to abide by the beth din and make sure to pay for a license?




matlab - Find Magnitude Responce at $omega=dfrac{pi}{2M}$ where $M$ is the number of channel in QMF


I have frequency response of low pass filter


    M=8  %%%channel 
x=8*512
d1=fir1(N-1,wc/pi,w);
% L=length(d1);
% for k=1:L
% b2(k)=((-1)^k)*d1(k);
% end

%%%%%%Frequency response
h1=fft(d1,x);
a1=max(abs(h1));
m1=20*log10(abs(h1/ a1));
c=0:x-1
plot(f1/x,m1)

I have to find magnitude responce at $\omega=\dfrac{\pi}{2M}$ i.e., $h_1$ at $\omega=\dfrac{\pi}{2M}$



Answer



Your code has too many unassigned variables for us to execute it. Your FFT freq axis, in radians/sample, goes from 0 –to- 2pi. The equivalent mathematical FFT integer freq axis index goes from 0 –to- 4095. You want to know h1 at w = pi/(2M) radians/sample. Let's use variable k to represent the mathematical FFT integer index corresponding to your w.



So we can set two ratios equal to each other: k/4096 = w/2pi. Next we write k/4096 = (pi/(2M))/2pi. This gives us k = 4096/(4M) = 4096/32 = 128 as the math index corresponding to your w. Because of Matlab's unpleasant indexing method the magnitude response you want to examine is your h1(k+1) = h1(129) FFT sample. [By the way, as long as your M is an integer power of two, k will be an integer. If M is not an integer power of two, you'll have to use either a 'floor()' or 'ceil()' command to compute the mathematical FFT integer index k.]


The link between a name and a person's soul?


The Hebrew word Neshamah contains the word Shem or name, linking the two together.


The Ba'al Shem Tov commenting on Genesis 2:19 wrote Hashem hu haneshamah shel ha'adam, one's name is one's very soul.


1 Samuel 25:25 seems to tell that one is one's name: כי כשמו


So does a name that's been given has any influence on who we become (according to Jewish teachings and scriptures)?




halacha - Is one allowed to smoke?


Nowadays, since there are studies that show that smoking is dangerous to health, is one allowed to smoke or is it violating "Venishmartem Meod Lenafshosechem"?



Answer



There is a machlokes haposkim on this matter.




  • Igros Moshe wrote in 1964 that since there is a possibility of danger from smoking, one should refrain from doing so, however, it is not forbidden because "Shomer Psaim Hashem", Hashem guards the fools.


    In 1981, R' Moshe wrote that the danger of smoking is no more than the danger of eating unhealthy foods, about which the Rambam does not write that they are "forbidden", just unrecommended. Therefore, he writes, because people get withdrawal syndromes when they do not have what to smoke, and the danger is not so great (R' Moshe writes that the amount of people who get sick is a small minority). Therefore, we say that "Hashem guards the fools".



    However, he says that one should not start smoking, since there is some danger without any benefits, and there is no desire to smoke until one starts.




  • However, R' Moshe Shternbuch said that it is forbidden because of



    1. danger from Cancer and heart problems.

    2. the Chazon Ish said that smoking hurts memory and comprehension, so smoking would be prohibited because of "Lo Tishkach", that one isn't allowed to do something to cause oneself to forget words of Torah.





  • Binyomin Zilber takes a middle approach, and says that while it may be very unhealthy, yet it would not be intrinsically prohibited. He brings a proof from the Mishna Brurah which permits smoking on Yom Tov, yet in his Likkutei Amarim he says that smoking weakens a person, and causes a waste of time and money. In other words, there are things that are wrong to do, yet not officially "prohibited".




  • The Previous Lubavitcher Rebbe writes (in 1943) to the Rosh Yeshiva of Tomchei Tmimim to absolutely forbid smoking to students under 20 wherever they may be for all 24 hours a day. He should also give over a request to students who are above 20 that it is in their benefit (both physical and spiritual) to quit smoking, by slowly lessening their smoking until they will quit completely.




There are two opinions as to what was the Lubavitcher Rebbe's opinion. Someone asked the Rebbe why do Rabbonim not forbid smoking. The Lubavitcher Rebbe answered with two reasons:



  1. This matter is for doctors to decide, not Rabbonim.

  2. It is possible that a harmless cigarette will be invented. However, if there will be a ban, that cigarette would also be included and would be needlessly forbidden.



There is a debate between R' Oberlander and R' Zayants as to the meaning of the Rebbe's answer.




  • R' Oberlander writes that one reason to permit is because of "Hashem guards the fools". One of the sources that we can rely on the verse "Hashem guards the fools" is a Gemara in Yevamos(12b) that has an argument between R' Meir who says that a 11-12 year old should prevent pregnancy (because it is dangerous to give birth at that age) and the Chachamim who permit it because "Hashem guards the fools".


    However, he brings down the Tzemach Tzedek who asks if we can say "Hashem guards the fools" in cases where a pregnancy is dangerous for a woman. The Tzmeach Tzedek says that one could differentiate between the Gemara's case and a dangerous pregnancy, because in the case of the Gemara, most 11-12 year olds don't get pregnant, so we could rely on "Hashem guards the fools" and a "majority" to assume that the dangerous situation won't come up and there will be no pregnancy. However, if the danger is more definite, one can't say "Hashem guards the fools".


    R' Oberlander then goes on to say how smoking is not very dangerous, so we could rely on "majority" (majority of people who smoke don't get sick) and "Hashem guards the fools" to assume the "minority" dangerous situation won't happen and permit smoking.




  • However, R' Zayents explains the Tzemach Tzedek differently. He explains the idea of "Hashem guards the fools" is that when it applies Hashem prevents the "minority" dangerous case from happening. In other words, by a 11-12 year old, "Hashem guards the fools" means that such a case will not occur (she won't get pregnant). However, if a dangerous situation would occur, we would have to worry about it in the first place. Since in smoking there is at least this "minority" of smokers who get sick, we would have to take them into account and forbid smoking. Moreover, R' Zayentz points out that the letter where the Rebbe gave reasons why Rabbis don't forbid smoking does not mention "Hashem guards the fools". The Rebbe's letter says that smoking is a medical questions for doctors to address, and as long as it's unhealthy it's automatically forbidden, and when it will become healthy, it will be automatically permitted.







Interestingly enough, Igros Moshe permits the Dor Yeshorim test even though there is only a small chance of having children with birth-defects, and says that not taking the test is like closing one's eyes to danger.


organic chemistry - Hydrolysis of Sucrose over Sn1Ac or Sn2Ac



In "March's Advanced Organic Chemistry" I have read about the general mechanism of the acetal hydrolysis. It names the acid-catalyzed SN1 or SN2 as a possible mechanism for a Acetal-hydrolysis.


Now I am interested to know if SN1 or SN2 is mainly going on at the Hydrolysis of Sucrose to Glucose and Fructose. So I compared the different parameters which influence SN1/SN2.




  • Polarity of the solvent: Water -> really polar -> SN1 preferred.




  • Stabilization of a possible Carbokation-Intermediat: Primary (Anomeric C!), so not really stabilized by Hyperconjunction -> SN2 preferred. (Is there Hyperconjunction also in the ether-O?)





  • Mesomeric stabilization There is also a mesomeric stabilization between the resulting carbocation and a Oxonium-Ion in the SN1-Mechanism.




  • Steric Hindrance: In my opinion, through the planar region around the anomeric C (planar ether), there is no steric hindrance -> SN2 possible.




  • Temperature: high temperature -> SN1 preferred.




So to conclude: Many different aspects. Because of the main points "steric hindrance" and the destabilized primary carbocation intermediate I would conclude that the hydrolysis of Sucrose goes mainly (maybe a little bit over SN1) over SN2.



Have I forgotten something important? Are my assumptions "No steric hindrance" and primary carbocation-intermediate correct?


I have attached my possible SN1-mechanism.





Thursday 25 February 2016

organic chemistry - Is the aromaticity broken in some resonance structures of para-nitro-aminobenzene?



According to my course of organic chemistry, para-nitro-aminobenzene has to break his aromaticity to delocalize the electrons of the amino-group in the nitro-group. I don't really see this, when I draw the resonance structures.


resonance structures




punctuation - When should either 「」 and 『』 be used?


In what scenarios would you use 「」 quotation marks instead of 『』, and vice versa?



Answer



In Japanese, the symbols 「」 are called [鉤括弧]{かぎかっこ} and the symbols 『』 are called [二重鉤括弧]{にじゅうかぎかっこ}. The basic rules for these symbols are simple: 「」 is used to denote quotation, and 『』 is used to denote quotation inside a 「」-quote.


Example:



[先生]{せんせい}が[生徒]{せいと}に「『おはよう』はフランス[語]{ご}で[何]{なん}と[言]{い}いますか」と[聞]{き}いた。
A teacher asked a student, “How do you say ‘Good morning’ in French?”




In some contexts, 『』 is also used to denote the title of a book and other kinds of works.


Example (from Wikipedia with an English translation by me):



『[広辞苑]{こうじえん}』は、[岩波書店]{いわなみしょてん}が[発行]{はっこう}している[中型国語辞典]{ちゅうがたこくごじてん}である。
“Kōjien” is a middle-sized Japanese dictionary published by Iwanami Shoten, Publishers.



pronunciation - Do native speakers think of prolonged vowels as one long vowel, or two vowel sounds following each other?


In a native speaker's mental model, are long vowel sounds - for example the おう in 「教室」 the ああ in 「唐揚げ」, the えい in 「先生」 or just 「いい」 (I chose these examples quite deliberately, since they represent fairly different "categories" of long vowels; please consider them all) - a long vowel sound or two vowel sounds following each other? In other words, when they say a long vowel, are they deliberately saying one long vowel sound or two of them directly following each other?



Does it perhaps depend on which vowel it is? Does it depend on the word? Perhaps neither, or something else entirely? This is something I've been wondering for a while now, and I feel knowing the answer would help my latent understanding of the language and pronunciation.


I realize there's probably no definite answer, at least not without conducting some scientific research, but having the input of some native speakers or someone who's talked to native speakers about this would be invaluable.




history - Did courts ever execute?


The laws of capital crimes elucidated in Sanhedrin and elsewhere make conviction very unlikely. Makkot 1:10 famously tells us that a court that executes once in seven years is considered "destructive", R. Eliezer b. Azariah ups this to once in seventy years, and R. Tarfon and R. Akiva said, "If we were on the Sanhedrin, nobody would have ever been executed".


My question: how many times did rabbinic courts carry out executions?



Answer



In Tanach I find the following cases (there may be others I've missed):




  • Moshe's court executing the blasphemer (Lev. 24:23)

  • ...and the Shabbos violator (Num. 15:36)

  • Yehoshua's court executing Achan for taking from the spoils of Jericho (Josh. 7:25)

  • Navos being executed by the court of Jezreel on charges of blasphemy and cursing the king (I Kings 21:13). The charges were trumped up at Jezebel's orders, and the court itself was corrupt, but they did follow the technical protocols for his trial.


In the Talmud we have the following cases that I know of. Three of them are in the era of Yehudah ben Tabbai and Shimon ben Shatach (early 1st century BCE).




  • Yehudah ben Tabbai and his court executing a false witness whose testimony was impeached (huzam) (Chagigah 16b and Makkos 5b)





  • Shimon ben Shatach and his court executing eighty women for practicing witchcraft (Sanhedrin 45b, and more details in Rashi ibid. 45b, from Yerushalmi Chagigah 2:2 and Sanhedrin 6:6)




  • ...and then having his own son convicted (based on false testimony) and executed (Rashi ibid. 44b, from Yerushalmi Sanhedrin 6:3)




  • Someone being executed "in the days of the Greeks" for riding a horse on Shabbos (Yevamos 90b, Sanhedrin 46a)





  • Yeshu Hanotzri, also known as Ben Stada and Ben Pandira, who was executed on Erev Pesach (Sanhedrin 43a and 67b, uncensored editions). A lot of ink has been spilled on the question of whether this person is identical with the founder of Christianity.




None of these are really typical cases, though - each of them is mentioned because of some unusual feature. There may have been many other cases where people were executed judicially, which are not recorded because nothing out of the ordinary happened.



  • The first three were at Hashem's direct command.

  • The case of Navos was instigated by Jezebel (and she and Ahab were duly punished for it).

  • Yehudah ben Tabbai was trying to make a point against the Sadduccees (to demonstrate the halachah that false witnesses are punished only if their intended victim had not yet received his punishment), but it turned out to be a mistake on his part (false witnesses are not supposed to be killed unless both of them are impeached, and here only one was).

  • Shimon ben Shatach executed eighty women on the same day, where normally a court is not supposed to carry out more than one death penalty at a time.

  • The witnesses who testified against his son eventually recanted their testimony, but it was too late.


  • Riding a horse on Shabbos is not normally punishable by death, because it is prohibited only by Rabbinic law. In this case he was executed "because the times required it" (Rashi: it was a time of Greek persecution and people were being careless with mitzvos).

  • Announcements of Yeshu's impending execution were made forty days in advance, to give people a chance to come forward in his defense, "because he was close to the government."


organic chemistry - Friedel–Crafts reaction of phenol


Does phenol undergo Friedel–Crafts reactions or does it react with Lewis acids like aniline does?



Answer



Like aniline, phenol too reacts to a very less extent during Friedel-Crafts reaction.



The reason being that the oxygen atom of phenol has lone pair of electrons which coordinate with Lewis acid.


In fact most substituents with lone pair would give poor yield.


The two pathways involved in the reaction with phenol reduce the overall yeild: acylation


Phenols are examples of bidentate nucleophiles, meaning that they can react at two positions:



  • on the aromatic ring giving an aryl ketone via C-acylation, a Friedel-Crafts reaction


or,



  • on the phenolic oxygen giving an ester via O-acylation, an esterification



Wednesday 24 February 2016

Single-pole IIR low-pass filter - which is the correct formula for the decay coefficient?


A single-pole IIR low-pass filter can be defined in discrete time as y += a * (x - y), where y is the output sample, x is the input sample and a is the decay coefficient.


However, the definition of a varies. On Wikipedia, it's defined as 2πfc/(2πfc+1) (where fc is the cutoff frequency).


But here, a is defined as follows: 1 - e^-2πfc.


Their graphs look similar, but which one is more accurate?


The blue graph is the Wikipedia formula, the green is the second one, fc is the x-axis. GeoGebra graph



Answer



The given single-pole IIR filter is also called exponentially weighted moving average (EWMA) filter, and it is defined by the following difference equation:


$$y[n]=\alpha x[n]+(1-\alpha)y[n-1],\qquad 0<\alpha<1\tag{1}$$



Its transfer function is


$$H(z)=\frac{\alpha}{1-(1-\alpha)z^{-1}}\tag{2}$$


The exact formula for the required value of $\alpha$ that results in a desired $3\;\textrm{dB}$ cut-off frequency $\omega_c$ was derived in this answer:


$$\alpha=-y+\sqrt{y^2+2y},\qquad y=1-\cos(\omega_c)\tag{3}$$


Even though it should be easy enough to compute $\alpha$ from $(3)$, there are several approximative formulas floating around the internet. One of them is


$$\alpha\approx 1-e^{-\omega_c}\tag{4}$$


In this answer I've explained how this formula is derived (namely, via the impulse invariant transformation of the corresponding continuous-time low pass filter). This answer compares the approximation $(4)$ with the exact formula, and it is shown that $(4)$ is only useful for relatively small cut-off frequencies (of course, small compared to the sampling frequency).


In the wikipedia link given in the question, there is yet another approximative formula:


$$\alpha\approx\frac{\omega_c}{1+\omega_c}\tag{5}$$


[Note that in all formulas of this answer $\omega_c$ is normalized by the sampling frequency.] This approximation is also derived from discretizing the corresponding analog transfer function, this time not via the impulse invariant method, but by replacing the derivative by a backward difference:



$$\frac{dy(t)}{dt}{\huge |}_{t=nT}\approx\frac{y(nT)-y((n-1)T)}{T}\tag{6}$$


This is equivalent to replacing $s$ by $(1-z^{-1})/T$ in the continuous-time transfer function


$$H(s)=\frac{1}{1+s\tau}\tag{7}$$


which results in


$$H(z)=\frac{1}{1+(1-z^{-1})\tau/T}=\frac{\frac{1}{1+\tau/T}}{1-\frac{\tau/T}{1+\tau/T}z^{-1}}\tag{8}$$


Comparing $(8)$ to $(2)$ we see that


$$\alpha=\frac{1}{1+\tau/T}\tag{9}$$


Since the (continuous-time) $3\;\textrm{dB}$ cut-off frequency is $\Omega_c=1/\tau$, we obtain from $(9)$


$$\alpha=\frac{\Omega_cT}{1+\Omega_cT}\tag{10}$$


Equating the discrete-time cut-off frequency $\omega_c$ with $\Omega_cT$ in $(10)$ gives the approximation $(5)$.



The figure below shows the actually achieved cut-off frequency for a given desired cut-off frequency for the two approximations $(4)$ and $(5)$. Clearly, both approximations become useless for larger cut-off frequencies, and I would suggest that approximation $(5)$ is generally useless.


enter image description here


fourier - Discrete Harmonics - Why multiplying digital frequency by k does not get next harmonic


For continuous time $ e^{jk\Omega_0t} $ gives a complete set of orthogonal harmonics for fourier decomposition but for discrete $ e^{jk\omega_0n} $ does not form a complete set orthogonal basis set to decompose a signal because... ?


No Answer yet on 21 Nov 2018,


If you know please help :(



Answer



First the continuous-time:


Consider the complex exponential: $ e^{j \Omega_0 t} $ where $\Omega_0$ is the continuous-time radian frequency, $t$ is the continuous time itself. Now from elementary calculus, the period of this complex exponential can be found from $x(t) = x(t+T)$ as :


$$ e^{j \Omega_0 t} = e^{j \Omega_0 (t+T)} = e^{j \Omega_0 t} e^{j \Omega_0 T} $$



Now in order for this equality to hold, the last exponential term must be $1$. From the algebra of complex-exponentials it's known that it will be $1$ whenever $\Omega_0 T = 2\pi m$ for some integer $m$ and real $T,\Omega_0$ which indicates that


$$e^{j \Omega_0 T} = 1 \implies \Omega_0 T = 2\pi m $$ from which we find the period of the continuous-time complex exponential as:


$$ T = \frac{2 \pi m}{\Omega_0} = \frac{2 \pi}{\Omega_0} = T_0$$


where in the left we used the fact that the fundamental period $T_0$ is the minimum (nonzero) real number $T$ that satisfied the equality for $m=1$.


Conclusion: any continous-time complex exponential $e^{j \Omega_0 t}$ is periodic for any real value of $\Omega_0$... This is so because $t$ is a continuous variable which admits the period $T_0$ to be continuous as well. Since the period is allowed to be continous, it can always be found to make $ \Omega_0 T$ an integer multiple of $2\pi$.


Furthermore, in the continous-time case the harmonic family of the complex exponential $e^{j \Omega_0 t}$ is defined to be: $$\phi_k(t) = e^{j k \Omega_0 t}$$ for integer $k = 1,2,...,\infty $.


The particular period associated with the k-th harmonic $\phi_k(t) = e^{j k \Omega_0 t}$ is $T_k = \frac{T_0}{k}$, nevertheless its fundamental period is $T_0$.


Now, since the period in continous-time is a real variable it can take any value possible, as you can see, as the harmonic member index $k$ increases the particular period decreases like $T_k = \frac{T_0}{k}$. As the member index $k$ goes to infinity, the member period goes to zero but is a valid value. Hence we see that there are an infinite number of such members; i.e., the harmonic family in continuous-time has infinite members. for each $k=1,2,... , \infty$


Part-II: The discrete-time case :


The complex exponential is $e^{j \omega_0 n}$, where $n$ is an integer and $\omega_0$ is the discrete-time radian frequency (real variable).The headache comes beacuse the index $n$ is not continous but an integer, and therefore, admits only integer periods $N=1,2,...$ . The smallest allowed period is $1$ (unlike in the CT case where the smallest period goes to zero taking any real value)



Now for a discrete-time complex expoeential to be periodic, you should have $x[n] = x[n+N]$ for some integer $N$ as shown:


$$ e^{j \omega_0 n} = e^{j \omega_0 (n+N)} = e^{j \omega_0 n} e^{j \omega_0 N} $$


Again from the complex exponential algebra it's seen that : $$ e^{j \omega_0 N} = 1 \implies \omega_0 N = 2\pi m $$ for some integer $N$ and $m$ . This implies that :


$$ \omega_0 N = 2\pi m \implies N = \frac{ 2 \pi m }{\omega_0} $$


Now, in order for a discrete-time complex exponential $e^{j \omega_0 n}$ to be periodic with period $N$, it must be true that its frequency $w_0$ must be a rational multiple of $\pi$ as indicated by :


$$ \omega_0 = \frac{2 \pi m}{N} $$


Hence if $\omega_0$ does not satisfy the above condition that that complex exponential cannot be periodic at all. This is never the case with continuous-time complex exponentials which are always periodic for any $\Omega_0$.


After finding the condition on the periodicity of the discrete-time complex exponential, let's also observe their harmonic family:


In the discrete-time case, the harmonic family of the periodic complex exponential $e^{j \omega n} $ with a period of $N$ is defined to be: $$\phi_k[n] = e^{j k \omega_0 n}$$ for integer $k = 0,1,...,N-1$.


Another difference between the CT and DT harmonic families occur on the particular period $N_k$ associated with the k-th harmonic: it is not $N_k = \frac{N}{k}$, as that won't be an integer for any $N$ and $k$. The correct period for the k-th member is $N_k = \frac{N m}{k}$ where integer $m$ is chosen to make $N_k$ the minimum integer for given integer $N$ and $k$



Now the last point, why are there just a finite number of harmonics in DT unlike the CT where there are infinite harmonics? This can most easily explained by the following: Let integer $k = mN + r$ for some integers $r,m$ and let $r < N$ where $N$ is the period of the fundamental member $e^{j \omega_0 n}$. Then we have the k-the member as: $$ \phi_{k}[n] = \phi_{m N+r}[n] = e^{j \omega_0 (mN + r ) n} = e^{j \omega_0 m N n } e^{j \omega_0 rn } $$


Now since $N$ is the period, we have $e^{j \omega_0 m N n } = e^{j 2\pi l m N n} = 1$ and therefore we see that


$$ \phi_{k}[n] = \phi_{m N+r}[n] = e^{j \omega_0 rn } = \phi_{r}[n] $$


The $k = mN + r$ th member is identical to the $0\leq r \leq N-1$ st member. Hence we conlude that in discrete-time, for a periodic complex exponential $e^{j\omega_0 n}$ of period $N$ there are only $N$ distinguishable members of the harmonic family.


I hope this clarified it.


halacha - Is there an exhaustive list of astronomical/environmental events for which there are blessings?



Inspired by:



Is there anywhere in the Halachic literature that lists all of the astronomical (e.g. new moon) and environmental (e.g. lightning) events for which there are blessings and indicates that this an exclusive list? Having such a list handy would make it easier to answer questions such as the above.



Answer



The Shulchan Aruch (OC in the 220's) lists a bunch of natural phenomenon that get special blessings including:




  • Strong rains after an extended drought





  • Blossoming fruit trees




  • Meteors




  • Comets




  • Earthquakes





  • Lightning




  • Thunder




  • Strong winds





  • Seas




  • Rivers (possibly only the four mentioned in Genesis 2)




  • Uniquely tall mountains





  • Uniquely tall cliffs




  • Deserts




  • Rainbows




  • The Sun, Moon, Planets and the constellation Aries at their 'original' locations. We only have a preserved tradition for the sun in this case, which is known as Birkat HaChammah.





The question then becomes, is this list exhaustive or can we add other natural phenomena which Chazal may not have known about (eg. geysers) or may not have considered common enough to list (eg. a volcanic eruption)? In the book Shaar HaAyin (7:6), the author claims that this is currently a matter of dispute between R Chaim Kanievsky and R Shmuel HaLevi Wosner. I note that eclipses may be an exception to the rule as they may be seen (groan) as negative omens and wouldn't get a blessing according to either side (see my answer here).


I further suggest that this might parallel a similar argument about whether the blessing "Mishaneh HaBeriyot" which the Talmud says can be said on an elephant or a monkey needs to be said on only those two, or if they are general indicators of unusual animals. This too is a matter or dispute, with Rs Shlomo Zalman Aurbach, Nissim Karelitz, and Moshe Shternbuch permitting and Rs Yosef Shalom Elyashiv and Chaim Kanievsky forbidding (Shaar HaAyin 15:6).


readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...