Wikipedia:Reference desk/Archives/Mathematics/2008 February 18

From Wikipedia, the free encyclopedia

Mathematics desk
< February 17 << Jan | February | Mar >> February 19 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


Contents


[edit] February 18

[edit] Cubic function

If you go here and enter as the equation ax3 + bx2 + cx + d = 0 and tell it to solve for x, you get a long expression as the solution. Can someone show algebraically how you can solve ax3 + bx2 + cx + d = 0 for x? Or link to a page that does? Thanks. 70.162.25.53 (talk) 03:39, 18 February 2008 (UTC)

See cubic function, specifically the Cardano's method section. Be warned, it's not quite as nice as the quadratic formula... 134.173.92.17 (talk) —Preceding comment was added at 03:59, 18 February 2008 (UTC)
(ec) The Wikipedia article on cubic functions may be of your interest, or at least this subsection of it. Outside Wikipedia, this page from MathWorld is another interesting choice. Pallida  Mors 04:06, 18 February 2008 (UTC)
I intended a reference to the subsection Root finding in that article, but the link doesn't seem to work fine. Nevermind. Pallida  Mors 04:19, 18 February 2008 (UTC)

[edit] Logic

Does anyone know where I can find a whole bunch of "Knights and Knaves" problems, with answer/explanations/solutions? Thanks. (Joseph A. Spadaro (talk) 07:51, 18 February 2008 (UTC))

Here's a bunch of problems with a twist. These problems explore the consequences of adding a third type of person, the philosophers. For more traditional questions, a Google search turns up a few pages. —Bkell (talk) 12:40, 18 February 2008 (UTC)
Also, check out the books of Raymond Smullyan. He has tons of logic puzzles that all can enjoy. –King Bee (τγ) 13:48, 18 February 2008 (UTC)
I especially recommend "Alice in Puzzleland" by Raymond Smullyan. 129.67.157.6 (talk) —Preceding comment was added at 15:15, 18 February 2008 (UTC)

Hi. Thanks to all for the input. I guess I should have made my question a little clearer. So, let me re-phrase it. I am looking for Knights and Knaves problems ... that are accompanied by answers / solutions / explanations. Right now, I only want Knight/Knave questions ... and not just logic puzzles in general. Also, I am only looking for the "simple" type (knights and knaves only), where they do not introduce third-parties (spies, randoms, philosophers, etc.) into the equation. Also, I'd like to find this on the Internet --- as I don't have too much time to go out, order a book, wait for its delivery, etc. At some later point, I will probably go out and get some Smullyan books ... but right now, I don't have that time / luxury. Any suggestions? Any good websites out there? I can't seem to find any, with my searches. Many thanks! (Joseph A. Spadaro (talk) 16:33, 18 February 2008 (UTC))

The Wikipedia article on Knights and Knaves has a few problems with explanations and solutions. There are some pages with individual knights-and-knaves problems (from one site, [1], [2], [3], [4], [5], [6], [7], [8]). —Bkell (talk) 17:46, 18 February 2008 (UTC)
Smullyan's book entitled "What is the name of this book?" has a lot of Knights/Knaves puzzles complete with solutions. His books should be available at your local library, so you needn't purchase a thing. –King Bee (τγ) 19:21, 18 February 2008 (UTC)

Thanks for all the input. Much appreciated. In this day of Internet and digital information, it actually never dawned on me to visit my local library. I actually decided to do that -- after reading King Bee's suggestion -- and indeed they had nine of Smullyan's books. I checked out all nine! Thanks a lot. (Joseph A. Spadaro (talk) 00:59, 24 February 2008 (UTC))

[edit] help with aproof

i need help with how to prove that a number (a) is a zero divisor mod (n) iff gcd(a,n)>1?thank youHusseinshimaljasimdini (talk) 10:52, 18 February 2008 (UTC)

Think about n/gcd(a,n) - let's call this b. First of all, you can be sure that b is an integer - why ? Secondly, you can be sure that if gcd(a,n) > 1 then b mod(n) is not 0 - why ? Now think about the product ab - what is ab mod(n) ? How does this help you show that a is a zero divisor mod(n) ? Gandalf61 (talk) 12:09, 18 February 2008 (UTC)

[edit] Collecting Terms

i get how to do everything else but i seem to bomb out on collecting the terms forgive me if it is wrong
Simplify:=\sqrt{3}- 2\sqrt{2} + 2\sqrt{3} + \sqrt{2}
now im not sure but im pretty sure this is wrong =1\sqrt{3}(not sure what goes here) 3\sqrt{2}
—Preceding unsigned comment added by 124.176.206.9 (talk • contribs) 12:28, 18 February 2008 (UTC)

You have one square root of 3, minus two square roots of 2, plus 2 square roots of 3, plus one square root of 2: so in the end how many square roots of 3 do you have, and how many square roots of 2? —Bkell (talk) 12:31, 18 February 2008 (UTC)
If it helps you, forget for a moment what \sqrt3 means, and just think of it as a symbol, like a circle, perhaps. The same thing for \sqrt2: think of that as a triangle. So you have one circle, minus two triangles, plus two circles, plus one triangle. How many circles do you have, and how many triangles? Just be sure to write "\sqrt2" in your answer instead of a triangle, of course. —Bkell (talk) 12:37, 18 February 2008 (UTC)
3\sqrt{3}+ -1\sqrt{2} (= \sqrt{2})

so 3\sqrt{3}+ \sqrt{2}  ? do you just take the sign infront? so that 12a - 10b + 9c + 5b
=12 - 5b + 9c?

Think about this, ab + ac + de + df = a(b + c) + d(e + f) this is just two applications of the Distributive property. If it's not clear why that works, just try going the other way. (Note that algebraic laws are reversible!)A math-wiki (talk) 12:56, 18 February 2008 (UTC)
You're right: the simplified answer is 3\sqrt3+(-1)\sqrt2. Usually −1 times something is just written −something (for example, −1 × 5 = −5), and when "+−" occurs in a mathematical formula it's usually just written "−" [for example, 3 + (−2) = 3 − 2]. So you can write 3\sqrt3+(-1)\sqrt2 in a simpler way. —Bkell (talk) 13:56, 18 February 2008 (UTC)

[edit] geometry - spheres and unit cubes

seeing as there's quite a few mathematicians in here i thought i'd ask about a geometry problem i've been having. i think it's quite easy but i don't really have a clue.

imagine a unit cube. now imagine a point within this cube (call it p). i want to place a sphere with its centre at p. how would i work out the radius needed for this sphere so that the intersection volume between it and the cube equals a given value (call it v)? AlmostCrimes (talk) 14:21, 18 February 2008 (UTC)

If the sphere just intersected one side you could find the volume of the Spherical cap cut off, then subtract this from the volume of the sphere. If the sphere intersects more than one side then things get a little trickier. --Salix alba (talk) 15:07, 18 February 2008 (UTC)
[ec]It's actually not that simple. To do that you will first need some way to calculate the volume of intersection of a cube and a ball, which is pretty messy. Fortunately this latter problem is one I have worked on a while back, so I have thought of a few approaches. Since none of them is perfect, I can help you more only if you provide more details about your application (with special attention to details such as relative and absolute error tolerance, computational resources, platform on which you will do the calculations, etc.). If the question is purely out of curiosity I suggest you just leave it, though I can describe the general ideas. -- Meni Rosenfeld (talk) 15:10, 18 February 2008 (UTC)
salix alba - Yes sadly, it is quite possible the sphere intersects more than one side, for example if the point was at one of the corners of the cube. the basis of the problem is that I'm investigating various approaches to deciding whether a given colour in an RGB colour space (here represented as a cube like the following RGB#Representations) is "similar" to another colour. the natural approach would be to calculate the distance between the two colours (or points) and to then determine whether this is below a certain threshold. This technique suffers in that not all colours are treated evenly - colours in the centre of the colour space (so at [0.5, 0.5, 0.5], or grey) would be flagged as being similar to a higher percentage of the total colour space than a colour like white would. I was hoping to even this out by dynamically modifying the threshold (analogous to the radius) so that every colour has an equal proportion of the colour space flagged as being similar to it. As i say, this is mostly investigative and it isn't important that I use this exact technique. it's very possible i'm completely overcomplicating things.
for what it's worth though error tolerance isn't too important, neither are computational resources. I'm programming it in MATLAB and basically just seeing what works well. the most important factor is simplicity and implementation time really as I don't want to get too hung up on one technique. If any of your solutions apply I'd be interested in hearing them. I thought briefly about representing both the sphere and cube in a boolean matrix and physically determining the best sphere radius but I was kind of hoping there'd be a simple algebraic method. --80.4.203.142 (talk) 19:44, 18 February 2008 (UTC)
Well, I can see several problems with this approach. If you're going for a notion of similarity which matches that of a human observer, I don't think using a simple Euclidean metric as a basis will cut it. I don't know a lot about this, but at the very least you should give different weights to the components - Grayscale mentions weights used for a different purpose, but they might be appropriate here. This would then leave you dealing with ellipsoids which is even messier. Second, I'm not sure any sort of "Affirmative action" is necessary - white will have less colors labeled as similar to it, simply because there are less colors genuinely similar to it. You next have symmetry to consider - You mentioned a ball centered around one point, but when doing a comparison there are two points to consider, and the result will depend on which one you choose to calculate the threshold. If you do some symmetric calculation taking both into account, it will be difficult to guarantee that indeed every color has the same portion of the color space labeled similar to it.
As said, solving the problem in you original question is not impossible, but not simple to do with satisfying accuracy and efficiency. Since I gather that these are not crucial, I can offer a simple approximation method for the volume of intersection of the cube and a given ball. Just pick several (something like 100 or 1000) randomly chosen points in the cube, and check whether each is inside the ball. The proportion which are is an estimation for the volume of intersection. You can do this for a ball centered at one point and with radius equal to the distance to the other point, compare it to the volume you want to be labeled similar and make the decision accordingly.
I hope this helps. -- Meni Rosenfeld (talk) 22:25, 18 February 2008 (UTC)
it's true there are problems with the general approach and while I am aware there are colour spaces that lend themselves more easily to this kind of work I have been asked to look at this RGB cube method specifically. As for the "affirmative action", it seems to me it is necessary. A general distance approach is far better at finding areas that look grey than areas that look white when given the same threshold. Increasing the threshold for white increases the perceived accuracy, which is why I wanted to try this method. Your symmetry point is interesting. I actually hadn't considered that...
Because of the nature of the exercise it isn't important that every technique I try is successful but regardless you've brought me round to not trying the technique, which I believe won't be worth the effort. It helped to have this discussion even if the focus of it changed a little, for which I thank you. --80.4.203.142 (talk) 23:44, 18 February 2008 (UTC)

[edit] Math Riddle

While studying for my math test, I came across this problem:

I am thinking of some polynomial with positive integer coefficients. You can ask me for the value of p[x], where p is the polynomial and x is some positive integer as many times as you want. What is the minimum number of questions you need to ask in order to find out what the polynomial is?

I am unable to figure out the answer. Since it doesnt tell you how many terms or the order of the polynomial, it's hard to find a starting spot. Can anyone help? 99.240.177.206 (talk) 18:37, 18 February 2008 (UTC)

I remember that one. The answer is 2. Does that help? Black Carrot (talk) 18:45, 18 February 2008 (UTC)
It helps me, at least. Nice problem. Algebraist 19:45, 18 February 2008 (UTC)
If I understand Black Carrot correctly, the value you choose for x in your second question depends upon the answer you receive to your first question - yes ? Gandalf61 (talk) 20:06, 18 February 2008 (UTC)
It would have to, polynomials aren't completely determined by their values at two points. There must be some clever trick based on the answer to the first questions... I haven't worked it out yet, but give me some time... --Tango (talk) 20:08, 18 February 2008 (UTC)
You don't just have 2 points, you have 2 points plus the knowledge that the coefficients are positive integers. I just got it! Oh that is clever. --tcsetattr (talk / contribs) 20:40, 18 February 2008 (UTC)
...which was the point I was trying subtly (perhaps too subtly) to make. Answer to first question gives you information about coefficients which you use in second question. Gandalf61 (talk) 22:42, 18 February 2008 (UTC)
Haha, wow, that's pretty cool. —Bkell (talk) 21:23, 18 February 2008 (UTC)

Hm..suppose if one chose p(0) and the answer turned out to be 4 or 5. Obviously, this would indicate the the constant at the end is either a 4 or 5. Where would you go from there?Acceptable (talk) 20:39, 18 February 2008 (UTC)

Asking for p(0) is a bad start (aside from the fact that it wasn't technically allowed by the problem statement). --tcsetattr (talk / contribs) 20:55, 18 February 2008 (UTC)
Funnily enough, 0 (if you take it to be positive) is the only first question that doesn't work. Suppose you got f(0)=a (say), and used n for your second question. If you got f(n)=n^2+a, then f could be nx+a or x^2+a. Algebraist 21:50, 18 February 2008 (UTC)

Finally, I think I've got it! That shouldn't have taken me that long... --Tango (talk) 22:29, 18 February 2008 (UTC)

Just in case the OP needs another hint - how would you solve this if you also knew that all coefficients are less than 10? -- Meni Rosenfeld (talk) 22:32, 18 February 2008 (UTC)
It finally clicked when I twigged that it was only positive coefficients. -mattbuck (Talk) 23:02, 18 February 2008 (UTC)

I think the smallest number of questions you need to ask is (the degree of the polynomial + 1).--George (talk) 22:43, 18 February 2008 (UTC)

I wonder if there's a finite bound for more general polynomials, like with positive rational coefficients. Black Carrot (talk) 22:47, 18 February 2008 (UTC)
To George - that'd be right for polynomials with no restrictions on the coefficients, but you can take advantage of their positive integerosity to jump straight to the answer. Black Carrot (talk) 22:50, 18 February 2008 (UTC)
Do you have any specific technique for doing this or is this just a general statement ?--George (talk) 22:56, 18 February 2008 (UTC)
To the OP's riddle? Yeah, I've got the answer. Give it a little while, and reflect on Meni's hint. BTW, for a polynomial in n variables, with positive integer variables and coefficients, it could be done within n+1 questions. Black Carrot (talk) 23:00, 18 February 2008 (UTC)
I got it ,thanks. --George (talk) 23:53, 18 February 2008 (UTC)
I think 2 questions ought to work for real non-negative coefficients - that they're integers I wouldn't think was strictly necessary. -mattbuck (Talk) 23:02, 18 February 2008 (UTC)
Really? It doesn't seem like that would be enough. That is, for any two inputs you choose, it seems like there would be at least one pair of polynomials with the same output. Black Carrot (talk) 23:06, 18 February 2008 (UTC)
If you choose any two points, there are an infinite number of polynomials that go through them. But, restricted to non-negative coefficients, if you choose the 2nd point based on the first one, it ought to be possible to find the order. -mattbuck (Talk) 23:12, 18 February 2008 (UTC)
Thinking about Black Carrot's extended question, I can see that if you only know that all (non-zero) coefficients are real and positive, then with two questions you can find the maximum degree of the polynomial - say it is m (so at most m+1 non-zero coefficients). But don't you still need a further m-1 questions to find the values of the coefficients (so that altogether you have m+1 simultaneous equations) ? Key difference from the positive integer case is that there is no longer a lower bound on the magnitude of a non-zero coefficient. Gandalf61 (talk) 00:00, 19 February 2008 (UTC)
Generally with polynomials, rational coefficients and integer coefficients work in exactly the same way (you just multiply through by the lowest common multiple of all the denominators), so I imagine the case of positive rationals is doable (you may end up needing to additional fact that the polynomial is monic in order to get a unique answer, I'd have to try). The case of positive reals probably isn't, though. The key fact that p(1)<10 (or whatever) gives you is that 10 doesn't divide any of the coefficients, in the real case that fact is no longer true (it's not true for rationals, either, but you can probably fudge it). I haven't actually tried either case, this is just intuition and could well turn out to be wrong. --Tango (talk) 12:50, 19 February 2008 (UTC)
But how do you determine the lowest common multiple (or even any common multiple) of the denomoinators ? I think the positive rational coefficients case is the same as the positive real coefficients case - it only takes a finite number of questions, you don't know in advance how many, but after two questions you know how many further questions you need. Gandalf61 (talk) 15:08, 19 February 2008 (UTC)
That comment was just to demonstrate why polynomials over the integers and polynomials over the rationals are closely related. Obviously, you can't directly convert in this case, but there might be some trick that allows you to use the same basic method. I haven't looked for one, so I don't know. --Tango (talk) 16:44, 19 February 2008 (UTC)
For those still struggling, I suggest using p(1) as the first question. It's not necessary, but thinking about what I could learn from p(1) was what led me to the solution. And don't forget the coefficients are all positive! --tcsetattr (talk / contribs) 23:21, 18 February 2008 (UTC)
Sorry, I still am not getting it. The question does not state how many terms there are. So suppose I realize that none of the coefficients are greater than 10, I still dont know anything about how many terms or how large the coeff of each term is.

Let's take an example: suppose the equation was f(x)= 4x^3 + 3x^2 + 7x + 6. If I plug in p(1), i get p(1)=20. What do I ask next? Thanks. 99.240.177.206 (talk) 04:29, 19 February 2008 (UTC)

OK, that's enough. Full spoiler: suppose you had chosen that function and I asked you for p(1) and you said p(1)=20. I know the polynomial is A+Bx+Cx^2+Dx^3+... so what do I get when x=1? A+B+C+D+... in other words the sum of the coefficients. I don't know how many coefficients there are, but I know they are all positive integers and their sum is 20. If a set of positive numbers adds up to 20, then none of them individually can be greater than 20. The next question I'd ask is for p(100). I could ask for p(21) instead - any number greater than 20 will do - but I'm choosing 100 because it might make the procedure more obvious.
Your answer will be p(100) = 4(100^3) + 3(100^2) + 7(100) + 6 = 4030706. See how the coefficients 4,3,7,6 revealed themselves? If I had asked for p(21) you would have said 38520 which would make the procedure a little more mysterious-looking, but the secret is I would then convert 38520 into base 21, and the result would be: 437621!
Now we can go back to the first step and see how p(1) doesn't have to be used. If I asked for p(2) first, you'd say 64. In this version, 64 is not the sum of the coefficients, but it's still an upper bound on them individually. If any one of your coefficients was greater than 64, it would contribute a term of (something greater than 64)*(some power of 2) to your answer, so your answer would have been greater than 64 also. Knowing this upper bound, I could ask for p(65), get the answer 1111636, and convert it to base 65, where it is: 4376. --tcsetattr (talk / contribs) 04:44, 19 February 2008 (UTC)
And of course, my point was that if all coefficients are less than 10, you don't need two questions - you just ask what is p(10). -- Meni Rosenfeld (talk) 09:49, 19 February 2008 (UTC)

This is nice. Ask for p(1000000) and the problem is solved in one question for all the cases where the coefficients are less than a million. You do not have to require that the integer coefficients are positive, just that they are not negative. What if the integer coefficients may be negative too, how do you solve that? Bo Jacoby (talk) 15:33, 19 February 2008 (UTC).

If the coefficients can be arbitrary integers, then infinitely many questions are required (consider the case when every question gets the answer '0'). If they're arbitrary positive reals, then finitely many questions suffice (as Gandalf pointed out above) but I'm not sure if you can get a fixed finite bound or not. Algebraist 16:25, 19 February 2008 (UTC)
You can't have infinitely many questions all giving 0, since the polynomial will always be of finite degree (otherwise it's not a polynomial). --Tango (talk) 16:44, 19 February 2008 (UTC)
Well, I suppose there's the 0 polynomial... it would take an infinite number of questions to spot that. Any non-0 polynomial would be worked out with finite (but unbounded) steps, though, I'd think. --Tango (talk) 16:52, 19 February 2008 (UTC)
No. However (finitely) many times I give you the answer zero, you won't know if it's the zero polynomial or just some other poly that happens to have roots at every point you've asked about. Algebraist 18:35, 19 February 2008 (UTC)
That's not quite what I said. I said that any non-zero polynomial could be worked out in finitely many steps, not that finitely many steps is enough to tell if a polynomial is non-zero. There are only finitely many roots to any polynomial (at most, it's degree), so after one more question than that (which is still a finite number), you'll know it's non-zero. Whether you can work out exactly what it is or not, I'm not sure - repeated roots would be an issue, but you would know it's non-zero. --Tango (talk) 20:39, 19 February 2008 (UTC)
That (while true) is not much use to solve the problem as stated. Sure, for any polynomial there is a question-asking strategy that proves the poly is non-zero in finitely many steps, but what we want is a strategy that for any polynomial will prove it is non-zero in finitely many steps. We can't base our strategy on an answer we don't know. Algebraist 22:34, 19 February 2008 (UTC)
How about asking for p(0), p(1), p(-1), p(2), p(-2), etc. until you get a non-zero answer? If the polynomial is non-zero, you will get a non-zero answer after a finite number of questions. If it is the 0-polynomial, then you'll never get an answer, but you're asking for a proof that it's non-zero, not a proof that it is zero. --Tango (talk) 12:08, 20 February 2008 (UTC)
Some day I'll learn not to trust maths I do drunk. Algebraist 16:34, 21 February 2008 (UTC)

[edit] Set of convergence of a sequence of measurable functions

This is an exercise from Lang's Real and Functional Analysis, Chapter VI: Let {fn} be a sequence of measurable functions. Show that the set of points for which {fn} converges is a measurable set.

Presumably this involves finding some collection of obviously measurable sets that can be unioned/intersected together to end up with the set in question, but I haven't been able to find such a collection. The only information available is the basic properties of σ-algebras and measurable functions.

[As a side issue, does anyone have experience with or thoughts on this book? I can't say I find it easy going, but struggling with it seems to be good practice and the more time I spend with it the more I appreciate it. I got it originally for the development of integration, which is the best I've seen anywhere--just beautiful! If only there were a solutions manual...  — merge 23:33, 18 February 2008 (UTC)]

One way of doing this is to first show that supn{fn} is measurable. Dually the inf of countably many measurable functions is measurable, so the lim sup and the lim inf of the fn are both measurable. Then the set of x for which fn(x) converges is the set of points at which two measurable functions are equal, and is thus measurable. Slight care might be needed in dealing with infinity. Algebraist 23:51, 18 February 2008 (UTC)
Thanks! This idea had not occurred to me. However as it turns out the properties of lim sup and lim inf you refer to are dealt with in the next exercise! So I'm thinking there's a way to do this one that doesn't use them. Also, I forgot to mention that the fn take values in a Banach space, so one can't take the sup directly.  — merge 12:52, 19 February 2008 (UTC)
In that case, you could use the fact that fn(x) converges exactly if fn(x) is Cauchy. The latter statement is just
 \forall{\epsilon} \exists{N} \forall {n,m} (n,m \ge N \rightarrow |f_n(x)-f_m(x)| < \epsilon)
So the set of x for which fn(x) converges is just
\bigcap_{\epsilon} \bigcup_N \bigcap_{n \ge N} \bigcap_{m \ge N} (f_n-f_m)^{-1} (B_{\epsilon})
where Bε is the open ball of radius epsilon about 0 (I'm assuming this is measurable) and all the intersections and unions are countable (in particular we can restrict to positive rational epsilon). Algebraist 16:22, 19 February 2008 (UTC)
Wonderful. Someone else suggested the same idea in conversation and it works perfectly. I think this is "the" solution. Thank you!  — merge 21:23, 19 February 2008 (UTC)

[edit] Googol

Why is one googol not 10100? The Wikipedia article states it as being 10100.0784. Why is this? Thanks, Zrs 12 (talk) 23:50, 18 February 2008 (UTC)

One googol is by definition 10100, as correctly stated in the article. The article also correctly states that 70! is approximately 10100.0784. I don't see any source of confusion here. Algebraist 23:55, 18 February 2008 (UTC)
Perhaps OP did not understand Order of magnitude, and just skipped over those words to read "One googol is the same as 70!." --PalaceGuard008 (Talk) 23:57, 18 February 2008 (UTC)

Haha! How dumb of me! Gah, I must start reading more carefully. Zrs 12 (talk) 00:38, 19 February 2008 (UTC)