# Which Pearson correlation formula right?

on my lecture handbook show that Pearson Correlation is

$$R_{xy}=\frac{N \sum XY - \sum X \sum Y}{\sqrt{[N\sum X^{2} - (\sum X)^2] [N\sum Y^{2} - (\sum Y)^2]}}$$

but in other source say

$$r = \frac{\sum (x-\overline{x})(y-\overline{y})}{\sqrt{\sum(x-\overline{x})^2\sum(y-\overline{y})^2}}$$

Which one is correct? thanks

• Wh\at happens when you use both on the same data? – Glen_b Oct 2 '17 at 0:37
• If you correct the typo in your second formula, then both are correct. Otherwise, the first one is correct. – L.V.Rao Oct 2 '17 at 1:53