Wikipedia:Reference desk/Archives/Mathematics/2007 August 1

= August 1 =

Card trick
How is it done please? She lays out piles of cards looking at the top card in each and then counting. an ace will lead to her adding 13 cards, a 2 will cause her to add 12 etc. She then instructs me to remove all piles except 3. Then to reveal the top card of any two piles. Say I reveal 2 and 3. she then   merges the discarded cards and counts them (there are 16). She then tells me the remaining hidden top card is an ace. How does she know this? - Pharrar 07:01, 1 August 2007 (UTC)


 * Sorry, can't help. There are many ways of performing a magic trick to produce essentially the same effect. A magician watching the performance may notice details that suggest the method, but non-magicians tend to give grossly inadequate descriptions. That's no accident; many a trick depends on viewers overlooking subtle details. Beyond that, those who know the most about magic are sometimes willing to teach those who want to learn magic for the purpose of performing, but find it counterproductive (and bad for business) to satisfy idle curiosity.
 * You can find many, many books written about card magic, either in local magic shops, online shops, your public library, or at a local magic club. Wikipedia has a magic project with its own talk page; you might try asking there. It is quite possible the trick you saw appears in Karl Fulves' Self-Working Card Tricks or another of his books. These books are very inexpensive to buy (Amazon even gives you a free peek), and his tricks typically use no special apparatus or difficult sleight of hand. --KSmrqT 07:41, 1 August 2007 (UTC)


 * This particular trick, though, is pretty simple. In fact, I almost wonder if this isn't some sort of homework exercise dressed up as a magic trick.  Anyway: Number the cards "backwards" down from 14, so that an ace is 14, a two is 13, a three is 12 and so on all the way to queen = 3 and king = 2.  Now, given the way the cards are dealt, the "backwards" number of the top card in each pile equals the number of cards in that pile.  Since she dealt the cards, she also knows the total number of cards in all the piles put together.  You give her back all the cards in all piles but three and let her count them, then tell her the top card (and thus the number of cards) in two of the three piles.  At that point, it's not hard for her to add these together and subtract them from the total, and thus know how many cards there are in the remaining pile (and thereby what its top card is).  Using your example:
 * Total number of cards (known, since she dealt them): 55 (funny deck, that...)
 * Total number in discarded piles: 16
 * Total number in two of the remaining piles, based on the top cards: 13 (top card: 2) + 12 (top card: 3) = 25
 * Number of cards in the last pile: 55 - 16 - 25 = 14, which means the top card is an ace.
 * (Of course, if you did this trick yourself, you could just as well number the cards the usual way, such that ace = 1 and king = 13. The funny numbering is just to make the trick a little less obvious.)  —Ilmari Karonen (talk) 19:58, 5 August 2007 (UTC)
 * Typically a deck of 55 cards is the standard 52, 2 jokers and what is often either a blank/spare or a bridge scoring chart. -- SGBailey 13:39, 8 August 2007 (UTC)

Problem solving
I have just solved, hopefully, a problem and I would just like if someone here could check my method for me.

Ok the problem is:

'Prove that the below is divisible by 6 for all integers n.'

$$ n^3 + 11n \,\!$$

I handled n being odd and even as separate cases. I'll start with n being even.

$$ n=2k \,\!$$

$$ \implies 8k^3 + 22k \,\!$$

This is obviously divisible by 2 as it can be written $$ 2(4k^3 + 11k) $$

To prove it is divisible by 3, I shall use modulo 3 arithmetic

$$8 \equiv 2 \text{ (mod } 3)$$

$$22 \equiv -2 \text{ (mod } 3)$$

$$ \implies 2k^3 - 2k \,\!$$

$$ \implies 2k(k^2 - 1) \,\!$$

$$ \implies 2k(k+1)(k-1) \,\!$$

This again proves that the expression is divisible by 2.

If you choose $$ k$$ as a mulitple of 3, $$ 2k$$ will double it and the expression will still be divisible by 3.

If you choose $$ k$$ as one less than a multiple of 3, then $$ (k+1)$$ will be a multiple of 3.

If you choose $$ k$$ to be one more than a multiple of 3 then $$ (k-1)$$ will be a multiple of 3.

Therefore, since I have shown that the expression is divisble by two and by three, it follows that it is divisible by 6, for all even n.

Now I shall do the odds.

$$ n=2k+1 \,\!$$

$$ \implies (2k+1)^3 + 11(2k+1)\,\!$$

$$ \implies 8k^3+12k^2+28k+12\,\!$$

Obviously divisible by 2 as it can be re-written $$ 2(4k^3+6k^2+14k+6)$$

For 3, I shall again use modulo 3 arithmetic.

$$8 \equiv 2 \text{ (mod } 3)$$

$$12 \equiv 0 \text{ (mod } 3)$$

$$28 \equiv -2 \text{ (mod } 3)$$

$$12 \equiv 0 \text{ (mod } 3)$$

So the expression can be re-written as

$$ 2k^3 -2k\,\!$$

So I can use the same argument as above.

I think this is right but if it isn't could someone please tell me where I have gone wrong? Thank you. 172.201.117.162 10:16, 1 August 2007 (UTC)


 * Probably not wrong, but unnecessarily complicated. Of course 6&middot;2&middot;n is divisible by 6. One out of three consecutive numbers is divisible by 3, and at least one out of three consecutive numbers is divisibel by 2, so (n&minus;1)&middot;n&middot;(n+1) is divisible by 6. So 6&middot;2&middot;n+(n&minus;1)&middot;n&middot;(n+1) = n3+11&middot;n is divisible by 6. Bo Jacoby 11:48, 1 August 2007 (UTC).


 * Your reasoning looks fine. It is a good example of how a proof may be found little by little. When time permits, and especially for the benefit of others, we try to stand back from a finished proof and look for ways to simplify and condense it. Doing so gives the impression that good mathematicians discover proofs in elegant form, which is misleading and intimidating.
 * Here are examples of ways to simplify.
 * You worked out the helpful auxiliary fact that the product of three consecutive integers is always divisible by three. This suggests a lemma, that the product of m consecutive integers is divisible by m. Not only does this divide the main proof into convenient pieces, it gives a result that is itself interesting.
 * You had the idea of factoring, but never applied it to the raw initial expression. Factor n3+11n as n(n2+11), and notice how this implies divisibility by two. For, if n is even we're done; and if not, then n2 is odd, so that plus 11 is even.
 * There is a lovely way to write this second idea, using the fact that reduction modulo two is a homomorphism of arithmetic; that is, we can reduce any number at any time and not change the result. Since n reduces to either 0 or 1, and 11 reduces to 1, we have either 0×(02+1) or 1×(12+1). We can use the same idea for reduction modulo three. First reducing 11 to −1, the three cases are
 * 0×(02−1)
 * 1×(12−1)
 * (−1)×((−1)2−1)
 * Pilots say that any landing you can walk away from is a good landing, but some are nicer than others; mathematicians could say something similar about a proof. Even polished proofs in journals are often revisited, and a particularly interesting result may invite proofs in many different ways. A notable example is the law of quadratic reciprocity, for which Gauss himself published a number of different proofs, and others published hundreds of alternatives — and Gauss was notorious for not publishing a proof until it was highly refined!
 * So congratulations on your proof; here's wishing you many more. --KSmrqT 18:12, 1 August 2007 (UTC)
 * PS: I yield to the temptation to say one thing more. Working modulo three, we can factor n2−1, so the full expression becomes (n−1)×n×(n+1), which is three consecutive integers. Working modulo two, we are free to use +1 and −1 interchangeably; so we can again obtain (n−1)×n×(n+1). We can also improve our lemma slightly, to say that the product of m — or more — consecutive integers is divisible by m. Putting the factorization together with the lemma, we then have a rather pretty and economical proof.
 * This is, of course, serious overkill for a proof that applies to only one specific expression, n3+11n. A research mathematician would look for broad patterns to generalize, like our little lemma. --KSmrqT 22:58, 2 August 2007 (UTC)

Origin of the Arithmetic Mean
The arithmetic mean is quite a simple concept, but do any of you know when and where it originated? Greece, Persia, China? I imagine it was developed separately by a few societies, but any information would be appreciated. 199.172.246.196 16:16, 1 August 2007 (UTC)
 * from http://members.aol.com/jeff570/m.html "MEAN. Sir Thomas Heath in his History of Greek Mathematics, volume 1 (1921, p. 85) writes that Pythagoras 'discovered the dependence of musical intervals on numerical ratios, and the theory of means was developed very early in his school with reference to the theory of music and arithmetic. ... [There] were three means, the arithmetic, the geometric and the subcontrary.'"

so the concept was known to the greeks, the same site also gives the earliest use of the words "arithmetic mean" elsewhere.83.100.138.237 16:50, 1 August 2007 (UTC) see alsoPythagorean means

also http://www.amstat.org/publications/jse/v11n1/bakker.html gives examples of greeks using estimation methods closely related to averages to work out things.83.100.138.237 17:13, 1 August 2007 (UTC)

Travelling salesman problem
I need some help understanding this. If the probability is only 1 in 3600 that it will open a crossed section of path, doesn't that mean that there's a 3599/3600 chance that it will tangle a section of path? How would that possibly result in a solution other than in hoping your first couple hundred generations just happen to be mostly productive inversions? Also I don't understand the "card deck" analogy. How can a single town correspond to whole deck of cards? Isn't the whole path the one deck of cards? And how does reversing the path through 60 towns untangle a section of path? It looks to my intuition that only a 4-town inversion would help at all, like in the first example. --⁪frotht 18:51, 1 August 2007 (UTC)


 * I don't claim to understand that section fully, but I think I can answer your questions:
 * We have a blackbox that tells us the total length of every given path. When we try a random inversion, we check if we get a shorter path, and only if so do we proceed with the inversion.
 * I couldn't find the part where a single town corresponds to a deck - the section seems consistent about decks representing paths.
 * The four points in the example are not the points 2367 in which you can easily see the loop, but rather four points on one side of the crossing, 3456. By inverting them, you get a crossing-free shape. Likewise, you can untangle that example by inverting 712. However, if you have a crossing with a different number of points on each side, you will need to invert that number of points. It seems like you can always do with an inversion of 2 to 30 towns.
 * -- Meni Rosenfeld (talk) 19:26, 1 August 2007 (UTC)
 * Nice catch with #3, I didn't see that. But as for #2, I was asking about this sentence: "This has been simulated with a population of 180 card decks, from which 60 decks are selected in every generation using MATLAB. The figure below shows a random tour at start". I don't get it --⁪frotht 19:41, 1 August 2007 (UTC)
 * I think this means that we start with 180 possible paths; After we finish untangling a path, it will be loop-free but not necessarily optimal, so we try all those different paths. The "60 decks are selected" probably means that we take only 60 paths and try some inversion on them, but it is not clear why wouldn't we do this with all 180 paths every time. -- Meni Rosenfeld (talk) 19:52, 1 August 2007 (UTC)
 * It still doesn't make any sense, and how would reversing the entire sequence over and over do anything at all? --⁪frotht 20:57, 1 August 2007 (UTC)
 * If all we have is a random path and a blackbox distance device, we can't know in advance which inversions are needed to untangle it. There will be something like 1800 inversions to try (for the case of 60 towns). -- Meni Rosenfeld (talk) 23:17, 1 August 2007 (UTC)

"180 card decks" means "180-card decks", not "180 card-decks". (The associative rule (ab)c=a(bc) does not apply to English language). Bo Jacoby 21:03, 1 August 2007 (UTC).
 * The text is clearly not optimally clear. The mixed metaphor of card decks and DNA is not explained properly and unnecessarily confusing. My best guess is that the term "loop" used here means a self-intersecting path – a notion that is only meaningful if the tour is embedded in the plane, something that is not required by the problem statement or even possible in general – and not the graph-theoretic sense of loop. Even so, I don't understand where the probability 1/(60*60) comes from; for a random tour of 10 random points in a square the probability that it self-intersects is already more than 99%. The obscurity, non-standard terminology and lack of references makes we wonder if this might be "original research". --Lambiam 00:42, 2 August 2007 (UTC)


 * I think "loop" is also some sort of metaphor, which indeed makes the most sense when the towns are on the plane - what it means in general is any situation when an inversion shortens the entire path. 1/(60*60) is not the probability that the path has a loop, but rather (a bound for) the probability that a given possible inversion, chosen in random, will untangle a loop (assuming that there is a loop in the graph), and it comes directly from a bound on the number of possible inversions. -- Meni Rosenfeld (talk) 13:34, 2 August 2007 (UTC)

Simple Math
If day 1 was zero degrees and day 2 was minus one, could you fairly say that day two was infinitely colder than day one? For some reason this question occurred to me and I couldn't think what the answer would be. Or maybe this isn't a fair question in the first place. Regardless, thank you in advance.


 * Temperatures aren't simple numerical values though, they are in units and can therefore be converted. Day 1 is 0 degrees Celsius, therefore 273 degrees Kelvin. Day 2 is -1 degrees Celsius, therefore 272 degrees Kelvin. Therefore, day 2 is 1.003676... (273÷272) times colder than day 1. {Or contains 1.003676...^-1 times less heat than day 1}. -- Codell Talk 23:06, 1 August 2007 (UTC)

So would 1 degree Kelvin be infinitely warmer than absolute zero?


 * You could say that, yes. (This is one reason why, as the third law of thermodynamics says, zero tempareture is unobtainable). But it's not a statement which really means much. -- Meni Rosenfeld (talk) 23:20, 1 August 2007 (UTC)

You could also simplify this question to "is 1 infinitely more than 0"? and input it into your calculator as 1÷0= and get MATH ERROR, and remember from high school that anything divided by 0 is infinity and know that the answer is in fact Yes. -- Codell Talk 23:32, 1 August 2007 (UTC)
 * Or you could – and in fact should – say: the question is meaningless. Recall that p/q = −p/(−q). Using the fact that 0 = −0, we have then that 1/0 = −1/(−0) = −1/0, so you could say, with equal justification (or equal lack of it) that "1 is infinitely less than 0". --Lambiam 01:06, 2 August 2007 (UTC)
 * They now teach in high school that "anything divided by 0 is infinity"? Do the teachers even know what infinity means? Anyway, you really should take a look at division by zero for a more serious discussion of the issue.
 * Note that asking if 1K is infinitely hotter than 0K is less meaningless than asking if 1 is infinitely greater than 0, because temperatures, in the usual sense of the word, cannot be negative (though there is also a less usual sense of the word). -- Meni Rosenfeld (talk) 13:28, 2 August 2007 (UTC)


 * Mine doesn't teach that... but some might. They do teach that the limit of 1/x as x goes to 0 is infinity, though... which is where the misunderstanding might come from. Gscshoyru 13:32, 2 August 2007 (UTC)
 * Properly speaking that limit does not exist. There are two one-sided limits: $$\lim_{x\to 0^+}1/x = +\infty$$ and $$\lim_{x\to 0^-}1/x = -\infty$$. --Lambiam 18:06, 2 August 2007 (UTC)
 * Unless we identify the two, of course. Algebraist 20:45, 2 August 2007 (UTC)
 * But then we lose the ordering, so you can't even say that "1 is more than 0" period – forget about this being supposed to be "infinitely more". --Lambiam 21:16, 2 August 2007 (UTC)