# Difference between power of a random variable and product of random variable with itself

In the R package distr there are two infix operators ^ and * that can be applied to random variables to generate new random variables. Example R code:

library(distr)
Norm()^2
Norm() * Norm()


However, these two operations do not produce the same thing. Let $X$ be a random variable; in our example $X \sim \operatorname{Norm}(0, 1)$. If I am interpreting the package maintainer correctly, the first is the image $\operatorname{Im}(X)$ of the map $X \to X^2$ and the second is the image of the map $X \times Y \to XY$.

I have two questions:

1. What is the difference between the two definitions above? In particular, is the first equivalent to the transformation $f(x) = x^2$ on the pdf of $X$?

2. Is it usual to use this notation? It's quite confusing that $X^2 \neq X*X$.

You are correct: The first is simply a univariate transformation of the random variable $X$. The second is the product of two independent random variables.
In fact, I would go so far as to say that it is incorrect to use the notation $X*X$ for this, since it suggests equivalence with $X^2$. A better notation would be to use $X_i*X_j$.
• So, if I write $X + X$ would you consider this to be the sum of two independent and identically distributed random variables, or would it be more precise to write $X_1 + X_2$ where $X_1, X_2 \sim \operatorname{Norm}(0,1)$. – Alex Jun 9 '16 at 1:12