Application of Newton's second law In an international exam of physics for high school students it was asked to find the weight $W$ according the situation shown in the figure. The surface is frictionless. 

Mathematically, the answer is $W = \dfrac{m_1ga}{g-a}$, were $a$ is the acceleration of the masses. But I think that this is not consistent if you check for particular values or extreme cases ($m_1 = 0$ or $a=g$).
To find this answer the weight is used in the right hand side of $\sum \vec{F} = m\vec{a}$, which I think is not acceptable. What do you think?
 A: When examining results from specific applications, like this equation, one must keep in mind the functional dependence of the quantities. In this case, changing $m_1$ causes $a$ to change, so you can't  treat those to variables separately.
Re-arranging this result to exclude denominators you get $$W(g-a)=m_1ga.$$ Now you see that if $a$ approaches $g$, the left side goes to zero (because we choose $W$ to remain finite, non-zero). That means that $m_1$ must be zero (because $g^2\ne 0$). Conversely, if you want to examine $m_1$ getting small compared to $W$, then $(g-a)$ must get small, too, and because $g$ is fixed, $a \to g$.
For finite $W$ and $m_1$, the result is fine and there is no inconsistency.
Bottom line: Be careful when making denominators approach zero. Make sure that you know the functionality of the numerator, too.  This is an important caveat for all areas of physics when you're investigating boundary cases of equation results.
A: First thing physics to a large extent has a great foundation.IF this equation is given it has been proven it is 'ACCEPTABLE'. lets say a=g(but this usage is wrong for this question) as you say..in this case check the equation.When acceleration is 'g' according to the equation weight of object is 'UNDEFINED' this in physics means any value of weight is acceptable.Logically if you see  when acceleration itself is 'g' it could mean that that mass placed on the trolley has no weight hence no tension in the string hence no tension force to oppose weight of the object given hence a free fall condition.When m1=0,put denominator of the given equation on the other side.This could mean that either a tends to g as bill said or weight of the object hanging could be zero if possible.This more better way to put it.
Coming to the question here the mass of both the blocks is 'DEFINED'.Keeping that in mind question has been framed and hence this case a=g is not possible if the blocks have some weight.Newtonian mechanics holds good to a large extent.Tension acts force equations are used and huff! answer is here...Newtonian mechanics doesn't work well with very very tiny objects showing wave like characteristics but here these are well defined large objects.
A: One thing that you can do to help look at your limiting cases is to put in terms of masses:
$$ W = m_2 g = m_1g \cdot \frac{a}{g-a},$$
thus
$$ m_2 = m_1  \cdot \frac{a}{g-a}. $$
First look at the limit where $a \geq g$. Then the relationship will be $m_2 = -\alpha m_1$, where $\alpha$ is a positive constant. The negative doesn't make sense because we are dealing with masses. 
However, thinking about that physically, if $a \geq g$, then it requires an additional force to drive down -- gravity is not sufficient because it is hindered by the tension in the string.
Now look at the case where $a < g$. This gives us that $m_2 < m_1$, which can is physically viable.
Specifically look at the case where $a=0$. Then, $m_2 = 0$. This implies that for any mass $m_2$, there has to be some acceleration $a$. This is consistent with what we know about physics.
