Sunday 31 July 2016

experimental chemistry - How does Ostwald-Walker method work?



From searching online I found this:



The apparatus consists of two sets of bulbs. The first set of three bulbs is filled with solution to half of their capacity and second set of another three bulbs is filled with the pure solvent. Each set is separately weighed accurately. Both sets are connected to each other and then with the accurately weighed set of guard tubes filled with anhydrous calcium chloride or some other dehydrating agents like $\displaystyle P_2O_5$, conc. $\displaystyle H_2SO_4$ etc. The bulbs of solution and pure solvent are kept in a thermostat maintained at a constant temperature.


A current of pure dry air is bubbled through. The air gets saturated with the vapours in each set of bulbs. The air takes up an amount of vapours proportional to the vapour pressure of the solution first and then it takes up more amount of vapours from the solvent which is proportional to the difference in the vapour pressure of the solvent and the vapour pressure of solution, i.e. $\displaystyle p_0 – p_s$. The two sets of bulbs are weighed again. The guard tubes are also weighed.


Loss in mass in the solution bulbs $\displaystyle \propto p_s $


Loss in mass in the solvent bulbs $\displaystyle \propto (p_0 – p_s) $


Total loss in both sets of bulbs $\displaystyle \propto [p_s +(p_0 – p_s)] \propto p_0 $


Total loss in mass of both sets of bulbs is equal to gain in mass of guard tubes.


Thus, $\displaystyle \frac{p_0-p_s}{p_0} = \frac{\text{Loss in mass in solvent bulbs}}{\text{Total loss in mass in both sets of bulbs}} = \frac{\text{Loss in mass in solvents bulbs}}{\text{Gain in mass of guard tubes}}$


Further we know from Raoult’s law



$\displaystyle \frac{p_0-p_s}{p_0} = \frac{\frac{w_A}{m_A}}{\frac{w_A}{m_A} + \frac{w_B}{m_B}}$


The above relationship is used for calculation of molecular masses of non-volatile solutes.


For very dilute solutions, the following relationship can be applied.


$\displaystyle \frac{p_0-p_s}{p_0} = \frac{\text{Loss in mass of solvent bulbs}}{\text{Gain in mass of guard tubes}}= \frac{w_Am_B}{w_Bm_A}$





My questions:



  • Why "The air takes up an amount of vapours proportional to the vapour pressure of the solution first and then it takes up more amount of vapours from the solvent which is proportional to the difference in the vapour pressure of the solvent and the vapour pressure of solution"?

  • How can we add $\propto p_s$ and $\propto p_0-p_s$ when we don't know what the proportionality constants are or even if they are equal?


  • It would be better if you could explain in detail the process because I'm not getting it properly from here.For your information the text after "From Raoult's Law" and about "the setup" is purely clear to me.



Answer




The additional question from the comments:



Why [is] the amt. of vapours taken up proportional to vapour press. Why directly proportional? Why not nothing else?



First things first, let's get a definition (Wikipedia, italics added):




Vapor pressure [...] is defined as the pressure exerted by a vapor in thermodynamic equilibrium with its condensed phases (solid or liquid) at a given temperature in a closed system.



So basically, before you start the experiment (see below) the vapors have already formed, meaning that thermodynamic equilibrium has been achieved. Then you start bubbling through dry gas, which then mixes with the vapor gas already in the bubbles. If you set the gas flow appropriately, you get a near-equilibrium situation (see the graphic below) and the gas that exits the bulb assemply has exactly the same amount of vapor in it as the vapor "layer" (which can not be thought of as a layer anymore because of the bubbling) above the liquid surface.


We do not have an equilibrium situation, which is why so much care has to be taken that we get as close as possible to the equilibrium situation. (Also, we do not have a closed system, so everything starts to get slightly problematic at this point. But to a first degree of approximation, this will hold up fine.)


This is also why it is directly proportional to the vapor pressure: There is no other mechanism that moves solvent molecules from the condensed phase to the vapor phase. Of course you could add a supersonic vibrating membrane and force more solvent molecules into a vapor phase, but that is not what you want to do, because you want to quantify the relative lowering of the vapor pressure.




Why "The air takes up an amount of vapours proportional to the vapour pressure of the solution first and then it takes up more amount of vapours from the solvent which is proportional to the difference in the vapour pressure of the solvent and the vapour pressure of solution"?



I guess the question you really want to ask is: Why is the vapor pressure of a solution lower than the vapor pressure of a pure substance?



The answer is not simple, but the explanation of the vapor pressure lowering effect can be given by assuming a simple model: Imagine that in the solution, there are two types of molecules; the solvent and the solute. In the pure solvent, there is only one kind. Statistically speaking, that means that there is also a smaller amount of solvent molecules at the boundary between the bulk phase and the vapor. Since solute molecules don't go over into the vapor, there is a smaller area of solvent molecules that can go over into the vapor, which means that the vapor pressure of the solution is smaller when compared to the pure solvent.




How can we add $\propto p_s$ and $\propto p_0−p_s$ when we don't know what the proportionality constants are or even if they are equal?



While we don't know the magnitude of the proportionality constants, we know that they are equal. The proportionality constant is most likely dependent on ambient pressure, temperature and flow rate of the gas. These three variables are being controlled during the experiment and kept constant for all glass bulbs. (Well, I don't know about keeping ambient pressure constant. But if you perform the experiment fast enough, that shouldn't pose much of a problem.)






It would be better if you could explain in detail the process because I'm not getting it properly from here.




Why do we do this?


First, we have to remember: Why are we doing this process; what do we want to find out? The answer is: We want to quantify the relative lowering of the vapor pressure.


How do we do this?


Here's what happens during the process:



  1. Dry gas arrives at the first set of bulbs, filled with a solution.

  2. The dry gas gets saturated with solvent vapor.

  3. The solvent-vapor-saturated gas arrives at the second set of bulbs which contain the pure solvent.

  4. Because of the vapor pressure lowering effect (here now applied in reverse) the vapor pressure of the pure solvent is higher. As such, the gas that enters is not saturated. When it exits the second set of bulbs, it is saturated again.


  5. The pure-solvent-saturated gas enters the desiccator and loses all solvent vapor to it.

  6. Dry gas exits the apparatus.


This might still be hard to understand, so here a graphic that shows you what happens to the solvent vapor partial pressure in the gas:


Ostwald-Walker


At time 1 the gas enters the first bulb. It exits the first cluster of bulbs at about time 4. Then it travels to the next cluster of bulbs (containing the pure solvent) and loads up there, up until time 8. At time 9 the gas enters the desiccator where it loses all the solvent vapor and exits dry at time 12.


Since we weigh all components, we know exactly how much mass we lost from solution and solvent, and how much mass the desiccant gained (both those numbers [the total of the mass loss of course] should be equal): $$ \Delta m_\text{solution} + \Delta m_\text{solvent} = \Delta m_\text{desicc.} $$


The following proportionalities hold:



  • $ \Delta m_\text{solution} \propto p_s $


  • $ \Delta m_\text{solvent} \propto (p - p_s) $

  • $ \Delta m_\text{desicc.} \propto p $


The relative lowering of the vapor pressure can now be calculated, it is simply $$ \frac{p-p_s}{p} = 1 - \frac{p_s}{p}$$


If you know the vapor pressure of the pure solvent, you can simply plug it in the equation, get the proportionality constant and from that calculate the vapor pressure of the solution.



In conclusion, I can only say that I hope to have clarified things for you. I myself spent quite some time researching this method, as I have never heard of this question before. Thank you for the opportunity!


halacha - Bootstrapping problem: havdalah ends shabbat (for one who didn't daven ma'ariv) but lighting the candle is melacha?


This answer (originally elsewhere, later merged here) to a question about melacha before havdalah notes that in that situation one should say "baruch hamavdil bein kodesh l'chol" first. Does that apply to lighting the havdalah candle? I have never learned that women who don't daven (pray) ma'ariv, but who make havdalah themselves, should do anything special first before lighting the candle, but isn't lighting the candle melacha? Should a woman who makes her own havdalah always say "baruch..." first and then proceed with havdalah? Or does melacha that is required for havdalah have some special status that makes this not a concern?



Answer



Yes. Women should formally end shabbat before lighting a havdala candle after shabbat has ended, i.e. after nightfall on Saturday.


First of all, women certainly can daven maariv and say attah chonantanu.


Second, the Rama in OC 299:10 quotes an opinion that the only reason labor is forbidden before havdala is lest one forget to say havdala. Accordingly, one could do non-labor intensive work immediately after shabbat, including lighting a candle. The Rama suggests that this opinion is why many are lenient regarding the prohibition on labor before havdalah. However, he and many later poskim hold that the halacha should not be in accordance with this view, and it would thus be proper to recite maariv or 'baruch hamavdil' before lighting the havdala candle.


Additionally, the Be'er Heitiv (on the page there) advocates teaching the women (who at the time were largely uneducated) to refrain from lighting candles until formally ending shabbat.



Finding zebra-like pattern in image (Detection of structured-light fringe centerline from photo)


I'm working in a project where fringes are projected against a subject, and a photo is taken. The task is to find the centerlines of the fringes, which represent, mathematically, the 3D curve of intersection between the fringe plane and the subject surface.


The photo is a PNG (RGB), and former attempts used grayscaling then difference thresholding to get a black-and-white, "zebra-like" photography, from which it was easy to find the midpoint of each pixel column of each fringe. The problem is that, by thresholding and also by taking the mean height of a discrete pixel column, we're having some precision loss and quantization, which is not desired at all.


My impression, by looking at the images, is that the centerlines could be more continuous (more points) and smoother (not quantized) if they were detected directly from the non-thresholded image (either RGB or grayscale), by some statistical sweeping method (some flooding / iterative convolution, whatever).


Below is an actual sample image:


enter image description here


Any suggestion would be much appreciated!




Answer



I suggest the following steps:



  1. Find a threshold to separate the foreground from the background.

  2. For each blob in the binary image (one zebra stripe), for each x, find the weighted center (by pixel intensity) in y direction.

  3. Possibly, smooth the y values, to remove noise.

  4. Connect the (x,y) points by fitting some kind of curve. This article might help you. You can also fit a high-level polynomial, though it is worse, in my opinion.


Here is a Matlab code that shows steps 1,2 and 4. I skipped the automatic threshold selection. Instead I chose manual th=40:


These are the curves that are found by finding the weighted average per column: enter image description here



These are the curves after fitting a polynomial: enter image description here


Here is the code:


function Zebra()
im = imread('http://i.stack.imgur.com/m0sy7.png');
im = uint8(mean(im,3));

th = 40;
imBinary = im>th;
imBinary = imclose(imBinary,strel('disk',2));
% figure;imshow(imBinary);

labels = logical(imBinary);
props =regionprops(labels,im,'Image','Area','BoundingBox');

figure(1);imshow(im .* uint8(imBinary));
figure(2);imshow(im .* uint8(imBinary));

for i=1:numel(props)
%Ignore small ones
if props(i).Area < 10
continue

end
%Find weighted centroids
boundingBox = props(i).BoundingBox;
ul = boundingBox(1:2)+0.5;
wh = boundingBox(3:4);
clipped = im( ul(2): (ul(2)+wh(2)-1), ul(1): (ul(1)+wh(1)-1) );
imClip = double(props(i).Image) .* double(clipped);
rows = transpose( 1:size(imClip,1) );
%Weighted calculation
weightedRows = sum(bsxfun(@times, imClip, rows),1) ./ sum(imClip,1);

%Calculate x,y
x = ( 1:numel(weightedRows) ) + ul(1) - 1;
y = ( weightedRows ) + ul(2) - 1;
figure(1);
hold on;plot(x,y,'b','LineWidth',2);
try %#ok
figure(2);
[xo,yo] = FitCurveByPolynom(x,y);
hold on;plot(xo,yo,'g','LineWidth',2);
end

linkaxes( cell2mat(get(get(0,'Children'),'Children')) )
end
end

function [xo,yo] = FitCurveByPolynom(x,y)
p = polyfit(x,y,15);
yo = polyval(p,x);
xo = x;
end

Is it possible to use the school supplied algorithm to build the Lewis diagram of the iodate ion?


I am upgrading the grade 12 chemistry credit and have to use the school supplied algorithm to build the Lewis diagram of $\ce{IO3-}$ ion. It seems to me that iodine oxidation state in this ion should be 5, therefore it would have one single and two double bonds with oxygen. When I follow the steps below, I am arriving at a different formula.


I do not need to answer whether the ion is polar or not and what is its shape.



Step 1: Count all of the valence electrons in the molecule or ion. In the case of an ion, add or subtract electrons to account for the ionic charge.



$$\ce{I = 7e^-, O = 18e^-}; \text{ionic charge} = \ce{1e^-}; \text{total} = \ce{26e^-}$$



Step 2: Arrange the peripheral atoms symmetrically around the central atom. Use a pair oil electrons to form a bond that links these atoms to the central atom.




6 electrons placed on $\ce{I}$, $\ce{26e^- - 6e^- = 20e^-}$ remain



Step 3: Add pairs of electrons to complete the octet of the peripheral atoms.



$3\cdot 6$ electrons placed on $\ce{O}$, $\ce{20e^- - 18e^- = 2e^-}$ remain



Step 4: Place any unassigned electrons on the central atom.



2 electrons placed on $\ce{I}$, $\ce{2e^- - 2e^- = 0e^-}$ remain




Step 5: If the octet of the central atom is incomplete, move a lone pair of electrons from a peripheral atom to a new position between the central and peripheral atom.



After completing step 4 of the rules above I am arriving at $\ce{I}$ having 8 electron dots. At this point all electrons have been used up, the octet of $\ce{I}$ is complete, and I can only create a structural diagram with two single and one double bonds.


In the course I have taken previously we were taught that $\ce{I}$ was an exception to the octet rule, but when I asked this teacher, I was told that I was not allowed to use the exceptions and had to apply the octets only.


Am I missing anything? Is it possible to comply with the algorithm above and come up with the correct answer?




internet - Asking/Answering non-Chag-related questions on Mi.Yodeya during Chol Hamoed


I don't know the Chol Hamoed laws at all well, but my impression is that practical/avoda- and melacha-type stuff that is not either related to the holiday, nor done to prevent loss, is generally forbidden.


Would asking and answering questions on StackExchange (Mi.Yodeya or elsewhere) that are not related to the holiday be a violation of this prohibition? Might the idea that using Mi.Yodeya, at least, is, in some sense, Torah learning, be a competing factor?


Related: answering questions on mi.yodeya on Chol Hamoed




physical chemistry - Entropy change in an adiabatic expansion



Question
One mole of ideal gas initially at a pressure of 1 atmosphere and $T = 298\ \mathrm K$, is expanded into a volume 50 % larger adiabatically.



In this adiabatic process, no work is done on the surroundings and $\mathrm dQ=0$. And entropy is defined as $\mathrm dS=\frac{\mathrm dQ_\text{rev}}{\mathrm dT}$. However, there must be a change in entropy surely?


Is the definition $\mathrm dS=\frac{\mathrm dQ_\text{rev}}{\mathrm dT}$ only at a constant volume? Because I have also seen entropy defined as $\mathrm dS=\frac{C_V}{T}\,\mathrm dT+\frac{R}{V}\,\mathrm dV$ and there would be a change in both temperature and volume. However, how do I find what these changes are? Would it make a difference if the expansion was reversible or irreversible (the question didn't make it explicitly clear)



Answer





"One mole of ideal gas initially at a pressure of 1 atmosphere and T = 298 K, is expanded into a volume 50% larger adiabatically."



The question doesn't have sufficient information for a solution, because we don't know if the adiabatic expansion is reversible or irreversible.


If reversible:


If the expansion is done reversibly, then we know entropy of the universe can't be changing (because reversible), and that heat flow from the gas to the surroundings is zero (because adiabatic). Without heat flow, the only way the entropy of the universe can stay constant is if both the entropy of the universe and of the gas stay constant. In this case you can apply both of your equations. But keep in mind that your equation for $dS$ is only true for ideal gases.


$dS = \frac{\delta q_{rev}}{dT} = 0$


$dS = 0 = \frac{C_V}{T}dT + \frac{R}{V}dV$


$\frac{dT}{T}=(-\frac{R}{C_V})\frac{dV}{V}$


This is now a differential equation you can solve for temperature if you know volume.


As the other answers have indicated, a reversible expansion will involve the gas doing work on the surroundings. One way to think about why this is so is that for the process to be reversible, the potential of the gas to do work must not be lost, and so if this potential for doing work doesn't remain in the gas, it must go to the surroundings. A loss in the potential to do work (of the universe) is an increase in entropy. And in a reversible process that can't happen.



Think of gas in a piston, where the piston is held down by a pile of sand. The reversible expansion involves slowly removing sand, grain by grain, from the piston. As the grains are removed, the piston rises and the gas lifts the remaining sand, doing work against gravity.


If irreversible:


...then we still don't have enough information because there are many ways the process can be irreversible. But one particular, extreme case of irreversibility is if the adiabatic expansion occurs without transfer of any energy, then we can solve the problem. In this extreme scenario, neither heat nor work are not transferred. You can thus infer that $dU=0$ for the gas, so


$dU=-TdS + p dV=0$


$TdS = p dV$


Using your definition for $dS$ for an ideal gas,


$T \frac{C_V}{T}dT + T \frac{R}{V}dV = p dV$


Keep in mind that $\frac{RT}{V}$ for an ideal gas is $p$, so you should get that


$C_V dT = 0$


Which is also a differential equation that you can integrate to get the temperature change. (The obvious solution is that the temperature does not change in this case.)



In this second case, now that we know that $T$ is constant, we know $dT$ is zero, and thus using your equation for $dS$, we get that $dS = \frac{R}{V}dV > 0$, i.e., the entropy of the gas increases, which makes sense because the process was irreversible. The potential to do work has been lost.


Think of gas confined to one half of a cylinder, and the other half of the cylinder is empty (i.e. vacuum). If the divider between the filled and unfilled halves is suddenly removed, that would be a case of adiabatic, isoergic expansion.


grammar - Trouble understanding 着ていったら


I am having trouble understanding 着ていったら in the following sentence:


明日の夕食会にはどんな服を着ていったら良いですか。


I understand how ~たら is normally used, its more combination with ていっ that seems to be throwing me off.


How is this different from using 着たら ?



Answer





明日の夕食会にはどんな服を着ていったら良いですか。



着ていったら is the たら form (conditional form) of 着て行く, "wear and go".
(着て is the て form of the verb 着る. いったら is the たら form of [行]{い}く.)


The sentence is literally like...
"To the dinner party tomorrow, what should I wear and go?"
→ "What should I wear to go to the dinner party tomorrow?"


halacha - Upon whom would one make this blessing?


Upon whom today would you make the bracha - Baruch Attah Hashem Elokeinu Melech HaOlam She’chalak Mei’chochmaso Li’rei’av, that He bestowed of His wisdom to those who fear Him (Gemara Brachos 58a)? I'm looking for either A) and outline of what that person must know or (better) B) a list of people currently living.




hashkafah philosophy - Exorcism in Judaism


What is the consensus today regarding dybbuks, demons and possession? Do we attribute these things to mental illness or do we acknowledge their existence?




halacha - Women and Tefillah - per the Rav


I remember a long time ago hearing that the Rav (Rabbi Joseph B. Soloveitchik (1903–1993)) held that women should pray three times a day.


Can anyone verify this, and what is the reason/source for this?




Answer



As quoted in MiPeninei HaRav (page 73), the Rav felt 'based on the simple reading of the Mishna in Berachot (20b)' that women are obligated to pray Maariv.


torah study - What should a Jew learn regularly?


I am wondering what systems of structured Jewish learnings exist or alternatively how to build one. In a broader way what are existing/recognized Jewish learning curriculums or answers to “what should a Jew know/learn regularly”?


We know some partial answers



  • “shnei mikra v’echad targum” - weekly review of the parsha of the week with its commentary (Onkelos / Rashi) - I know some try to learn every year another commentary on a revolving basis (e.g., Ramban, Baal Haturim)

  • daf yomi

  • Hitat (Chabad’s Humash, Tehilim, Tanya) - discussed here on MY

  • Chabad’s (and others?) daily learning of Mishne Torah (1 chapter a day / 3 chapters a day)


But am I asking in a broader way. What should a Jew know and regularly learn? The answer is probably a combination of




  • Humash: weekly review of parasha and commentary (what about midrash?)

  • Tanakh: yearly review of rest of Tanakh

  • Oral Law: daf yomi + review all mishna every 1/2/3 years?

  • Halakha: regular review of Mishna Brura (e.g., Dirshu's Daf Yomi b'Halacha, see also here)

  • Mussar: e.g., review on a revolving cycle of Mesilat Yesharim, Chovot Halelavot, etc.


What existing systems are you aware of? What are thoughts on this?


PS. I read (in his wife's biography) that R Chaim Kanievski has his own seder limud, completing every year Talmud Bavli, Talmud Yerushalmi, Nach, Rambam, Shulchan Aruch, Mishnah Berurah, Midrash Rabbah, Midrash Tanchumah, Sifra, Sifri and Tosefta. But I am looking for something for us normal humans...



Answer




In the most general sense, one is required to know the entire Torah, meaning both written and oral, revealed and hidden, each individual according to their unique capacity. It is an occupation which lasts over the entire course of ones physical life and beyond.


A very good English explanation of what one should learn regularly can be found at the following link. The main principles are there.


http://halachipedia.com/index.php?title=Laws_of_Learning_Torah


It is important to note that in terms of actual practice, one should distinguish between someone who has been raised from the beginning according to the these requirements and someone who comes to learning later in life. The general rule for someone who starts later is to divide their study into thirds. This is discussed in detail by the Alter Rebbe in Hilchot Talmud Torah from Shulchan Aruch HaRav.


Particularly for someone who comes to learning later in life, they should pursue those areas where their personal interests are strongest. It doesn't mean to ignore other areas of Torah, but to develop the habit of learning regularly. This means ideally to set aside specific time, however long, each day, once in the morning and once at night when one will be occupied in Torah study. The emphasis is not on volume. It is on regularity.


If reading in Hebrew is preferred, this link is to Hilchot Talmud Torah from the Shulchan Aruch HaRav. The actual text runs from page 67 through 88 of the online document. An introduction precedes it and voluminous explanatory notes follow it.


http://www.hebrewbooks.org/pdfpager.aspx?req=16009&st=&pgnum=67&hilite=


And these remaining links provide the continuation and completion of those explanatory notes to text.


http://www.hebrewbooks.org/pdfpager.aspx?req=16073&st=&pgnum=1


http://www.hebrewbooks.org/pdfpager.aspx?req=16061&st=&pgnum=1



http://www.hebrewbooks.org/pdfpager.aspx?req=16070&pgnum=1


halacha - Parent/child relationship : how does adoption compare to geirus?


Take a father and daughter who both underwent geirus. Now take a Jewish man who adopted a baby girl of unknown (Jewish) parents. In both situations, the father raises the child since birth. Are the halachic aspects of those relationships identical ?


Ideally precise sources will be provided.


Documentation found in other, related posts :
http://www.jlaw.com/Articles/maternity1.html
https://www.shaalvim.org/yeshiva/torah/view.asp?id=661




Saturday 30 July 2016

halacha - Rainbow, telling a friend


We know The rainbow is a bad Omen. Is one allowed to tell a friend when he sees one, in order to allow him to make a Bracha or should he hold back as it is a bad sign?



Answer



Per Mishna Brura (229:1), when one sees a rainbow he should not inform a friend about it, but rather make a bracha and keep it to himself.



product recommendation - Holocaust Responsa of Rav Ephraim Oshry


Due to the poor health of Lithuania's last Chief Rabbi, Rav Avraham Shapiro, and due to his death in 1943, many of the residents of Kovno Ghetto addressed their questions to Rav Shapiro's student, Rav Ephraim Oshry. After the Shoah, Rav Oshry returned to the ghetto and retrieved the copious texts that he had written, all of which he had buried in jars. He published the bulk of them in New York in 1959, under the title שאלות ותשובות ממעמקים (Responsa from the Depths). An abridged version exists in Hebrew and also in English, the latter being titled "Responsa from the Holocaust", but neither of these versions contains the halakhic argumentation that makes of the original a text worthy of being studied (rather than just one designed to elicit an emotional response).


The volumes published in 1959 are all available at HebrewBooks.org, but I cannot bear to read literature from a computer screen and the cost of privately publishing them is prohibitive. Does anybody know if the original Hebrew texts are available for purchase? My searches have yet to reveal any promising leads.




How to expand on and deepen a basic skill set for image/video processing?


I didn't take any class on image processing but I studied the subject based on lecture notes and important books for last three months. So at this point, I would like to sharp my image processing skills. Of course, I am practicing a lot of image processing work but the work seems to be very similar.


As a programmer, I learned a lot from top coder or similar where you can compete each other for better programming. Is there any web site I can compete for difficult image processing problems?



Answer



I hope you realize (from the form of your question, I think you do) that three months of reading up about it doesn't really make you an image processing expert.


I am familiar with topcoder, but while the difficulty of the problems and approaches that you needed to use there might be similar to those of image processing problems, to design a usable image processing application: do problem specific research, implement your findings and new ideas, test it to get reliable results, you need much more than a couple of hours (or even a week as for the topcoder marathon match).


If you want to just learn more about the basic image processing tools I suggest you:



  • take all your literature, random-open a page and study and implement the concept explained there

  • take a computer vision library such as OpenCV, or work in matlab, take some images, and try using and displaying various image processing methods on them (from simple morphology to more complicated things like Hough line detection). Try and predict results, graphically display them, and understand what you get.



If you are interested in specific problem in image processing (e.g. I am doing Content based image retrieval - CBIR right now -- and by that I mean, almost for the last 5 months), and want to get better in this specific topic, then my advice would be something like:



  • search google scholar, Mendeley article database, IEEEXplore for relevant works on the subject

  • download way too many papers, maybe 3-5 as many as you are prepared to read. Skim abstract, intruduction and conclusion sections and filter out the articles that sound relevant and interesting. Give priority to current (recent) articles, as well as articles with current references.

  • read all of that. Read the most important ones more than once. The one that will be the basis of your work is expected to have margins filled with your scribblings and to look at least a little bit scrappy by the time you finish your 5th read-through.

  • implement that. Go from simple, straightforward implementation to the optimized implementation.

  • before you start doing this, ensure that you have a dataset for testing. Testing is not relevant if it is not done on a large enough dataset. Some works mention the datasets they are using, or their datasets can be found on affiliated university websites.

  • there are public datasets (e.g. this one for object classification) that also organize annual challenges where you can test your new ideas against many peoples new ideas (but that's way bigger than topcoder :D)

  • if you get decent results, that's good. If you get better results than state-of-the art using some of your new ideas, double check them. Then triple check them. And then publish a fancy article ;)



I'm sure you can find a middle between just learning something about image processing just for fun and doing real time-consuming research from what I wrote... Actually, here's an idea: hang around here and try to understand and help to solve other people's problems! All of them need research-think-apply steps, they just vary with the depth of the steps they require ;) In any case, I hope it helps.


history - What are the sources for the stories of Chanukah?


I'd like to find the sources for the stories associated with Chanukah. When I was younger, I was taught stories like:



  • Eliezer Maccabee being crushed by an elephant.

  • The rebellion staring in Mode'in when the greeks tried to make the jews offer a sacrifice

  • the rebellion starting at the marriage of Matityahu's daughter

  • Yehudis killing the Greek general, Helifornos

  • the guerrilla warfare the Jewish soldiers practiced

  • the children hiding their learning by playing with tops.


  • The Greeks outlawing commandments such as Rosh Chodesh, Milah, and Shabbat.

  • and others (feel free to add any).


Where are these stories actually recorded? Is there a good sefer that gathers all the sources and makes them into a coherent narrative (optimally with primary sources)? Are these sources available online?


Some of the sources I've found include Migillat Antiochus (English translation here), Megillat Taanit (17th of Elul), but they don't seem to have all the stories mentioned above. What are the other sources used to tell the story?



Answer



The primary source for the events that took place in the time of Chanuka is Sefer haMakabim (Maccabees I) (English Translation). This book was originally written in Hebrew by a religious Jewish soldier. It's quite fascinating, and I recommend that you read it. (Unfortunately, the original Hebrew has been lost.)


Here are all the relevant verses for the above-mentioned stories:



  • Eliezer Maccabee being crushed by an elephant.




6:43-46 And Eleazar saw that one of the elephants was equipped with royal armor. It was taller than all the others, and he supposed that the king was upon it. So he gave his life to save his people and to win for himself an everlasting name. He courageously ran into the midst of the phalanx to reach it; he killed men right and left, and they parted before him on both sides. He got under the elephant, stabbed it from beneath, and killed it; but it fell to the ground upon him and he died.




  • The rebellion staring in Mode'in when the greeks tried to make the jews offer a sacrifice



2:23-27 When he had finished speaking these words, a Jew came forward in the sight of all to offer sacrifice upon the altar in Modein, according to the king's command. When Mattathias saw it, be burned with zeal and his heart was stirred. He gave vent to righteous anger; he ran and killed him upon the altar. At the same time he killed the king's officer who was forcing them to sacrifice, and he tore down the altar. Thus he burned with zeal for the law, as Phinehas did against Zimri the son of Salu. Then Mattathias cried out in the city with a loud voice, saying: "Let every one who is zealous for the law and supports the covenant come out with me!"





  • The Greeks outlawing commandments such as Rosh Chodesh, Milah, and Shabbat.



1:41-49 Then the king wrote to his whole kingdom that all should be one people, and that each should give up his customs. All the Gentiles accepted the command of the king. Many even from Israel gladly adopted his religion; they sacrificed to idols and profaned the sabbath. And the king sent letters by messengers to Jerusalem and the cities of Judah; he directed them to follow customs strange to the land, to forbid burnt offerings and sacrifices and drink offerings in the sanctuary, to profane sabbaths and feasts, [46] to defile the sanctuary and the priests, to build altars and sacred precincts and shrines for idols, to sacrifice swine and unclean animals, and to leave their sons uncircumcised. They were to make themselves abominable by everything unclean and profane, so that they should forget the law and change all the ordinances.




  • Yehudis killing the Greek general, Helifornos


This story actually has it's own book, The Book of Judith (English Translation, Chabad Summary).




Chapter 13: So Judith was left alone in the tent , with Holofernes stretched out on his bed, for he was overcome with wine... She went up to the post at the end of the bed, above Holofernes' head, and took down his sword that hung there. She came close to his bed and took hold of the hair of his head, and said, "Give me strength this day, O Lord God of Israel!" And she struck his neck twice with all her might, and severed it from his body.




  • the children hiding their learning by playing with tops.


As you may already know, playing dreidel is a fairly modern custom that is based on a popular secular European game. According to Seforim blog, the earliest source for this "story" is Otzar Kol Minhagi Yeshurin, published in 1890. However, R' Josh Waxman believes that the earliest source is Avodat Eved, published in 1877. (Other explanations for why there is a custom to play dreidel can be found here and here and in the Bnei Yissochor 2:25.)


matlab - Fourier Transform of Morlet wavelet Function?


As you know the Morlet wavelet function is given by: $$\frac{1}{\sqrt{\pi f_b}}e^{\frac{-t^2}{f_b}}e^{j2\pi f_c}$$ The Fourier transform of this equation is: $e^{-\pi^2 f_b(f-f_c)^2}$ (is it right)?
First I attempted to plot the FFT of Morlet function by FFT function in Matlab, then I've plotted the Fourier transform function directly. I've expected to see same plots, but unfortunately they have different magnitude (why?). I publish the plot and my codes, do you have any idea why this happened? Is there any problem in my codes? Or any problem in the obtained Fourier transform? Or any problem in Matlab built-in FFT function?



enter image description here I wrote this script to get those plots:


clear all;
fS = 500;
tStart= -4;
tStop= 4;
timeVector = linspace(tStart,tStop, (tStop-tStart)*fS );
fC = 2;
fB=2;
timeMask = zeros(1,length(timeVector));
timeMask((timeVector >= -fB/2) & (timeVector <= fB/2)) = 1;

psiWavelet = ((pi*fB))^(-0.5).*... % Morlet function
exp(2*1i*pi*fC.*timeVector).*exp(-timeVector.^2/fB); % Morlet function
% FFT plot by matlab bulit-in FFT function
Nfft =10*2^nextpow2(length(timeVector));
FFT =fftshift(abs(fft(psiWavelet,Nfft)));
freqs=[0:Nfft - 1].*(fS/Nfft);
freqs(freqs >= fS/2) = freqs(freqs >= fS/2) - fS;
freqs=fftshift(freqs);
figure(2);
subplot(1,2,1)

plot(freqs, FFT);
xlim([-1 5]);
xlabel('Frequency / Hz');
title (sprintf('Fourier Transform'));
% FFT plot by its direct fourier transfrom function
f_psi=exp(-(pi^2*fB)*(freqs-fC).^2);
subplot(1,2,2)
plot(freqs,f_psi)
xlim([-1 5]);

Answer




If you approximate the Fourier transform


$$X(f)=\mathcal F(x)(f)=\int_{-\infty}^\infty x(t)\,e^{-2\pi j\,ft}\,dt$$


by the discrete Fourier transformation for by sampling on the time segment $[-T,T]$ as


$$X(f_n)\approx \sum_{k=-N}^{N-1} x(k\tau)\,e^{-2\pi j\,f_nk\tau}\,\tau=s[n]\,\tau$$


with $T=N\tau$, $f_n=n/(N\tau)=n/N*f_s=n/T$, $n=-N,...,N-1$, $s$ the result of FFT on the sampled $x$ sequence after shift, ...


then you have to multiply the result of the FFT method by $\tau=T/N=1/f_s$.


Friday 29 July 2016

reward punishment - Implications of "According to Your fear is Your anger" ("כיראתך עברתך")


It says in Tehillim 90 (a chapter attributed to Moshe Rabbeinu, if that affects anything):



יא: מִֽי־י֖וֹדֵעַ עֹ֥ז אַפֶּ֑ךָ וּ֜כְיִרְאָֽתְךָ֗ עֶבְרָתֶֽךָ: לִמְנ֣וֹת יָ֖מֵינוּ כֵּ֥ן הוֹדַ֑ע וְ֜נָבִ֗א לְבַ֣ב חָכְמָֽה: 11 Who knows the might of Your wrath, and according to Your fear is Your anger. 12 So teach the number of our days, so that we shall acquire a heart of wisdom.




I saw in another translation: "According to the fear of You is Your anger."


I was trying to find out what all this means and saw the following gemara (Taanit 8a or thereabout) :



אמר רבי יוחנן כל המצדיק את עצמו מלמטה


מצדיקין עליו הדין מלמעלה שנאמר אמת מארץ תצמח וצדק משמים נשקף רבי חייא בר אבין אמר רב הונא מהכא (תהלים צ, יא) וכיראתך עברתך


§ Rabbi Yoḥanan said: Whoever is exacting with himself, by striving to act righteously in every way on earth below, he is judged in an exact manner in Heaven above, in order to improve him further still, as it is stated: “Truth springs out of the earth, and righteousness has looked down from heaven” (Psalms 85:12). Rabbi Ḥiyya bar Avin said that Rav Huna said that this idea is derived from here: “And Your wrath is according to the fear that is due to You” (Psalms 90:11). The level of God’s wrath correlates with the offender’s fear of God.


ריש לקיש אמר מהכא (ישעיהו סד, ד) פגעת את שש ועושה צדק בדרכיך יזכרוך הן אתה קצפת ונחטא בהם עולם ונושע אמר ריב"ל כל השמח ביסורין שבאין עליו מביא ישועה לעולם שנאמר בהם עולם ונושע


Reish Lakish said that this principle is derived from here: “You took him away who joyfully performed righteousness, those who remembered You in Your ways, behold You were wroth, and we sinned, upon them have we stayed of old, that we might be saved” (Isaiah 64:4). This verse also teaches that God displays wrath specifically due to the transgressions of those who are accustomed to acting righteously.




This is all very difficult to swallow. It seems to say that one who sins only occasionally is punished more harshly for his sins than one who sins frequently. How does it not fly in the face of the entire reward and punishment doctrine? (Is it suggesting, for example, that one is still rewarded for increasing observance, but with diminishing returns?)


We have a mitzvah to fear G-d at all times, said Rambam or maybe Rashi. But the assertion that "the level of God’s wrath correlates with the offender’s fear of God" is hardly encouraging in this matter. (How can we give our utmost in this mitzvah anyway?)


Finally, how does this all square up with the known idea (again I can't find the source, but I am quite sure it exists in Chasidus Chabad if not elsewhere--I think it is the primary thought underlying the over-the-top efforts we make for Pesach, for example) that one endeavors to go beyond the letter of the Law precisely out of love and gratefulness to G-d for His own chesed in dealing with us? It seems quite backwards that we should set ourselves up to incur punishment if G-d forbid we fell short of our ambitions.




organic chemistry - Structural representation of substituted benzene


Recently, I was watching a video about separating o-chlorotoluene and p-chlorotoluene from its solution. Following was a reaction demonstrated in the video:


enter image description here


I was curious about the structure of chlorotoluene. In this, the chlorine substituent was directly inserted into the benzene ring rather that attached to carbon atom. What does the bonding signifies? Is this structural representation correct? Does IUPAC recommend it? I couldn't find such type of image on internet not in any literature and thus I am skeptical about this representation.



Answer



Yes, this graphical representation of a substituted benzene is in accordance with Graphical Representation Standards for Chemical Structure Diagrams (IUPAC Recommendations 2008).



GR-9.4 Variable attachment location


In addition to allowing the type of attachment to vary, it may also be convenient to indicate that the attachment’s location is variable as well. This type of notation should be restricted to substituents that are known to be bonded to a specific ring, but at an unspecified or unknown atom of that ring. The substituent will always replace a hydrogen atom on one of the ring atoms, and cannot be bound to any atom that lacks an attached hydrogen atom. Unless explicitly specified otherwise, such diagrams imply that the substituent may be bonded to any ring atom that has an attached hydrogen atom. (…)




substituted nitrobenzene


halacha - Proper use of a blech/plata


What is the proper use of a blech/plata on Shabbat?




Organic chemistry - alkanes step up reaction


Well I was studying organic chemistry, and I came across this reaction for increasing the length of the carbon chain. Upon asking my teacher about the following reaction, she said she was unsure about it. Is this a valid reaction? And if it is, can you please provide the name of the reagent and the actual mechanism?


enter image description here



Answer



I think the reagent you're talking about is ketene (R=H in the figure below). It is a linear molecule (the central carbon is $\ce{sp}$ hybridized) and very reactive.


enter image description here


When mixed with an alkane and heated it dimerizes to form diketene rather than react with the alkane.



enter image description here


However, when irradiated with light, ketene will produce the reactive carbene "methlylene" ($\ce{CH2:}$). When this photolysis is performed in the presence of an alkane, the methylene will insert itself into the various $\ce{C-H}$ bonds like you've drawn. However the reaction is not synthetically useful for a number of reasons. For example, the $\ce{C-H}$ insertion reaction is very indiscriminate and a variety of products will be formed if different $\ce{C-H}$ bonds exist in the molecule.


hashkafah philosophy - What are Rambam's "עיקרים"?


Rambam, in his Commentary to the Mishna (Sanhedrin 10), enumerates 13 "עיקרים" or "יסודות", which he holds are the core "principles" that every Jew is expected to believe. (Summary in English.)



But what are these "עיקרים"? Are they axioms in a mathematical sense; a set of statements with which all Jewish beliefs and truths will follow? This cannot be, for certain "עיקרים" follow logically from others. For instance the tenth יסוד (God knows the actions of humans and is not neglectful of them) is implied logically by the eleventh (God rewards those who obey the commands of the Torah and punishes those who violate its prohibitions). The fourth יסוד (God existed prior to all else) follows from the first (God exists; God is perfect in every way, eternal, and the cause of all that exists; all other beings depend upon God for their existence). Thus, these "עיקרים" cannot be the core of an axiomatic system.


Are they simply what Rambam felt were the most important beliefs in Judaism, regardless of their logical dependencies? This is hard to understand. Why then, would Rambam count the Resurrection as an עיקר (the thirteenth) when it is never explicitly mentioned in Tanach alongside God's unity (the second), which is explicitly stated in a verse that we say twice daily? In other words, it makes Rambam's identification of the "most important" beliefs seem somewhat arbitrary.


So, in light of the above, my question is: What are these 13 עיקרים? What identifying factor separates them from all other statements that are true according to the Jewish faith?




gentiles - Wearing the star of David and wanting to learn more about Judaism


I was wondering if it would be considered rude or disrespectful to wear the star of David considering I was baptized into the catholic church and attend a catholic high school. I am very interested by the jewish religion, and I am wanting to learn more. I have many questions about my faith. To me the star of david is also a symbol of my father's love for Israel. My father spent close to a year in Israel and fell in love with the country, he is not Jewish by any means and was baptized Anglican but does not practice or celebrate the religion. It is a symbol of him for me because of his love and respect for the country.





minhag - Why do Sephardic Jews dress in black and white?


Many observant sephardim in Israel, especially those in yeshivot, dress in black and white. Does anyone know how this happened?


There is no tradition of Jews in North Africa or in the Middle East wearing European black and white clothing with black hats. On the contrary, richly colored fabrics and turbans marked traditional, respectful attire.



Besides the Sephardic Chief Rabbi dress, I can't think of anyone who has retained that tradition. Instead, many Sephardic Jews assimilated Ashkenazic styles. Why is that, and is there any documentation explaining the switch?



Answer



The only source I have yet to find acknowledging this switch in clothing from a Sephardic perspective is in the English edition to the Yalkut Yosef Hilkhot Shabbat. Under Siman 242, Halakhah 5, regarding the mitzvah to change from weekday clothes into more elegant garments, the editor (R. Yisrael Bitan) added a special footnote:



The Kabbalists ruled that one must wear white suits on Shabbat. Even so, in our time all the greatest Torah scholars are accustomed to wear black suits on Shabbat, and one should not act differently. If an individual chooses to be different from everyone else and wear a white suit, he is acting improperly; he is compared to a groom sitting among mourners. It important to explain this to those who begin observing mitzvot on their own (ba'ale teshuvah) so that they will conduct themselves as recommended by the Torah leaders of our generation.



This is directly opposing the Ben Ish Chai's position not to wear any black on shabbat (Ben Ish Chai, 2nd year, Lech Lecha #18). I also just came across an article from R. Marc Angel on the subject. He mentions personally talking with R. Mordecai Eliyahu, in the early 90's, on the Ashkenazic-assimilated dress code:



Rabbi Eliyahu responded: the Ashkenazic garb has become the "standard" garb for Talmidei Hakhamim, and Sephardic rabbis won't be taken seriously enough if they don't dress according to this fashion. When I said that the situation might be turned around if he and other Sephardic leaders made an issue of it, he said it wasn't worth it and it wouldn't succeed.




I haven't found a source explaining the process of assimilating the clothing, but I do remember hearing a shiur from R. Rakeffet, who explained that R. Ovadia's children went to Ashkenazic yeshivot because those institutions had the highest standard of Torah learning at the time. Such an environment, bearing in mind the already existing struggles of a stereotyped minority, could likely create the norm R. Eliyahu noted.


words - Why is hebrew, the holy language, so messy?


Something that has always bothered me and I've never really understood is why Hebrew is so messy. If it is the language of G-d, the language in which the world was created and the language in which the Torah was written, then why is it so complicated and weird in some aspects. Let me explain with some examples:



  1. There are multiple letters for the same sound (sin and samech, vav and bet, tet and taf).

  2. There are multiple sounds for the same letter (vav can be an u, an o or a v).

  3. Some letters have subdivisions (shin and sin, bet and vet, etc).


  4. Just five letters have a sofit version.

  5. Two nikkudot can have totally different sounds but be written exactly identical (such as kamatz, that can be an a or an o).

  6. Many sounds aren't in the Hebrew alphabet (like g in george, ch in change, etc).


I know every language has its rules, but how can Hebrew seem so "un imperfect"?



Answer



Many of your point are only relevant to Modern Hebrew, which is a distinct language from Biblical Hebrew, only the latter being a holy language. In fact, many orthodox Jews distance themselves from Modern Hebrew (to the point of prohibiting its use in their synagogues) because of what is deemed to be its inherent un-holiness.


Nevertheless, let me address each of your points separately:



  1. There are multiple letters for the same sound (sin and samech, vav and bet, tet and taf).



In fact, each letter used to have a distinct sound, but over the course of history, much of such distinction has been lost. The best preserving dialect of Hebrew is probably the Yemenite, where there is a clear distinction between waw/veth and dteth/taw. I even heard from an authentic Yemenite source that in some Yemenite villages a distinction between sin and samach remains, the latter being about half-way between sin and tsadi.



  1. There are multiple sounds for the same letter (vav can be an u, an o or a v). Some letters have subdivisions (shin and sin, bet and vet, etc).


This could be in explained in many ways. Here is a simplified Kabbalistic explanation: God created the world through the 10 vowels and 22 letters. Each represents fundamental concepts and their connections. Each word consists of a collection of such concepts and connections that together form the meaning of the word. (E.g. Av = Alef + Beth = Master + House = Master of the house.) Some letters need to show different aspects of themselves to correctly bring out the meaning.



  1. Just five letters have a sofit version.


According to the first opinion in Sanhedrin (as it happens, this is the view held by archaeologists too), the Torah was originally in Ksav Ivri which does not have these forms. In the time of Ezra, the original script was replaced by Ksav Ashuris which has these alternate forms. A further indication of this is that Sefer Yetzira (by Avraham Avinu) never mentions the final forms.




  1. Two nikkudot can have totally different sounds but be written exactly identical (such as kamatz, that can be an a or an o).


This is not an anomaly. Just as with the letters, each vowel also variants. Most have two length-variants. (E.g. Chataf segol/Segol, Chirik katan/Chirik gadol, Shva nach/Shva na') Again, the distinction between many such pairs have been lost by various groups, and mostly preserved by the Yemenites.



  1. Many sounds aren't in the Hebrew alphabet (like g in george, ch in change, etc).


No language contains all sounds made by man. However, the ones included in Hebrew are the ones that were fundamental to the Creation. One could argue that all other sounds a made up of combinations of the 32 (including their variations) that we have. (E.g. George = D + Z + Sh, Change = T + Sh.)


Memory techniques for torah?


What are some good mnemonics for remembering Talmud and Mishna? The Talmud refers to it as making simanim for what you learn.



Answer



Rav Arieh Yehuda from Modena wrote a wonderful book called Lev Haarie about the issue and in his introduction he addressed the midrasdim examples, Tora niknet besimanim etc..


The Shaar in Hebrew books



He uses a technic called zikaron hamekomi, which is not a Jewish/torah royalty


The better mnemonics are always the mnemonic you invented yourself.


To hear yourself and a good pronunciation. Learn again even if you already know it, endlessly, all this is in Talmud. In gemara, there are also sgulot, thi ngs that lead to forgetness or to rememberness


Thursday 28 July 2016

technology - Why do music tapes and CDs warn about playing on Shabbos?


I have seen written on almost every music CD and Cassette Tape that I have in my house the line:



Please do not play on Shabbos and Yom Tov




I've always wondered if this is really necessary. Does not having this line make the seller an accomplice to the one who transgresses on Shabbos?


More importantly, though, how did this practice originate? Last time I bought a chicken at my local butcher, I don't recall seeing a sign "please do not cook on Shabbos". Actually, I don't remember seeing this anywhere else. So why music?




organic chemistry - Simple experiments involving enantiomer synthesis


I want to do an experiment to investigate factors affecting the synthesis of chiral molecules. The only problem is, my institution doesn't have much money, and it seems like the chemicals required for any experiment involving chiral molecules are very expensive!


My initial research found an experiment based on the Bürgi-Dunitz trajectory (see Addition to Carbonyl Double Bonds), but with the use of L-Selectride it isn't the cheapest. I then researched the Diels-Alder reaction, but the conjugated dienes are also relatively expensive, or are only available in large quantities!


I am only an amateur in the field of chemistry, and much of the interesting material is very hard to find unless one knows the specific terms to use. Now I come to you for help - are there any cheap experiments involving the synthesis of enantiomers? Other than cost, the constraints are:



  • Equipment: standard laboratory equipment is available, but nothing too fancy

  • Aim: the experiment needs to investigate something, for example factors affecting the synthesis of L and D enantiomers. Two different chiral auxilliaries or catalysts would do well here.




Answer



If you have some way of measuring the enantiomeric excess of the product mixture, I suggest trying proline catalysis of an aldol reaction. The materials are cheap / readily available, and the reaction setup is straightforward. Proline is probably the cheapest chiral catalyst available.


Here is a procedure for an organic chemistry lab run at Rutgers that might get you started: http://chem.rutgers.edu/sites/default/files/coursefiles/Courses_f09/310/Procedure_Proline_Catalysis.pdf


thermodynamics - Which one really determines how people feel. Heat or temperature?



We use water to cool down some machines because water has high heat capacity, which means it takes more energy to increase 1 degree. Heat transfer occurs only when temperature is different. We cool down the machine because we don't want it to be too hot, but what does the hot mean? The temp or the heat? When we touch water and another liquid at the same temperature but contain different heat. We feel the heat or the temp?




product recommendation - Is there anything like a "Tikun Korim" for Nach?


Is there a printed text like a תיקון קוראים for learning נ"ך, where one side has the כתיב without נקודות or טעמים?




Why is signum function used to calculate Fourier transform of unit step function


I read in a standard textbook that the Fourier transform of unit impulse function is calculated with the help of approximations and signum function as the integration of unit impulse does not converge. What's so special about signum function that it is used to calculate Fourier transform? I tried to find out an approximation as:


$$ \lim_{ a \rightarrow 0 } \int_{-\infty}^{+\infty} e^{-at} u(t) e^{-j\omega t} dt $$


But I am getting wrong result. Why is this so?




Wednesday 27 July 2016

derabanan - Translation of 'Takana'



What would a fitting colloquially accepted translation of the word takana be? Assuming we are dealing of course with a rabbinic decree and so as to convey the intent as apposed to 'gzeira', 'syag', 'mishmeres' and such.




first person pronouns - Is there a dialect where older men refer to themselves as あたし?


I remember reading that there is a dialect in which older men refer to themselves as あたし. It didn't have a feminine connotation, it may have even been a bit rough.


I think I read it on Wikipedia, but being as I can't find it now, I wonder if it was a prank edit. I'm also pretty sure it was a Honshu dialect.




Answer



Looks like the reason I couldn't find it was because someone recently rewrote the Tokyo dialect article on Wikipedia (by chance the old page was still cached and served to me!). It said, "Atashi is a feminine first person in standard Japanese, but in Shitamachi dialect, it is often used by both men and women."


Sorry if I threw anyone off by limiting it to older men. I think my brain just associates Shitamachi with older people (maybe because of this).


I also found this goo question which was answered with 「あたし」は男女問わず東京弁です。特に男が使うのが下町の特徴です。 (Forgive the translation: Tokyo-ben's atashi isn't connected to gender. In particular, it's a trait of the Shitamachi men who use it.)


Unfortunately, the Wiki wasn't well sourced, and well the goo site isn't definitive either.


By the way, I found a few links that agree with what YOU said about being used by rakugo professionals.


minhag - Kiddush Levanah - Saying Aleichem Sholom with the other person?


As discussed here, while doing Kiddush Levanah, we say "Shalom Aleichem" to 3 other people, and they respond back with "Aleichem Shalom". I've seen some people saying "Aleichem Shalom" together with the person responding to their "Sholom Aleichem".


Is this a custom? Is there a source for it? I didn't see anything written about it in the Siddur.



Answer




http://hebrewbooks.org/pdfpager.aspx?req=7167&st=&pgnum=56


The Sefer Zohar HaLevana explains that the reason we say Shalom Aleichem and then say Aleichem Shalom together, is that the first day Eliyahu Hanavi comes to announce the coming of Moshiach (three days before Moshiach comes), he will say "Shalom Ba L'olam, Shalom Ba L'olam". Therefore, after we say "Dovid Melech Yisroel..." (which refers to Moshiach) we also say Shalom twice, in the form of "Shalom Aleichem, Aleichem Shalom". [and if so, why do we not say it before "Dovid Melech..."? Because real peace will only come once Moshiach comes.]


Also, Zvi Ron quotes 16th Century Kabbalist R' Hertz as follows (see page 246 footnote 26):



after praying for the coming of the Messiah by saying ‘David, King of Israel, is alive and enduring,’ “since the birth pangs of the Messiah are many, it is incumbent upon us to pray and say each person to his friend ‘Shalom Aleichem, Aleichem Shalom.’ ”



halacha - Is one allowed to be fat?


Is one halachically allowed to be fat (overweight or obese), or must a fat person take steps to reduce their weight and maintain a reasonably healthy body (and likewise, a healthy person must not allow themselves to gain weight to an unhealthy degree), due to shmirat hanefesh?


Inspired by the recent shmirat hanefesh questions regarding smoking and marijuana



Answer



There is a basic halacha of "Ushmartem es nafshosechem" - loosely translated to mean that a person is obligated to maintain their body in good health. The reason for this is twofold:


Firstly, your body is only yours on loan from Hashem, and just as a shomer is obligated to guard and protect an object given to him for safekeeping, so too a person has to protect his body and ensure it is in excellent condition. Since obesity is destructive to a person's well being, being obese, or for that matter not taking action to keep your body healthy, would be in violation of "Ushmartem es nafshosechem" as you are being derelict in your duties as a shomer.


Secondly, keeping Torah and Mitzvot requires vigour and enthusaism, and a perpetual sense of "Ivdoo es Hashem Besimcha". These requirements are often compromised when one is obese or unhealthy, which may lead to lethargy and melancholy, both which will adversely affect ones avodat Hashem besimcha.


These above comments can be added to if we take into account chassidic aspects of indulgence in food. Put simply, there is a basic doctrine of "hiskafya", which simply means self-restraint. That is, restraining ones self from excessive eating for purely pleasure, rather than eating for maintaining ones health. There is a well known chassidic saying: "What is forbidden - is forbidden. And what is permissable - is not necessarily to be done".



Why does calculating formal charges help us draw correct Lewis structures?


Reading about how to draw Lewis structures, all I know is that formal charge is the charge assigned to an atom in a molecule assuming that electrons are shared equally, regardless of differing electronegativity between atoms. It is just a concept used to arrive at the correct Lewis structure and does not represent actual charges on atoms. But what I don't understand is, why does using this concept lead us to the correct structure?


For example, right now I am looking at the example of the sulfate ion. I get to this point before formal charges need to be calculated:


enter image description here


All the atoms have an octet around them (though I'm aware sulfur can have more than eight electrons around it), but it is not the correct structure. Why does considering the formal charge give the right structure, if as stated above it doesn't reflect any actual charges? It also says on Wikipedia "Formal charge is a test to determine the efficiency of electron distribution of a molecule. This is significant when drawing structures.", but I am not sure what it means by this.




What is the longest word in Japanese?


What is the longest (based on their representation in romaji) word in Japanese? Are there any longer than リュウグウノオトヒメノモトユイノキリハズシ? If it depends on criteria for a word, then list them by their criteria.


Background: I'm wanting to use a long word for a JRuby bug report, and I think that floccinaucinihilipilification is pretty worthless. Wikipedia's article on Longest words (by language) is currently lacking an entry for Japanese.





parshanut torah comment - Why didn't Mordechai keep Mitzvos -- serious edition


It says in the Megilla "ויאמרו עבדי המלך אשר בשער המלך למרדכי מדוע אתה עובר את מצות המלך" - "The servants of the King (who were in the King's gates) asked Mordechai 'Why do you go against the command of the king'"?


It's known (Esther Rabbah 3:10) that "the King" in the Megilla refers to Hashem. Why did Mordechai do an Aveira?




Answer



I once heard an explanation - will have to see if I can find the source - that these other servants (Jews, presumably) held with the opinion later expressed by Rambam (Hil. Yesodei Hatorah 5:1,4) that one who risks his life to keep mitzvos when not required to do so (i.e., when it's not one of the "big three," the non-Jew is doing it for his own benefit, it's not in public, and not at a time of religious persecution) is "liable for his own death."


In this case, then, the bowing wasn't being commanded as an act of idolatrous homage (or, even if it was, it might have been a case of עובד מיראה - see Tosafos to Sanhedrin 61b, ד"ה רבא). They thus protested that Mordechai is transgressing the halachah in endangering his life for this purpose.


(His reply, then, was אשר הוא יהודי - he is a prominent Jew and as such has to hold himself to a higher standard to make a public kiddush Hashem - see the second answer of Tosafos ibid.)


halacha - Mail Delivery on Shabbos


Can you take in the mail on Shabbos?



Answer



Certainly some mail deals with matters which are inappropriate reading material for Shabbos and one would not be willing to use them for other purposes, accordingly this mail is muktzeh and cannot be handled on Shabbos. (See Mishneh Berurah 307:56, It is not clear to me that one is prohibited to handle mail which one does not know to be in such a category out of fear it is.)


Regarding other types of mail:


The Bi'ur Halachah (340:14, הניר ), as I understand it, explains that when a letter is enclosed in an envelope then according to everyone ripping it open is מקלקל (destroying) and only prohibited by Rabbinic law (though he continues to cite an opinion of Rashi which may render this not to be the case). HaRav Shlomo Zalman Aurbach zt'l challenges this opinion since typically destroying a "utensil" for the sake of extracting its contents is permitted (provided, of course, no melachah is involved). Insofar as/provided that one is no making a neat slit to use the envelope to store the letter but simply destroying it and discarding it, it should be permitted. (See שמירת שבת בהלכתה כח הערה טו). Rav Moshe Feinstein zt'l, on the other hand, agrees that opening an envelop is prohibited and therefore it's muktzeh (אגרות משה או"ח ח"ה סי' כא ס"ק ה, interestingly he notes with the advent of telephones the leniencies associated with reading letters which may contain urgent information is no longer relevant). [Of course this is the type of thing one really needs to discuss with their Rav]



Not all mail is enclosed in an envelope. If my subscription to Jewish Observer showed up a couple days late it would not require any tearing for me to read the articles. Such mail certainly does not become muktzeh (simply) because it is forbidden to open the (non-existent) envelope.


Regarding mail which is brought from outside the techum (the perimeter 2000 amos around the settlement one is located in, past which it is prohibited to travel on Shabbos):


An item which is brought on Shabbos from outside of the techum for the sake of a Jew is prohibited for that Jew to benefit from (until enough time has elapsed after Shabbos for the action to have been completed then). Other Jews, however may benefit from the item, and furthermore even to the Jew for whom it was brought the item is NOT muktzeh. (See O.C. 325:8 and Mishneh Berurah 307:56, though the above mentioned אגרות משה appears strict in this regard).


Certainly if it can be verified by local Rabbonim that the mail delivered on Shabbos arrives within the techum prior to Shabbos (or presumably when the mail originates within the techum and delivery is such that it would not be removed prior to delivery) the outside the techum issue is not applicable.


It would seem that there may be basis to bring in the mail from the mail-box (provided there is an eruv). If however there is mail which IS muktzeh mixed in with mail permitted to be handled it probably constitutes a teruvos (mixture) to which the laws of borrer (selecting) apply and one could only select the permitted mail, by hand, immediately prior to when one is going to read it. On the other hand, there might be basis to handle the entire mixture at once, especially if the majority is permitted (probably not though).


So it seems to me. There are a lot of different issues at play, many of which have a number of divergent views among the Poskim, certainly something to get a psak from your Rav about before acting l'maaseh.


marriage - Why only 100 zuz to a widow/divorcee?


In a Ketubah, the Rabbis instituted that a man should obligate himself to pay his wife, should he chose to divorce her (or he dies). If she had never been married before, he obligates himself to pay 200 zuz. If she was previously married, he obligates himself to pay 100 zuz. (See Rambam Hilchot Ishut 10:7) [That is the minimum, he could offer more if he wants]


The Bartenura on Mishnayot Peah 8:8, says that 200 zuz is enough to support someone for one year.


If that's the reason the husband promises 200 zuz, why is he only obligated to pay 100 zuz to a widow/divorcee? Why did the Rabbis feel it was enough to support her for only half a year?


If that's not the reason, what is the reason for the discrepancy between a previously unmarried woman, and a previously married woman?



Answer




I'm not sure if I understood this correctly, feel free to point put any mistakes.


The Yad Eliyahu, after much back and forth, seems to say that:




  • The reason for a monetary obligation is, as the Rambam (Hilchot Ishut 10:7) says, in order to make sure that it should not be of little import for a man to kick his wife out of the house.




  • The Rabbis agreed that 100 zuz is enough to ensure this. (even though if a person is wealthy 100 zuz is nothing, this is a substantial sum for a poor person and therefore the Rabbis settled on this sum, so that law would equally apply to everyone)





  • There is an argument in the Talmud (Ketubot 10A) if the money obligated by the Ketubah is a Biblical or Rabinical Decree. According to the one who says it is Biblical, we learn it out from Exodus 22:15-16, "he shall pay money according to the dowry of virgins.". From Devarim 22:29, we learn that the dowry of virgins is 50 Shekalim.




  • [It would appear that everyone agrees that the monetary obligation for a widow etc. is Rabinical, the only discussion is whether the monetary obligation for a virgin is the same]




  • However, most agree that (at the very least the amount of) the monetary obligation is Rabinical. The Rabbis who instituted the amount would have settled by 100 for everyone, but because the verse does mention that a virgin's price is 50 Shekalim (200 zuz), the Rabbis made that the monetary obligation for a virgin, leaving the monetary obligation of a widow etc. at the price they already thought was enough.




See Kobetz Al Yad HaChazaka as well.



local features - difference between Gabor and log-Gabor function


I am reading a paper using log-gabor filters for feature detection. I was thinking about the difference between Gabor filters and log-gabor filters. Can anyone tell me the difference(s), and a way to implement them? Thanks in advance.



Answer



The 1D gabor filter has the following form in the frequency domain:


$$G_{b(\sigma,\omega_0)}(\omega) = \text{exp}\left(-\frac{\sigma^2}{2}(\omega - \omega_0)^2\right)$$


The 1D log-gabor filter is:


$$G_{l(\sigma,\omega_0)}(\omega) = \text{exp}\left(-\frac{\ln^2(\omega/\omega_0)}{2\ln^2(\sigma)}\right)$$


Log-gabor filters are used because they have 0 DC component for arbitrary large bandwidth, and size distribution of features in an image is often logarithmic.


The excellent paper On the Choice of Band-Pass Quadrature Filters by Djamal Boukerroui, J. Alison Noble and Michael Brady explains further differences for these two filters as well as others.


Here is some MATLAB code for the 2D version:



[rows, cols] = size(I);

% FFT mesh
[ux, uy] = meshgrid(([1:cols]-(fix(cols/2)+1))/(cols-mod(cols,2)), ...
([1:rows]-(fix(rows/2)+1))/(rows-mod(rows,2)));
ux = ifftshift(ux); % Quadrant shift to put 0 frequency at the corners
uy = ifftshift(uy);

% Convert to polar coordinates
th = atan2(uy,ux);

r = sqrt(ux.^2 + uy.^2);

% Create spectrum
filterFFT = 1.0/wavelength;
filterFFT = exp((-(log(r/filterFFT)).^2) / (2 * log(sigma)^2));
filterFFT(1,1) = 0;

% Filter image
I_filtered = real(ifft2(fft2(I) .* filterFFT));


Advantage of 0 DC


The advantage of having 0 DC component is that the response of the filter doesn't depend on the mean value of the signal. It also means you don't have an infinite impulse response. The Gabor filter has a small non-zero component around DC that is usually removed.


For feature detection, say you designed a filter kernel to match a step (1D) or edge (2D). If the filter had a DC component then the response would vary with the mean image level. e.g. consider the sobel edge detector, and the same kernel with increased values.


I = double(imread('the_image.jpg'));
I = I(:,:,1);
f1 = [[-1 0 1];...
[-2 0 2];...
[-1 0 1]];
f2 = [[0 3 4];...
[1 3 5];...

[0 3 4]];
I1 = conv2(I,f1,'same'); images(I1); colorbar; pause;
I2 = conv2(I,f2,'same'); images(I2); colorbar; pause;
I3 = conv2(I+100,f1,'same'); images(I3); colorbar; pause;
I4 = conv2(I+100,f2,'same'); images(I4); colorbar; pause;

In this code f2 = f1 + 3. Only convolving with f1, which has 0 DC, gives the same result when the mean value of I is changed. The image responses 'look' the same, but only the 0 DC one is useful for feature detection.


Matlab produces two unknown spikes in custom FFT


I'm making a relatively small Cooley–Tukey FFT in Matlab and I'm noticing unusual spikes in the result compared with Matlab's own FFT.


The figure below shows the signal flow of my program. It's a standard Cooley-Tukey scheme. Signal Flow


My results when computing the FFT of a 16 Hz sinusoid are shown below


enter image description here



And Matlab's own FFT is shown below


enter image description here


Clearly I'm missing something. What could be the cause of the two large spikes in the middle? I conjecture that it has something to do with how the even and odd parts are combined, for instance if there is a discontinuity there. I'm really not sure though.


Any help is greatly appreciated!


The code I'm using is as follows


clear all

% Generate input data sequence and plot
N=128;
f1=16;

num_cycles=2;
fs=f1*N/num_cycles;
x_time=0:1/fs:num_cycles/f1-1/fs;
x=sin(x_time*2*pi*f1);
plot(x_time,x);

% split inputs into even and odd samples and compute fft of each division
X_o=x(1:2:N);
X_e=x(2:2:N);


fft_x_o=fft(X_o);
fft_x_e=fft(X_e);

% Generate base twiddle factor
W32=exp(-1i*2*pi/32);

% Combine fft even and odd with twiddle factors to produce final output
for k=0:N-1
if k X(k+1)=fft_x_e(k+1)+(W32^k)*fft_x_o(k+1);

else
X(k+1)=fft_x_e(k+1-N/2)+(W32^k)*fft_x_o(k+1-N/2);
end
end

% plot butterfly fft and matlab fft
FFT_xaxis=0:fs/N:fs-fs/N;
figure
plot(FFT_xaxis,abs(X))
title('Butterfly FFT')

xlabel('Frequency')
ylabel('Magnitude')
matlab_fft=fft(x);
figure
plot(FFT_xaxis,abs(matlab_fft))
title('Matlab FFT')
xlabel('Frequency')
ylabel('Magnitude')

Answer



The following is the corrected code. It seems you have the problem in the twiddle factor and the selection of even and odd samples of x[n]...



N=128;
f1=16;
num_cycles=32;
fs=f1*N/num_cycles;
x_time=0:1/fs:num_cycles/f1-1/fs;
x=sin(x_time*2*pi*f1);
plot(x_time,x);

% split inputs into even and odd samples and compute fft of each division
X_o=x(2:2:N); % odd samples begin at x(2) --> x[1] in sequence

X_e=x(1:2:N); % even samples begin at x(1) --> x[0] in sequence

fft_x_o = fft(X_o, N/2);
fft_x_e = fft(X_e, N/2);

% Generate base twiddle factor
WN=exp(-1i*2*pi/N);

% Combine fft even and odd with twiddle factors to produce final output
for k=0:N-1

if k X(k+1) = fft_x_e(k+1)+(WN^k)*fft_x_o(k+1);
else
X(k+1) = fft_x_e(k+1-N/2)+(W3N^k)*fft_x_o(k+1-N/2);
end
end

% plot butterfly fft and matlab fft
FFT_xaxis=0:fs/N:fs-fs/N;
figure

plot(FFT_xaxis,abs(X))
title('Butterfly FFT')
xlabel('Frequency')
ylabel('Magnitude')
matlab_fft=fft(x);
figure
plot(FFT_xaxis,abs(matlab_fft))
title('Matlab FFT')
xlabel('Frequency')
ylabel('Magnitude')

Tuesday 26 July 2016

grammar - What is the difference between べからず and べからざる?


In my JLPT practise book, I have the following question:




A:噂にまどわされる_____、とは言うものの・・・。


B:つい、信じちゃうよね。



  1. べく 2.べき 3.べからざる 4. べからず



I knew the answer was between 3 and 4, but I couldn't make a final decision on why I would choose one over the other. According to the book, the answer is 4.


According to the book's explanation, at least as I understand it, べからざる means something can't be allowed, and べからず means something must not happen.


However, both have a certain amount of logical sense in the question above. Assuming I understand it correctly (which I probably don't), it's either saying "we can not allow ourselves to be deceived by rumours", or "we can't be deceived by rumours", depending on whether we use べからざる or べからず.



What is the difference that I'm not seeing?



Answer



SUMMARY


Options 3 & 4 both mean "must not" because they are both variations on べきではない tested at JPLT N1 (in fact べからざる is a variation on べからず (see on)). The trick is to understand which best fits the context of the sentence when we apply "usual" JLPT level N1 definitions but even if we do not fully understand the context we can still get the question right if we know the grammatical rules (接続の仕方).


TECHNICAL DEFINITIONS


べからず is used for injunctions (ie prohibitions such as "Do not..") and is an old written form not generally used but sometimes written on bulletin board/notices. As a result it is quite likely to appear in a quotation. eg:



(公演で)「芝生に入るべからず」|([Notice] at the park) "Keep off the grass"



べからざる is the form of べからず that modifies nouns ie VるべからざるN. eg:




彼は我がチームには欠くべからざる選手である。|Mr A is (an) indispensable (player) on the team.



(And, just for the sake of completeness, べき is the form of べく that modifies nouns ie VるべきN.]




APPLICATION (COMPREHENSIVE ANSWER)


If we apply these principles to the question:



A:「噂にまどわされる_____、とは言うものの・・・。」


B:「つい、信じちゃうよね。」



1.べく 2.べき 3.べからざる 4. べからず



Step 1: Read and (try to*) understand the context of the passage to eliminate the obvious incorrect answers:


A: "Although it says _ be distracted by the rumours,...."


B: "I just took them as face value, didn't I."


The gap is most likely to be filled by a prohibition (ie an injunction such as "Do not...") rather than a command ("Do...."). This eliminates options 1 & 2.


Step 2: Look at next option: 3. べからず is used for injunctions and this is a quotation so without looking at 4 we know this is a good candidate for the correct answer.


Step 3: Option 3 is confirmed as correct by looking at the remaining option: 4 べからざる is just a variation on 3. べからず which is used to modify nouns (VるべからざるN). Although it literally means the same as 3 grammatically it does not fit as well / at JLPT level N1.


*Note: I am sure somebody can improve on my translation but it is good enough for the question!


References: The references I used to write this answer were 日本語表現文型辞典 & 総まとめ 文法N1 but once you've done enough questions you can intuitively "guess" the right answer just using step one (that's what I did here and last July).



electronegativity - Relative strengths of hydrogen bonds



Order of hydrogen bond strength:


$\ce{O-H...N}$ > $\ce{O-H...O}$ > $\ce{N-H...N}$ > $\ce{N-H...O}$. Why is that so?



According to me $\ce{O-H...O}$ should have the maximum strength while $\ce{N-H...N}$ should have the weakest hydrogen bonds based on the fact that oxygen is more electronegative than nitrogen. It would develop a higher $\delta^-$ charge and the hydrogen attached to it will have a higher $\delta^+$ charge which would make the hydrogen bonding stronger.


I can't reason out the order given in my textbook. After observing it, all I can guess is that oxygen being highly electronegative leads to higher $\delta^+$ charge on hydrogen while nitrogen being less electronegative easily shares its electron cloud with hydrogen, making the hydrogen bond stronger.


I am not sure about this reason as according to this it is more stable for hydrogen to make a hydrogen bond with a less electronegative element and possibly even an electropositive element, (unless and until the hydrogen is attached to a highly electronegative element), which does not occur in normal circumstances.


It would be great if anybody could help me figure out the reason for the above trend.




Answer



As a short answer, Hydrogen bonds (for elementary chemistry) are formed with donation of lone pair of a lewis base into LUMO of H attached to a highly electronegative atom. A better donor makes a better bond and more electronegative atom makes a better bond. From my experience, the second factor overrides the first one in most cases.


N is a better donor than O and H in $\ce{O-H}$ is a better acceptor than H in $\ce{N-H}$.


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 「ない...