Wikipedia:Reference desk/Archives/Mathematics/2008 May 14

= May 14 =

what is the diffrent with prism and pyramid?
--24.78.51.208 (talk) 00:17, 14 May 2008 (UTC)


 * Maybe you can find what you want in prism (geometry) and pyramid (geometry). PrimeHunter (talk) 01:55, 14 May 2008 (UTC)
 * A prism has two triangular faces and three rectangular faces; a pyramid has four triangular faces and one square face. Stifle (talk) 09:55, 14 May 2008 (UTC)
 * Not necessarily. You just described a triangular prism and a square pyramid. A prism is a solid that has a uniform cross-section, whereas a pyramid has a base and edges from the base which connect to some point. I hope my terminology is correct. --WikiSlasher (talk) 12:14, 14 May 2008 (UTC)
 * So basically, a pyramid has a vertex that's connected to all other vertices by an edge, whereas a prism does not have such a vertex. (There are other polyhedrons that have a vertex connected to all other vertices though.)  &#x2013; b_jonas 07:55, 16 May 2008 (UTC)

regression toward the mean
The eugenics article says: [Galton] reasoned that, since many human societies sought to protect the underprivileged and weak, those societies were at odds with the natural selection responsible for extinction of the weakest; and only by changing these social policies could society be saved from a "reversion towards mediocrity," a phrase he first coined in statistics and which later changed to the now common "regression towards the mean."[18] Isn't this a completely different concept from "regression towards the mean"? My understanding of regression is that it is symmetric with respect to both time and direction. So although extreme data points will regress to the mean, the total number of extreme data points does not increase or decrease on average. --MagneticFlux (talk) 03:00, 14 May 2008 (UTC)


 * Yes, the strict sense of what was meant in the quote is not the same as the current "regression towards the mean".


 * Ironically, one could plausibly argue that if Galton did fully understand the current meaning, he may have been less keen on his eugenical ideas (then again, speaking as no expert, maybe he already did understand, and/or was less keen). RttM implies that the impact of any eugenical activity would be less than one would naively think, and thus can actually be seen to be a mild discouragement to it.  Then again, if one watches sports commentators ramble on about the current superlative players du jour, one can sympathize with a eugenicist's misunderstanding.  Baccyak4H (Yak!) 14:16, 14 May 2008 (UTC)

Spearman-Rho, and Kruskal-Wallis tests
I was wondering, why is there a 6 in the spearman-rho formula, and why is there a 12 in the formula for a Kruskal-Wallis test? --Agester (talk) 23:27, 14 May 2008 (UTC)


 * Regarding Kruskal-Wallis, our article says that: "Notice that the denominator of the expression for $$K$$ is exactly $$(N - 1)N(N + 1) / 12$$".  Using the notation from the article, we can work out the value for the denominator:
 * $$\sum_{i=1}^g \sum_{j = 1}^{n_i} (r_{ij} - \bar{r})^2 = \sum_{k=1}^N (k - \bar{r})^2$$
 * $$ = \sum_{k = 1}^N (k^2 - 2k\bar{r} + \bar{r}^2)$$
 * $$ = \sum_{k = 1}^N k^2 - 2\bar{r}\sum_{k = 1}^N k + N\bar{r}^2$$
 * $$ = \sum_{k = 1}^N k^2 - 2\bar{r}(N\bar{r}) + N\bar{r}^2$$
 * $$ = \sum_{k = 1}^N k^2 - N\bar{r}^2$$
 * $$ = \frac {N(N + 1)(2N + 1)}6 - N\frac {(N + 1)^2}4$$
 * $$ = \frac {(N - 1)N(N + 1)}{12}$$
 * Notice that the transformation I did from $$\sum_{k = 1}^N (k - \bar{r})^2$$ to $$\sum_{k = 1}^N k^2 - N\bar{r}^2$$ is exactly the same as in the article computational formula for the variance, and works because $$\bar{r} = (N + 1)/2$$ is the average of the integers 1 through $$N$$. As for the very first equality, where I ditched the $$r_{ij}$$, this is because in the summation over $$i$$ and $$j$$, $$r_{ij}$$ varies exactly over the integers 1 through $$N$$, so the equality is simply changing the order of the summation (which is valid).
 * I don't know about Spearman-Rho, as our article doesn't give an explicit explanation for the formula. Eric.  86.153.201.165 (talk) 03:28, 15 May 2008 (UTC)
 * Ok, I've looked at the article on Spearman-rho formula in a bit more detail. It says "In principle, ρ is simply a special case of the Pearson product-moment coefficient in which the data are converted to rankings before calculating the coefficient."  So if we look at Pearson product-moment correlation coefficient, we find the following formula:
 * $$\rho = \frac 1N \sum \left( \frac {X_i - \mu_X}{\sigma_X} \right) \left( \frac {Y_i - \mu_Y}{\sigma_Y} \right)$$
 * This is the information we need. The formula on the Spearman-rho page:
 * $$\rho = 1 - \frac {6 \sum d_i^2}{N (N^2 - 1)}$$
 * is the same as the previous formula, with some simplifications made. In our Pearson product-moment correlation coefficient, $$\mu$$ is the mean and $$\sigma$$ is the standard deviation of our population $$X_i$$ or $$Y_i$$.  The additional information we have, is that the $$X_i$$ are exactly the numbers 1 through $$N$$, in some order;  similarly for the $$Y_i$$.  Because the mean $$\mu_X$$ and standard deviation $$\sigma_X$$ do not depend upon the order, we can compute these values.  We have:
 * $$\mu = \frac 1N \sum_{i = 1}^N X_i = \frac 1N \sum_{i = 1}^N i = \frac {N + 1}2$$
 * $$\sigma^2 = \frac 1N \sum_{i = 1}^N (X_i - \mu_X)^2 = \frac 1N \cdot \frac {(N - 1)N(N + 1)}{12} = \frac {(N^2 - 1)}{12}$$
 * Notice that our $$\mu$$ here is the same thing we had called $$\bar{r}$$ in our discussion above of Kruskal-Wallis. And our $$\sigma^2$$ (i.e., variance) is the same as the denominator of $$K$$ which we calculated above for the Kruskal-Wallis formula, except divided by $$N$$.  Now that we know what $$\mu$$ and $$\sigma$$ are, we can proceed to simplify down the Pearson product-moment correlation coefficient:
 * $$\rho = \frac 1N \sum \left( \frac {X_i - \mu_X}{\sigma_X} \right) \left( \frac {Y_i - \mu_Y}{\sigma_Y} \right) = \frac 1N \sum \left( \frac {X_i - \mu}{\sigma} \right) \left( \frac {Y_i - \mu}{\sigma} \right) $$
 * $$ = \frac 1{N\sigma^2} \sum (X_i - \mu) (Y_i - \mu) $$
 * $$ = \frac {12}{N(N^2 - 1)} \sum (X_i - \mu) (Y_i - \mu) $$
 * It should be possible to continue in this way to get to the end formula (I haven't checked; also, keep in mind that $$d_i = X_i - Y_i$$):
 * $$ = 1 - \frac {6 \sum d_i^2} {N (N^2 - 1)} $$
 * but in any case we can already where the 6 (and the $$N^2 - 1$$, as well) is coming from. Eric.  86.153.201.165 (talk) 05:41, 15 May 2008 (UTC)

I've tried to keep up with your math. It's not making sense to me (Spearman-Rho). I tried various calculations with the information you provided but i just couldn't get back to the original formula (posted on the Spearman-Rho article). However, for the Kruskal-Wallis test formula, my text book represents it a bit more different than on the article / the one you presented. It gives me (sorry I'm still not too good with wikipedia's math function thingy): Hobt = [ 12 / N(N+1) ][ Σ (R)²/ni ] - 3(N+1)
 * I don't have time at the moment to answer your questions, but I'll see if I can get back to them in a few days and also fill in the step I skipped at the end (or maybe someone else will). Can I ask, did the part I wrote out above make sense, or is there something in particular you didn't follow?  Don't worry about having trouble with using LaTeX:  here's how you would typeset your formula:
 * $$H_{\text{obt}} = \left[ \frac {12} {N(N + 1)} \sum \frac {R^2}{n_i} \right] - 3(N + 1)$$
 * Eric. 144.32.89.104 (talk) 14:35, 19 May 2008 (UTC)

I did follow the exact steps you provided. And i came up with the same results as you did until the last part (you misplaced an N in the denominator but i caught on with what you were going with): $$ = \frac {12}{N(N^2 - 1)} \sum (X_i - \frac {N + 1}2) (Y_i - \frac {N + 1}2) $$ I tried changing the μ you provided, but it came out to a long quadratic equation that didn't match anything close to di2 where di = Xi - Yi. --Agester (talk) 21:25, 20 May 2008 (UTC)
 * Ah, right, I did miss an $$N$$ (fixed now). Recall from the above that:
 * $$N\mu^2 = \sum_i X_i^2 - \frac{N(N^2 - 1)}{12}$$
 * Ok, continuing, we have:
 * $$ \rho = \frac {12}{N(N^2 - 1)} \sum_i (X_i - \mu) (Y_i - \mu) $$
 * $$ = \frac {12}{N(N^2 - 1)} \left[ \sum_i X_i Y_i + N\mu^2 - \mu \sum_i X_i - \mu \sum_i Y_i \right] $$
 * $$ = \frac 6{N(N^2 - 1)} \left[ 2\sum_i X_i Y_i - 2N\mu^2 \right] $$
 * $$ = \frac 6{N(N^2 - 1)} \left[ 2\sum_i X_i Y_i + \left( \frac {N(N^2 - 1)}6 - \sum_i X_i^2 - \sum_i Y_i^2 \right) \right] $$
 * $$ = 1 - \frac 6{N(N^2 - 1)} \left[ \sum_i X_i^2 + \sum_i Y_i^2 - 2\sum_i X_i Y_i \right] $$
 * $$ = 1 - \frac 6{N(N^2 - 1)} \sum_i d_i^2,$$
 * which is what we wanted. Now, the other thing we want to show is that $$K = H_{\text{obt}}$$, where
 * $$ K = \frac {12}{N(N + 1)} \sum_{i = 1}^g n_i (\bar{r_i} - \bar{r})^2$$
 * $$ \bar{r} = \mu $$
 * $$ \bar{r_i} = \frac 1{n_i} \sum_{j = 1}^{n_i} r_{ij} $$
 * Let $$ S = \sum_{i = 1}^g n_i (\bar{r_i} - \bar{r})^2 $$. Then
 * $$ S = \sum_{i = 1}^g n_i \left[ \bar{r_i}^2 + \mu^2 - 2\mu\bar{r_i} \right] $$
 * $$ = \mu^2 \sum_{i = 1}^g n_i - 2\mu \sum_{i = 1}^g n_i \bar{r_i} + \sum_{i = 1}^g n_i \bar{r_i}^2 $$
 * $$ = N\mu^2 - 2N\mu^2 + \sum_{i = 1}^g n_i \bar{r_i}^2 $$
 * $$ = \left[ \sum_{i = 1}^g n_i \bar{r_i}^2 \right] - N \left( \frac {N + 1}2 \right)^2 $$
 * $$ = \left[ \sum_{i = 1}^g n_i \bar{r_i}^2 \right] - \frac {N(N + 1)(N + 1)}4. $$
 * If we assume that your $$R$$ is
 * $$ R = \sum_{j = 1}^{n_i} r_{ij} = n_i \bar{r_i},$$
 * then hopefully it should be clear from here how to find that $$ K = H_{\text{obt}} $$. Eric.  144.32.89.104 (talk) 13:04, 22 May 2008 (UTC)