Wikipedia:Reference desk/Archives/Mathematics/2009 August 17

= August 17 =

Tuk-tuks
How many Tuk-Tuk's (three wheeled vehicles) are in India? —Preceding unsigned comment added by Lanceboe (talk • contribs) 01:01, 17 August 2009 (UTC)


 * Since I doubt that there are accurate figures on the number of tuk-tuks in India, this sounds like a Fermi problem. In which case, how would you set up the problem, and which factors do you have trouble estimating? Confusing Manifestation (Say hi!) 05:12, 18 August 2009 (UTC)

QQ vs. YoY
I’m pulling my hair out trying to calculate quarter-to-quarter annualized real economic growth such that my results match those published by statistical authorities. Singapore, for example, contracted 3.5% in the second quarter (year-on-year), or it grew 20.7% on a quarter-to-quarter annualized basis. In Excel, my formula for year-on-year growth is =sum((Q2year2 –Q2year1)/Q2year1)*100, which give me, say, 4.3 or a 4.3% rise.

What formula should I use for quarter-to-quarter calculations? DOR (HK) (talk) 03:49, 17 August 2009 (UTC)


 * I don't understand the word "sum". The expression ((Q2year2 &minus; Q2year1)/Q2year1)*100 is just one term.  What terms are you adding? Michael Hardy (talk) 04:42, 17 August 2009 (UTC)
 * =sum is commonly used in Excel equations, although the "sum" may be optional. DOR (HK) (talk) 07:39, 17 August 2009 (UTC)
 * Similar terms are "=count" and "=average," if that helps. DOR (HK) (talk) 08:24, 17 August 2009 (UTC)


 * I am not certain what you are trying to do here - it might be clearer if you can show us your underlying data. Cheap and cheerful way to annualise quarterly returns is to multiply by 4, so 4.3% quarterly growth would be 17.2% annual growth. More accurate method is to compound quarterly growth using the formula (1 + r)4 - 1. So 4.3% quarterly growth annualises to (1.043)4 - 1 = 0.183 = 18.3% annual growth. Gandalf61 (talk) 08:45, 17 August 2009 (UTC)

OK, some real-world data:

US GDP, in chained 2005 $ billion

In the last line, year-on-year is calculated thus:
 * =((12,892 – 13,415) / 13,415) = -0.03898 (i.e., -3.9%)

The quarter-to-quarter annualized growth rate is reported as -1.0%. Question: what is the formula for arriving at -1.0% (or, any of the right-hand column numbers) using this data? Thanks. DOR (HK) (talk) 03:09, 18 August 2009 (UTC)


 * I think the Qtr-Qtr growth figures are calculated by finding the percentage growth since the previous quarter, then annualising this with compounding. For example, in Q2 2009 we have:
 * % growth since previous quarter = (12,892 - 12,925) / 12,925 = -0.00255 = -0.255 %
 * Annualised % growth = (1 - 0.00255)4 - 1 = -0.01017 = -1.02 %
 * Using this method, I get values of +1.44%, -2.66%, -5.38%, -6.44%, -1.02% as compared to the published figures of +1.5%, -2.7%, -5.4%, -6.4%, -1.0%. Gandalf61 (talk) 11:20, 18 August 2009 (UTC)

I agree. Michael Hardy (talk) 16:15, 18 August 2009 (UTC)

Many thanks for that. What I have not been able to do is to construct an Excel formula that duplicates the results. Any thoughts? DOR (HK) (talk) 01:33, 19 August 2009 (UTC)


 * Could it be that you're rounding too early? A small rounding error in an intermediate step can in some cases result in a large error in the bottom line.  Unless you've got a really good handle on how big the effect of rounding at some intermediate stepp will be on the bottom line, you should not round beyond what the machine forces you do to, until the last step. Michael Hardy (talk) 01:57, 19 August 2009 (UTC)
 * ...or it could be that the published figures are based on rounding too early. Michael Hardy (talk) 01:58, 19 August 2009 (UTC)

Got it! =(((Q2-Q1)/Q1)*4)*100 Been driving me crazy for the longest time. Many thanks! DOR (HK) (talk) 03:45, 19 August 2009 (UTC)

quick maths question
if ab > 0 and b > 0, can you take out b from the inequality, leaving a > 0? —Preceding unsigned comment added by 59.189.62.104 (talk) 05:46, 17 August 2009 (UTC)


 * Yes. If ab > 0 then either {a > 0 and b > 0} or {a < 0 and b < 0}. If you know that b > 0 then you also have a > 0. Gandalf61 (talk) 08:34, 17 August 2009 (UTC)
 * Alternative method, you can divide both sides by b. You can't do that without knowing it is positive since when you divide by a negative number you have to flip the inequality, but you do know it is positive, so that's ok. --Tango (talk) 13:23, 17 August 2009 (UTC)

How many eighth degree monic polynomials are such that...
I don't know if any programmer out there wants to tackle this, but my question is: How many monic polynomials of eighth degree have remaining coefficients in the set {0, 1, 2, ..., 41} and are composite when the variable is between 1 and 41 (inclusive), but prime when it is 42? I have one example, and I would like to know how many if any others there are. My example is

$$P(n)=n^8+15n^7+13n^6+17n^5+7n^4+40n^3+3n^2+34n+25$$.Julzes (talk) 15:17, 17 August 2009 (UTC)
 * How accurate do you want this figure? A Monte Carlo estimate shows that about 0.2% of the polynomials matching the coefficients criterion also match the primality criterion. Since there are $$42^8$$ of those, this turns out around $$2\cdot10^{10}$$. One pleasant-looking example I've found is $$n^8+9n^7+41n^5+3n^2+37$$. -- Meni Rosenfeld (talk) 20:29, 17 August 2009 (UTC)
 * I guess I'd like a slightly better estimate with the range expanded to between 0 and 68 with the exception at 42, as 69 is where the next prime comes in in my particular example. Ideally, I'm curious about just how far up the most extreme case goes (what the polynomial which presents itself as a prime the second time at the highest value is), but I don't suppose that is a practical inquiry.  I'm surprised that my initial question got any kind of answer and so quickly, and that the answer is on the order of one in every five hundred.Julzes (talk) 21:15, 17 August 2009 (UTC)
 * The high proportion should be no surprise at all - most numbers are composite, so it's not very demanding to require that many values of the polynomial will be. Neither should getting an answer so quickly - this is WP:RD/math. :)
 * About 0.022% of polynomials are prime for 42 and composite elsewhere between 0 and 68, which is about $$2.1\cdot10^{9}$$.
 * If I understood correctly that your "ideal inquiry" is to find a polynomial P such that:
 * The coefficients criterion is met.
 * $$P(42)$$ is prime.
 * $$P(n)$$ is composite for $$0 \le n \le N, n \neq 42$$.
 * N is as high as possible.
 * Then $$n^8+17n^7+8n^6+22n^5+14n^4+5n^3+3n^2+37n+25$$ satisfies this with $$N=1145$$. Of course, there may be polynomials with even higher N; only an exhaustive search (which would take quite a while) or some intelligent reasoning can find the absolute best. -- Meni Rosenfeld (talk) 16:14, 18 August 2009 (UTC)
 * PS: "Quite a while" = 5 years with my current program and hardware. So far I've improved N to 1697. -- Meni Rosenfeld (talk) 16:29, 18 August 2009 (UTC)
 * Ok. Thanks for all that.  How about prime at n=-41 and n=42, but composite in between, if you're interested in continuing?  Of course, you'll need either the broad definition of primality or to take absolute values.  I'm not at all surprised it would take 5 years to answer the bigger question.Julzes (talk) 22:05, 18 August 2009 (UTC)
 * I just noticed that the constant term has to be 25 (if P(0) is to be composite but P(42) prime). Also, the condition on negatives to but not including -41 should be more stringent than the condition involving some number greater than or equal to 69.  Julzes (talk) 03:17, 19 August 2009 (UTC)

question about probability
The time on digital clock is 10.38 .where here 1 is in column p ,0 is in q ,3 is in r and 8 is in column s .after x hours time is noted. find the probability that the number in
 * 1:- column q is "9"
 * 2:- column q is less than 5.

—Preceding unsigned comment added by True path finder (talk • contribs) 16:58, 17 August 2009 (UTC)


 * As you described it, the situation is perfectly deterministic, there is no probability involved. The answer is thus either 0 or 1 depending on the value of x. — Emil J. 17:15, 17 August 2009 (UTC)


 * (ec) Unless there is some constraint on x them it doesn't matter what the time now is. Is the clock a 12 hour or a 24 hour clock? 1:- 1/12 (09) or 2/24 (the same value) (09, 19) 2:- 7/12 (01, 02, 03, 04, 10, 11, 12) or 14/24 (01, 02, 03, 04, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24) -- SGBailey (talk) 17:18, 17 August 2009 (UTC)


 * SGBailey, you seem to be assuming x is a uniformly distributed random variable. Why are you assuming that.  This is a very vaguely stated question where we have to guess what was meant, so it doesn't seem safe to just assume things.  And you didn't even state that assumption. Michael Hardy (talk) 17:37, 17 August 2009 (UTC)
 * AFAIK, time is uniformly distributed. I take that as a given unless something else is stated. I did say "unless there is some constraint on x" which was intended to specify the conditions of my answer. With no x constraint then the time after x is equally likely to be anywhere in a 24 hour cycle. The OP has now constrained x to be from T+1 to T+25 - this happens to be a 24 hour period, so I think my answer still applies. -- SGBailey (talk) 20:24, 19 August 2009 (UTC)
 * As a minor aside (obviated now that OP has clarified) it is not even possible for x to be uniformly distributed. As I said minor, but relevant to the solution of some apparent paradoxes.-- SPhilbrick  T  20:11, 18 August 2009 (UTC)

sorry, condition on x is 1 <x <25.and answer on book is 0.1 of first and 0.5 of second. —Preceding unsigned comment added by True path finder (talk • contribs) 19:55, 17 August 2009 (UTC)
 * Okay, so the time at which we next look at the clock is later than 11:38 today and earlier than 11:38 tomorrow. Let's assume, for the sake of argument, that the time is uniformaly distributed between those limits. Then I don't think I can see how the answer you gave can be reached. Are you sure you have told us the right column - column q is the least significant digit of the hours number, yes ? Gandalf61 (talk) 12:13, 19 August 2009 (UTC)

round robin tournament
I'm wondering about ways of proving that "a round robin tournament is always possible to construct for an even number of players"

The algorthym in section Round-robin_tournament shows that it is always possible. However it's not clear how I could obtain that algorthym without having a 'flash of inspiration'. ie to me it seems that the algorhtym is non-obvious... Is there a more workmanlike proof of do-ability.?83.100.250.79 (talk) 19:43, 17 August 2009 (UTC)
 * Number the players p1,p2,...p(2n). Draw a point for each player and draw lines (edges) between every pair of points (complete graph on 2n nodes).  There will be (2n)(2n-1)/2 = n(2n-1) such edges where each edge represents a game between the two players it connects.  Then just enumerate the edges in any way you like, and take n of them in every round, giving a 2n-1 round tournament. 70.90.174.101 (talk) 03:14, 19 August 2009 (UTC)
 * Yet taking the edges off in certain orders can result in having unplayable rounds - ie certain combinations don't work.
 * Is there a way to proof that there will always be a valid combination of games for all rounds for any n?83.100.250.79 (talk) 12:36, 19 August 2009 (UTC)


 * I've designed such tournaments from time to time, using the following method. Whether it is equivalent to the algorithm you cite I can't say, but it works for any number of players (for an odd number, create an extra dummy player to denote an idle round). To avoid confusing (to me, anyway) generality, I'm taking the case of 8 players from A to H, but I can see that by simple extension it will work for any number. A table will be constructed showing the number of the round in which each pairing will occur, with rows from A to G and columns from B to H - ultimately, only the "northeast" part will apply. From the top, put 1 and 2 in col B, 2, 3 and 4 in col C, ..., 6, 7, 1, 2, 3, 4 and 5 in col G and 7 in col H. Col H is then completed by transferring the "below diagonal" entry in each row, i.e. 2 in row B, 4 in row C, etc, giving col H the successive values 7, 2, 4, 6, 1, 3 and 5 from the top. You'll see that this process guarantees the 28 matches will be played in 7 rounds.


 * For any number of players, the columns for all but the last one are filled immediately, that for the last one is completed by transferring the numbers below the stepped diagonal. The quick way to fill the last column, once you've seen the pattern, is to put the highest round number (odd) at the top, then to follow it with the even rounds from 2 upwards then the other odd ones from 1 upwards.→217.43.210.186 (talk) 19:19, 19 August 2009 (UTC)
 * It sounds basically the same in that it gives one solution, but apart from working - doesn't explain how...

I was wondering if anyone had found how to calculate the number of different sets of complete rounds constructable for every n (clearly each round has (n/2)! degenerate permutations, and the sets of rounds assuming order of play is irrelevent is also (n-1) degenerate).

But ignoring the degenerate cases is there ever more than one way to contruct an entire set of rounds of games?83.100.250.79 (talk) 22:30, 19 August 2009 (UTC)


 * Yes, there are additional ways. For example, with players 1, 2, 3, 4, 5, 6, we could have a set of rounds containing (1, 2)(3, 4)(5, 6) and another set of rounds containing (1, 2)(3, 5)(4, 6), and these two sets are not related by the degeneracies you identified.  But that raises the question of whether there are additional ways after accounting for degeneracies from permuting players.  Eric.  216.27.191.178 (talk) 02:17, 20 August 2009 (UTC)
 * Yes thanks, that's obvious though I didn't think of it.83.100.250.79 (talk) 11:36, 20 August 2009 (UTC)
 * There are distinct ways to create a tournament with 8 players even after identifying tournaments related by permutation of round order, permutation of games within a round, and permuting the identity of the players. Eric.  216.27.191.178 (talk) 02:27, 20 August 2009 (UTC)
 * Thanks, I was wondering about that, but haven't suceeded in finding a way to calculate the number.
 * In all honesty I imagine any solution (if known) might be too complex for me to understand.83.100.250.79 (talk) 19:19, 21 August 2009 (UTC)