Question about correlation between Y=A*B Vs B I was presented a correlation graph with data set A Vs data set B and there was no correlation.
Then I was shown another graph with Y=A x B Vs B and there there was correlation. As Y is calculated from B I thought there should automatically be a correlation between Y and B so why doing that correlation graph. But I did some simulation with randomly generated sets of B (A staying the same) and it was not always correlated. Does anyone has a mathematical explanation why Y = A x B should or should not be correlated to B
Thanks
 A: Here is a visual explanation.  It arises in the depiction of the function $(A,B)\to AB$ via some of its level sets, aka contours, for positive values of $A$ and $B.$

(The values of the contours won't matter much, so I won't consistently assign colors to values when making different plots.  It suffices to know that the contour values increase from bottom left to upper right in all the figures.)
Within this diagram are three regions, or "insets," shown as gray squares.  We are going to examine datasets whose scatterplots are located within those insets.
The upper left
At the upper left, the contours are nearly vertical.  This means that $AB$ scarcely changes when $B$ is varied, but is strongly affected by variations in $A.$  Here is a dataset of approximately uncorrelated points $(A,B)$ in this region, shown as the points in the scatterplot.

We can predict, then, that (1) $A$ will be strongly positively correlated with $AB$ but (2) $B$ should have little correlation with $AB.$  To check, let's examine the scatterplot matrix of all three variables.

The red lines are least-squares fits.  Their slopes reflect the correlations, making the correctness of the predictions immediately apparent as well as demonstrating the claim that $A$ and $B$ are not very correlated.
The upper right
In this regime, the contours are very nearly those of the linear function $(A,B)\to A+B-1.$  This will correlate $AB$ positively with both $A$ and $B.$  Here, without further explanation, are the figures showing the data and the scatterplot matrix to demonstrate this.


The Lower Left
In this regime the contours remain strongly curved.  As either $A$ or $B$ are varied, the values of the contours change in different ways depending on the values of $A$ and $B:$ that is, the associations between $A$ and $AB$ and between $B$ and $AB$ are strongly nonlinear.  Here are the corresponding figures.


Notice the curvilinear shapes to the $(A,AB)$ and $(B,AB)$ scatterplots: in both those cases the data avoid an entire triangular half of the region.

Conclusions
Because the function $(A,B)\to AB$ is homogeneous -- that is, scaling either of $A$ or $B$ does not change the geometry of its contours -- and because it is symmetric under interchanging $A$ and $B,$ we have explored all the qualitatively different regimes (at least for positive values).
When $A$ and $B$ are uncorrelated (or only slightly correlated), there are regimes

*

*as in the upper left where $A$ and $AB$ are positively correlated but $B$ and $AB$ are not strongly correlated;


*as in the upper right where both $A$ and $B$ are moderately positively correlated with $AB;$ and


*as in the lower left where although both $A$ and $B$ are moderately positively correlated with $AB,$ the relationships are noticeably nonlinear.
This kind of visual analysis can be carried out for studying the relationships between any two variables $A$ and $B$ and any function $f$ of them.  As you have seen, the relationships depend on the bivariate distribution of $(A,B)$ as well as the relationships between those $(A,B)$ points and the contours of $f.$
If you are somewhat handy with analytic geometry and elementary differential calculus, you will enjoy translating these visual analyses into mathematical demonstrations.  As an example, the assertion that the contours in the upper right corner are nearly linear can be shown by means of the Taylor expansion of $AB$ near $(A,B)=1,$ obtained by writing $A=1+\alpha$ and $B=1+\beta$ for small $\alpha$ and $\beta,$ via
$$AB = (1+\alpha)(1+\beta) = 1 + \alpha + \beta + \text{something very small} \approx 1 + \alpha + \beta = A + B - 1,$$ as claimed.
