Wikipedia:Reference desk/Archives/Mathematics/2007 April 26

= April 26 =

Refunding overpayments from accounts receivable
Do I need to have a W9 on file to refund money from overpayment from accounts payable? Our invoices go out with a statement on them instead of an invoice amount. This is the reason for most of the overpayments. Please respond.

Sincerely,

Vera Pichette World Courier Ground 125 Whipple Street Providence, RI 02908 401-459-0990 


 * Hi,


 * This forum does not give legal advice as a matter of policy -- I assume tax advice falls into the same category. Also, you may want to consider when posting questions publicly whether they might reflect poorly on you or your employer. I have removed your e-mail address for your privacy and to avoid spam (it will remain visible in the history of this page if someone wants to contact you). Tesseran 02:10, 26 April 2007 (UTC)

Dimension of orthogonal complements
It's intuitively acceptable that for vector space $$V$$ and subset $$W\subset V$$, $$dim(W^\perp)+dim(W)=dim(V)$$. For example, given a plane (dim = 2) in three-space, the complement is a line (with dimension 3 - 2 = 1).

But I'm trying to prove it to myself, if not fully rigorously, then at least with a better argument than "Well, it makes sense..." Can anybody help? Thanks. (And no, this isn't homework; this is independent study.) --Leapfrog314 02:37, 26 April 2007 (UTC)


 * Well, if you just want to understand it better, think about an easy example. Take $$R^3$$.  Use the standard basis which is written as $$e_1, e_2, e_3$$ usually.  Well, let $$span(e_1, e_2)$$ be W.  Then, $$W^\perp$$ is the set of all vectors that are perpendicular to all vectors in W.  Well, since $$e_1, e_2$$ are the vectors [1, 0, 0], [0, 1, 0], it's pretty easy to see that $$e_3 = $$[0, 0, 1] and its multiples are perpendicular to any vector in W.  Also, since that's all that's left of $$R^3$$ not already in W, we know that $$W^\perp = span(e_3)$$.  Now, the dimension of W is 2 and $$dim(W^\perp)$$ is 1.  Of course, the dimension of $$R^3$$ is 3. StatisticsMan 03:36, 26 April 2007 (UTC)


 * Alright, that helps a bit; in that case, you could pick $n$ vectors that span $V$ (with dimension $n$), $r$ of which span $W$ (which has dimension $r$)...if you performed Gram-Schmidt on these vectors, with the $W$ vectors first, it would be clear that the new $n-r$ vectors not spanning $W$ would be orthogonal to $W$, and thus would clearly span $W$ perp. Hmm... Any other ideas, anyone? --Leapfrog314 04:44, 26 April 2007 (UTC)


 * There are lots of ways of doing this, all of which are basically the same. The important thing is to show that $$W + W^\perp = V$$, i.e. that given any v in V, v is a sum of something in w and something perp to w. Given this, if B is a basis of W and B' a basis of Wperp, then B union B' is clearly a basis of V. Algebraist 11:38, 26 April 2007 (UTC)


 * (after brief thought) and the easiest way to do that is what you suggest: take an r-element basis of W, extend to a basis of V (this is easy: just keep throwing in more vectors not in the span of what you've got until you have to stop) and Gram-Schmidt the result. Algebraist 11:43, 26 April 2007 (UTC)


 * It looks like everybody has arrived at the same idea. For fun and good exercise, let's walk through an example using real cubic polynomials in x as our vector space. This is a finite-dimensional vector space of dimension four. We're all familiar with the monomial basis, 1, x, x2, x3; but to make things interesting we will take our subspace, W, to be those cubics that equal 0 at x = 0 and at x = 1. This is clearly a proper linear subspace, since sums and multiples of such cubics will have the same property. We take the inner product, &lang;·,·&rang;, to be
 * $$ \lang a_0 + a_1 x + a_2 x^2 + a_3 x^3, b_0 + b_1 x + b_2 x^2 + b_3 x^3 \rang = a_0 b_0 + a_1 b_1 + a_2 b_2 + a_3 b_3 . \,\!$$
 * 
 * Our first task is to find a basis for W. In monomial form, the constant term must be zero, and the sum of the coefficients must also be zero. This suggests W is 2-dimensional (from two constraints on four dimensions), and one choice of basis might be
 * $$ x-2x^2+x^3, \quad x^2-x^3 . \,\!$$
 * It is not hard to see that x−x2 and x−x3, say, are in the span of these. Nor is it hard to see that these are independent, though not orthogonal.
 * Our next task is to extend this basis with two independent choices orthogonal to these. A simple pair is
 * $$ 1, \quad x+x^2+x^3 . \,\!$$
 * These are easily seen to be orthogonal to the W basis and to each other, so they form a basis for the orthogonal complement of W.
 * 
 * This was so simple an example that we could work intuitively, by inspection. But more formally and systematically, we know that any finite-dimensional inner product space has an orthonormal basis. (Recall that we need to augment the vector space with an inner product to define orthogonality.) That does not tell us how to find such a basis for W, but assures us that one exists. Initialize a list B with that basis. Then we take vectors v from the basis for V one by one, and test them against the span of the evolving basis, B. If v is independent of B, use the Gram-Schmidt technique to make it orthogonal to B and unit length, then append the result to B. Eventually B must grow to span V. (Simple exercise: Why?) Discard the vectors in the basis for W, and we will have created an orthonormal basis for the orthogonal complement of W. --KSmrqT 16:31, 26 April 2007 (UTC)

Log functions
Why is it that most calculators do not allow you to change the base of the log function? You only get base 10 and base e (ln). I know you can use a formula for converting to a base of ten, but why not just let the calculator have other bases? 68.231.151.161 03:48, 26 April 2007 (UTC)
 * Because it's extremely easy to convert between log bases, so base 10 and e, which are more common, are the only ones that are really handy to have available right away. &mdash; Kieff | Talk 04:07, 26 April 2007 (UTC)

Because you only need at most 4 bases:


 * (1) Base e
 * (2) Base 10
 * (3) Base 2
 * (4) Base 16

Of the above, base e and base 10 are the most useful. 202.168.50.40 05:33, 26 April 2007 (UTC)

Actually, having just one base would be sufficient. If you want to calculate the $$m$$-logarithm of $$p$$, you are solving $$m^x = p$$. Now your trouble is that your calculator does not have the $$m$$-logarithm, so just convert $$m$$ to a form which includes $$e$$, that is $$m=e^{\ln m}$$. Calcualtion goes as follows
 * $$m^x=p$$
 * $$e^{(\ln m)x}=p$$
 * $$e^{x \ln m}=p$$
 * $$x \ln m = \ln p$$
 * $$x=\frac{\ln p}{\ln x}$$ wow! The equation to the left blows my mind! It says that $$p = x^x\,$$ (Comment added anonymously by 210.49.122.80.)

So to calculate the 7-logarithm of 657 for example, just take $$\ln 657 / \ln 7$$. Sjakkalle (Check!)  06:40, 26 April 2007 (UTC)


 * The reason that 210.49.122.80's mind got blown is that Sjakkalle of course meant $$x=\frac{\ln p}{\ln m}$$, not $$x=\frac{\ln p}{\ln x}$$. --mglg(talk) 16:01, 26 April 2007 (UTC)
 * Oops!! You're right!  Sjakkalle (Check!)  06:24, 27 April 2007 (UTC)

I agree with the original poster – it would be nice to be able to choose an arbitrary base. I find myself wanting base 2 especially often, without really feeling like deriving the conversion formula every time. Having it built-in would also make for a cleaner notation. —Bromskloss 11:40, 26 April 2007 (UTC)


 * There's several fixes to that.
 * 1. if your calculator is programmable, program it in. (I'm not sure what you mean by notation...)
 * 2. Train yourself. Then it wouldn't be so hard to convert, because you "know" it.  Especially since you say it happens often.  You are always going to have to put forth some minimal effort.  There are much harder conversion formulas, be glad you don't have to learn them.
 * 3. If you insist, by yourself a calculator with x^y functionality. Its inverse would be log_x(y), and likely the inverse function is available.
 * Root4(one) 13:56, 26 April 2007 (UTC)


 * There is some logic in saying that the inverse function of the xy key should be logxy, but on the Windows calculator (and, I think, on other scientific calculators I have owned), the inverse function of the xy key is x1/y. This is presumably so that the key sequence XY<=>Y<=> yields a result of X. Gandalf61 14:07, 26 April 2007 (UTC)
 * (edit conflict) Wow I am out of practice... (Nods to Gandal61 for quickly catching my error). The inverse on Microsoft's calculator calculates the yth root of x, (the inverse of f(x) = x^y, not log_x(y) (the inverse of f(y) = x^y.) Nevermind. But if you're doing some calculation quite often, it does make some sense to practice it a bit. Root4(one) 14:16, 26 April 2007 (UTC)
 * Of course if there's no inverse for x^y, how would you quickly calculate the Yth root. sheesh. Seeing how many errors I've made in the past 5 minutes I've concluded I should have had some coffee before coming here. Root4(one) 14:27, 26 April 2007 (UTC)

Solve an equation of 4th order
What is the solution to ax4 + bx3 + cx2 + dx + e = 0

It is for a game I'm designing and I simplified a complicated problem down to that, but can't figure out how to solve it for a general solution. Chris M. 19:46, 26 April 2007 (UTC)


 * It is quite difficult, but at least can still be solved by radicals. See our article on Quartic equation. –King Bee (&tau; • &gamma;) 19:52, 26 April 2007 (UTC)


 * Often by the time we reach degree 4 we switch to a general-purpose method; see, for example, splitting circle method. But there are important considerations before we take such a step. One vital question, especially for game programming, is whether perhaps the polynomial is originally available in Bernstein–Bézier form; another is whether we want all roots, real roots, or only perhaps a smallest root. Thus a method like Nishita's Bézier clipping may be faster and more reliable. --KSmrqT 21:30, 26 April 2007 (UTC)

I'm looking for real roots. I'm trying to find a concrete answer anywhere in those threads, but I can't. I'm pretty good at math but I fear this may be over my head to understand completely. But if there is simply an answer I can plug into my calculation that would do the job. I do appreciate the complexity of the issue though, so if that isn't really feasible (as the article seems to imply) then any other suggestions would be appreciated.

My basic problem was to find out if a circle was intersecting a line represented by a quadratic equation. I may simplify it so that it's simply f(x) = x2 but I think it'd be neat to do it for the general. Any help would be appreciated. Chris M. 02:13, 27 April 2007 (UTC)


 * You can find rational roots by using a Diophantine method (forget what it is exactly -- method used to find rational points on a sphere). —The preceding unsigned comment was added by 129.78.208.4 (talk) 05:38, 27 April 2007 (UTC).


 * If you're just interested in finding out whether the circle and the parabola (please be careful in calling all curves "lines") intersect, then it may be easier. At the very least, a criterion for the circle and parabola being tangential would be a cubic, which is a little bit easier than the quartic, and (presumably) you would then be able to extend that criterion into one which tells you whether the parabola does or does not intersect. Confusing Manifestation 06:56, 27 April 2007 (UTC)


 * I've not tried the detail of this, but to see if a parabola and a circle intersect it would suffice to calculate the min distance from the parabola to the centre, then check whether or not this exceeded the radius. I'd be surprised if this required a quartic equation.→81.153.219.69 11:37, 27 April 2007 (UTC)


 * The clarification provides helpful new information. It also raises a further question, a subtlety easily overlooked: Do you need to find the coordinates of an intersection (if it exists), or would it suffice to get a yes-or-no answer? (The latter can be easier!) As a numerical safeguard, you may wish to consider "closeness", not just intersection. And when you say "general", do you mean keeping the circle but replacing the "quadratic equation" by something like a Bézier curve? Regardless of your answers, I suspect pure mathematics will play a minor role compared to application insights. For the latter, a mathematician named Dave Eberly has a web site full of code and tutorials for graphics, game physics, and image processing. Have fun. --KSmrqT 14:13, 27 April 2007 (UTC)