Wikipedia:Reference desk/Archives/Mathematics/2008 January 11

= January 11 =

Does an integer solution exist for this equation?
For the Diophantine equation: 10*X/Y+X^2/Y^2=4, are there integer values for both X and Y such that this equation is true. If there are solutions what method do I use to solve equation in this form[ A*X/Y+(X/Y)^2=B ; where A and B are constant integers and X and Y are variables]? 24.250.129.216 (talk) 00:28, 11 January 2008 (UTC)1337haxor


 * You can transform this equation to (X/Y + A/2)^2 = B + A^2/4. So X/Y = ±sqrt(B + A^2/4) - A/2 = (±sqrt(4*B + A^2) - A)/2 and there are solutions only if (4*B + A^2) is a perfect square, because else X/Y would have to be irrational or complex. Icek (talk) 01:12, 11 January 2008 (UTC)

What kind of function/shape of curve...?
Hi all - a question (more office work than homework, BTW).

Say you had a large number of boxes (n), each containing the same number (x) of items. At random, you remove items from boxes one at a time, without replacement. What kind of function would you have if you graphed number of completely emptied boxes against number of items removed? My guess it would be some form of sigmoid shape, but beyond that I'm at a loss to know what kind of function you'd get. Any ideas? Thanks in advance, Grutness...wha?  02:05, 11 January 2008 (UTC)
 * When you say 'at random', do you mean that you pick a box at random, then pick a random item from it, or that you somehow pick at item at random from all those remaining? Algebraist 02:23, 11 January 2008 (UTC)

Ah. Good point. I meant at random overall (e.g., if you had 1000 numbered marbles in one bag you were drawing from, and wanted to know at what rate "decades" of numbers would be completely removed). Mind you, knowing the solution to the other randomisation would also be interesting... Grutness...wha?  05:59, 11 January 2008 (UTC)


 * Then, the problem you are thinking of is related to the multi-hypergeometric distribution. This doesn't mean that the article can give you an easy formula for solving this issue, I'm afraid.
 * The other possible formulation of the problem is (I guess) much more complex.
 * Eventually, you could feed a spreadsheet or a CAS with a model of your problem and simulate for estimates. Pallida  Mors  07:14, 11 January 2008 (UTC)


 * The number of empty boxes is the sum, taken over all boxes, of the following quantity, which is a random variable:
 * 1 if box #i is empty, 0 otherwise.
 * Because expected value distributes over sum, the expected number of empty boxes is equal to the sum of the expected values of these 0-or-1-valued random variables. That expected value equals the probability that box #i is empty. Because of the symmetry in the problem, this probability is the same for each box. Calling that probability p(n,x,t), where n and x are as above and t is the total number of items removed, the expected number of empty boxes is the sum of n copies of this, which amounts to n·p(n,x,t). So we can fix our attention on one box, and try to determine the probability it is empty after t items have been removed. This can be done combinatorially, since each subset of size t of the original set of nx items is equally likely to have been removed. There are C(nx,t) such subsets, where C(n,k) = n!/(k!(n−k)!) denotes the number of possible combinations when choosing k elements from a set of size n. If we divide the number of combinations that results in a given box being emptied by this number of total combinations, we have the probability we want to determine.
 * So how many combinations are there, among those C(nx,t) combinations, that contain a marked subset of x items – the items of a given box? Let T be the total original set of nx items, M the marked subset, and let R be a combination of t chosen items containing all of M. Then S = R−M is a subset of t−x items of T−M (where "−M" denotes "set subtraction", also often denoted "\M" and called relative complement). Conversely, given any subset S of t−x items of T−M, the set R = S+M (where "+" denotes set union; in this case the two "summands" are disjoint) is a subset of t items of T containing all of M. So there is a one-to-one correspondence between such sets R and such sets S, and to count the former we can count the latter. But that count is, of course, simply C(nx−x,t−x), and so p(n,x,t) = C(nx−x,t−x)/C(nx,t).
 * The expected number of empty boxes is then:
 * n·C(nx−x,t−x)/C(nx,t) = A(n,x)·t!/(t−x)!, where A(n,x) = n·(nx−x)!/(nx)!.
 * This will not look like a sigmoid when plotted against t. --Lambiam 23:04, 11 January 2008 (UTC)

Thanks for all that - I think I can probably work it from there (although it's a little more advanced maths than I can do easily). Cheers. Grutness...wha?  23:59, 11 January 2008 (UTC)

Recognizing another form of the derivative
There are two expressions of which I have to find the limit as x approaches 0:

(√(3+x) - √3)/x and ((1/(2+x)) - (1/2))/x.

I know that direct substitution fails because it produces an indeterminate form in each case, so I basically know that each expression is a disguised form of the derivative. I have a vague recollection that in cases like these, I'm supposed to take the derivative of the minuend of the numerator. I tried, but I got 1/(2√3) and -1/√(x+2) respectively rather than the answers given in the textbook, (√3)/6 and -1/4. How do I find the expression of which to take the derivative to find these limits? Thanks, anon —Preceding unsigned comment added by 141.155.22.61 (talk) 03:22, 11 January 2008 (UTC)


 * Not the minuend of the numerator, no. See L'Hôpital's rule for what to do in indeterminate cases. Gscshoyru (talk) 03:25, 11 January 2008 (UTC)
 * Yeah, you could apply L'Hospital. Or then again you could actually bother to understand what's going on. You were on the right track with the "disguised form of the derivative" comment.  What's the definition of the derivative? Can you work backwards to find a function, in each case, that makes the definition of derivative look like the limit you're trying to find? --Trovatore (talk) 03:34, 11 January 2008 (UTC)


 * Trovatore is speaking of the fact that every derivative is a limit, or in other words:
 * $$f'\left(x_0\right)=\lim_{x\to 0} \,

\frac{f\left(x_0+x\right)-f\left(x_0\right)}{x}$$
 * So, if you know the f's for these "disguised derivates" and know basic differentiation rules, you are done.
 * If you want another way, the second limit is easy to calculate and doesn't need L'Hôpital. The first one needs no more than algebra, either, if you apply the transformation substitution y=x+3. Pallida  Mors  05:03, 11 January 2008 (UTC)


 * Taking f'(0) to find the limit of (f(x)−f(0))/x as x tends to 0 should work for both cases. You can also simplify the second form algebraically, which leads you directly to the result. For an algebraic approach to the first case, first multiply the numerator and denominator each by √(3+x) + √3, expand the numerator, and simplify. --Lambiam 10:32, 11 January 2008 (UTC)

Does the OP (or anyone else) realise that he actually has the right answer to the first problem but in a different form to the book answer?  Sp in ni ng  Spark  20:07, 11 January 2008 (UTC)

Logical simplification
$$\neg Q \land T \lor Q$$

Does this statement simplify to:

$$\neg Q$$

or

$$\neg Q \lor Q \equiv T$$

Depending on whether I match the True with the AND or the OR? This is the last key stage in showing a more detailed statement is a tautology. As you can see one resolves the issue, and one does not. —Preceding unsigned comment added by 91.84.143.82 (talk) 13:21, 11 January 2008 (UTC)
 * I don't think there is a universally understood convention as to the order of operations here, so the expression is basically meaningless. Indeed, depending on where the parentheses should be, it could mean any one of the options you gave. If you got this expression after some calculation, you need to look back at the calculation and be careful with the parentheses - then you will know which is correct. -- Meni Rosenfeld (talk) 14:12, 11 January 2008 (UTC)


 * $$\neg$$ binds stronger than $$\land$$, $$\land$$ binds stronger than $$\lor$$. This is pretty much universally accepted in formal logic, especially in the context of satisfiability, horn clauses, resolution and similar stuff. Compare it to the similar integer arithmetic $$-Q * 1 + Q$$, which binds the same. So, your proof is already complete, congrats. —Preceding unsigned comment added by 84.187.80.85 (talk) 20:40, 11 January 2008 (UTC)


 * Umm ... as the original questioner seems to be unaware of this order of precedence in logic operations, how do we know they have not misapplied the order of operations in a previous step in their work, and mistakenly reached $$\neg Q \land T \lor Q$$ instead of $$\neg Q \land (T \lor Q)$$ ? I agree with Meni's suggestion that they go back over their calculation and insert parentheses as a check. Air-dropping an order of precendence rule only into the last step seems dangerous to me. Gandalf61 (talk) 10:10, 12 January 2008 (UTC)

Stem and leaf
In a stem and leaf chart is the max value of the "leaf" equal to the inter quartile range or 150% of the inter quartile range? I've read both but am not sure which is correct. 136.206.1.17 (talk) 17:16, 11 January 2008 (UTC)


 * The lengths of the leaves are determined by convention so as to be useful; there really is no absolute right or wrong. I am not sure who uses which convention but one thing you may wish to consider is that for a larger sample, it makes sense to increase the proportion of the IQR used.  The expectations of the extrememost order statistics from any distribution (at least one where such expectations exist) get farther away from the median of the distribution.  This prevents getting points outside the leaves with arbitrarily certain probability just by increasing the sample size, even for the most well behaved distributions (e.g., normal).  Baccyak4H (Yak!) 17:51, 11 January 2008 (UTC)

Another nonlinear second-order ODE
$$\frac{d^2\theta}{dt^2} = \frac{\cos\theta}{\sin^3\theta}$$

Is there a closed-form solution? —Keenan Pepper 21:45, 11 January 2008 (UTC)


 * Here's what I just got — not the final answer, but quite a lot on the way toward it.


 * Firstly, the equation can be written as:
 * $$\dot\theta \frac{d\dot\theta}{d\theta} = \frac{d\left(\dot\theta^2\right)}{2d\theta} = \frac{\cos\theta}{\sin^3\theta},$$
 * from which:
 * $$\dot\theta^2 = 2 \int \frac{d \sin\theta}{\sin^3 \theta} = -\frac{6}{\sin^4 \theta} + C_1$$
 * and:
 * $$t = \pm \int \frac{d\theta}{\sqrt{C_1 - \frac{6}{\sin^4 \theta}}}$$.
 * Substitute $$\alpha = \tan\theta$$, $$\sin^2 \theta = \frac{\alpha^2}{1+\alpha^2}$$ and $$d\theta = \frac{d\alpha}{1+\alpha^2}$$ and multiply both the numerator and the denominator by $$\alpha^2$$:
 * $$t = \pm \int \frac{\alpha^2 d\alpha}{\left(1+\alpha^2\right) \sqrt{C_1 \alpha^4 - 6\left(1+\alpha^2\right)^2}}.$$


 * From the Wolfram Integrator we get an aswer, but a messy one. With some little help from Maxima, I got:
 * $$t = \pm \frac{F\left(\beta \left| \frac{a_-}{a_+} \right.\right) - \Pi\left(\frac{1}{a_-}; \beta \left| \frac{a_-}{a_+} \right.\right)}{\sqrt{6a_+}} + C_2

,$$
 * where $$a_\pm = \sqrt{\tfrac{C_1}{6}} \pm 1$$ and $$\beta=i\,\operatorname{arsh}\left(\alpha \sqrt{a_-}\right)=\arcsin\left(\alpha\sqrt{-a_-}\right)$$. $$F$$ is the incomplete elliptic integral of the first kind and $$\Pi$$ of the third kind. Now solve for $$\beta$$, $$\alpha=\tfrac{\sin\beta}{\sqrt{-a_-}}$$ and finally $$\theta=\arctan\alpha$$… $$\ddot\smile$$


 * For some specific $$C_1$$-s we can go a bit further.


 * For $$C_1=0$$ the Integrator gives (OK, that's an easy integral to do by hand also):
 * $$\mp t = \frac{\alpha}{2\sqrt{6} \left(\alpha^2 + 1\right)} - \frac{i}{2\sqrt{6}} \arctan \alpha + C_2,$$
 * an equation I don't know by which special functions to solve.


 * $$C_1=6$$ is a more interesting case: by some standard substitutions (completing the square etc) the radical can be removed and the rational function integrated, as the Integrator naturally knows:
 * $$\mp t = \frac{-\arctan\frac{-i\alpha}{\sqrt{2\alpha^2 + 1}} - \frac{1}{\sqrt{2}} \arctan\frac{i \alpha \sqrt{2}}{\sqrt{2\alpha^2 + 1}}}{\sqrt{6}} + C_2 = \frac{1}{\sqrt{6}} \left[ \arctan (i\xi) - \tfrac{1}{\sqrt{2}} \arctan\left(i\xi\sqrt{2}\right) \right] + C_2,$$
 * where $$\xi = \tfrac{\alpha}{\sqrt{2\alpha^2 + 1}}$$. As $$\arctan(ix) = \tfrac{i}{2} \ln\tfrac{1+x}{1-x}$$:
 * $$e^{\pm 2\sqrt{6}i\left(t+C_2\right)} = \frac{1+\xi}{1-\xi}\left(\frac{1+\xi\sqrt{2}}{1-\xi\sqrt{2}}\right)^{-\tfrac{1}{\sqrt{2}}}

\implies e^{\pm 2\sqrt{3}i\left(t+C_2\right)} = \left(\frac{1+\xi}{1-\xi}\right)^{\tfrac{1}{\sqrt{2}}}\left(\frac{1-\xi\sqrt{2}}{1+\xi\sqrt{2}}\right)^{\tfrac{1}{2}} . $$
 * This is a cubic equation in $$\xi$$, which is, in principle, solvable. I used to have an error here. Now, I believe, it's correct, but I'm too tired to solve it right now. After that we could find $$\alpha = \pm \sqrt{\tfrac{\xi}{1-2\xi}}$$ and, again, $$\theta=\arctan\alpha$$.


 * As you can see, I haven't paid any attention to the domains my substitutions are valid in, because my main aim was finding some solutions, not a complete analysis the whole solution set. Good night!undefined&mdash;undefinedPt(T) 04:08, 12 January 2008 (UTC) (minor fixes (some $$C_2$$-s had been omitted)undefined&mdash;undefinedPt(T) 04:18, 12 January 2008 (UTC), a bigger fix 04:54, 12 January 2008 (UTC))


 * If there only would be an additional minus sign in the equation - then a simple solution would be arccos(t). Icek (talk) 04:31, 12 January 2008 (UTC)


 * Thus, one solution is $$\theta = \arccos(it)$$ and, as the equation is time-invariant, $$\theta=\arccos(it + C)$$ is actually a family of solutions. By the way, I've just discovered a serious error in my second equation! $$\ddot\smile$$ I'm working on it.undefined&mdash;undefinedPt(T) 16:42, 12 January 2008 (UTC)

Okay, could someone explain that very first step in much more detail? I've never seen it before, and it seems like a powerful technique. I see that the formal manipulation of symbols is correct ($$\frac{d\dot\theta}{dt} = \frac{d\theta}{dt}\frac{d\dot\theta}{d\theta}$$ is just the chain rule), but I can't figure out what $$\frac{d\dot\theta}{d\theta}$$ means, exactly. $$\theta$$ is a function of $$t$$, so $$\dot\theta$$ is also a function of $$t$$, and I don't see how you can turn it into a function of $$\theta$$ in order to take the derivative.

Also, could other versions of this technique be applied to higher-order equations, for example $$\frac{d^3x}{dt^3} = f(x)$$ ? —Keenan Pepper 16:07, 12 January 2008 (UTC)


 * Well, $$\dot\theta$$ is a function of $$t$$ and, if $$\theta$$ has an inverse, then $$t$$ can be thought of as a function of $$\theta$$, thus: $$\dot\theta[t(\theta)]$$.


 * I don't know what this method is called, I found it once in a differential calculus textbook. I don't have it around at the moment, so I cannot tell you much more about it. Generalization to higher orders seems not to be straighforward.


 * Anyway, my first integral went wrong, it should be:
 * $$\dot\theta^2 = 2 \int \frac{d \sin\theta}{\sin^3 \theta}=-\frac{1}{\sin^2 \theta} + C_1 \implies

t = \pm \int \frac{d\theta}{\sqrt{C_1 - \frac{1}{\sin^2 \theta}}}.$$
 * This is an easy integral (thanks to the $$\pm$$ we can be liberal with the signs):
 * $$t = \pm \int \frac{\sin\theta d\theta}{\sqrt{C_1\sin^2\theta - 1}} = \pm \int \frac{d\cos\theta}{\sqrt{C_1\left(1-\cos^2\theta\right) - 1}} = \pm\frac{1}{\sqrt{C_1}} \int\frac{d\cos\theta}{\sqrt{\left(1-\tfrac{1}{C_1}\right) - \cos^2\theta}}.$$
 * From the tables (the Integrator gives a mess I'm not willing to clean up):
 * $$t = \pm \frac{1}{\sqrt{C_1}} \arcsin\frac{\cos\theta}{\sqrt{1-\tfrac{1}{C_1}}} + C_2.$$
 * Denoting $$\tfrac{1}{\sqrt{C_1}}=\tau$$ and $$\pm t-C_2 = \pm\left(t-t_0\right)$$:
 * $$\theta = \arccos \left[\pm\sqrt{1-\tau^2} \sin\frac{t-t_0}{\tau} \right].$$
 * Taking the limit $$\tau\to\infty$$ and choosing the $$+$$ from the $$\pm$$, we get:
 * $$\theta = \arccos\left[i\left(t-t_0\right)\right],$$
 * the solution found previously.undefined&mdash;undefinedPt(T) 17:40, 12 January 2008 (UTC)


 * I've been lazy again. Firstly, I'd forgotten my lessons on trigonometric equations:
 * $$\theta = \pm \arccos \left[\pm\sqrt{1-\tau^2} \sin\frac{t-t_0}{\tau} \right] + 2n\pi\quad (n\in\mathbb{Z}).$$
 * Secondly, separation of variables often doesn't give us the constant solutions:
 * $$\theta=A=\mathrm{const} \implies \frac{\cos A}{\sin^3 A}=0 \implies A = \frac{\pi}{2} + n \pi\quad(n\in\mathbb{Z}).$$
 * Fortunately, those solutions have been already covered by $$\tau=1$$. But there may still be some singular solutions... Any advice on how to find them or justify my belief that there aren't any?undefined&mdash;undefinedPt(T) 18:12, 12 January 2008 (UTC)


 * By the way, the method is quite useful in physics. In principle, every homogeneous 2nd order ODE can be reduced to an inhomogeneous 1st order one. For example, applying the substitution $$\ddot x = \tfrac{d \left(\dot x^2\right)}{2dx}$$ to the Newton's II law in one dimension for a particle with mass $$m$$ in a potential energy field $$U$$, we get the conservation of energy:
 * $$m \ddot x + \frac{dU}{dx} = 0 \implies \frac{d\left(\tfrac{m\dot x^2}{2} + U\right)}{dx} = 0,$$
 * which can (for a known potential energy) be easily solved for $$x(t)$$ to obtain the particle's motion. (The first integration constant is the total energy.)undefined&mdash;undefinedPt(T) 22:26, 15 January 2008 (UTC) (corrected 01:11, 16 January 2008 (UTC))