Random variable vs Statistic? What's the difference between a random variable and a statistic?
It seems that formally, a random variable is simply any real-valued function (and its domain is a set that we call a "sample space").
But isn't the exact same also true of a statistic? That is, isn't a statistic also simply any real-valued function (whose domain is a set called a "sample space")?

Example. We roll a die. The sample space is $\Omega=\{1,2,3,4,5,6\}$.
Let $T$ be double the value of the die roll: Formally, $T:\Omega\rightarrow \mathbb R$ is the function defined by $T(x)=2x$.
Is $T$ a random variable, a statistic, or both?

In your answer, please give:


*

*A precise definition of a random variable

*A precise definition of a statistic

*An answer to the question in my example: "Is $T$ a random variable, a statistic, or both?"

 A: A statistic is a function defined over one or more random variables.
So yes, a statistic is a random variable, and follows a distribution.
Another answer gave the example of the mean of a bunch of iid normal random variables.
$X_1,...,X_n\sim N(\mu,\sigma^2)$
The mean is a statistic because it is a function defined over random variables
$$\bar{X}= g(X_1, X_2 ... X_n) = \frac{1}{n} \sum_{i=1}^n X_i $$
There is one condition however, which is that a statistic cannot explicitly depend on unknown parameters. Take the following definition of $g$ :
$$ g(X_1) = \frac{X_1 - \mu}{\sigma}$$
While $g$ here is a function of a random variable, and it follows a standard normal distribution, it's not a statistic (unless $\mu$ and $\sigma$ are known).
For a more detailed explanation see pg. 122 of this.
A: The definition of a random variable depends on the context because how precise you need the definition to be depends on what kind of math you are doing. In the simplest definition, a random variable $X: \Omega\rightarrow \mathbb{R}$ is a function from a set of possible outcomes $\Omega$ onto the real numbers $\mathbb{R}$. For example, in the case of a coin, $\Omega = \lbrace H,T\rbrace$, you might have $H=1$ and $T=0$. The probability distribution carries all the info about the probabilities. 
A statistic is a quantity computed from a sample. In statistical theories, usually these samples are themselves random variables. So the statistic itself is a random variable. For instance, if 
$$X_1,...,X_n\sim N(\mu,\sigma^2)$$
then the sample mean is also a random variable
$$\bar{X}=\frac{1}{n} \sum_{i=1}^n X_i $$
$$\bar{X}\sim N\left(\mu,\frac{\sigma^2}{n}\right)$$
However, in practice, people may differ whether they consider a statistic to refer to a random variable.  
A: The key thing is that a statistic is not a function of unknown parameters; so not all random variables are statistics. See Examples of a statistic that is not independent of sample's distribution?. And note that the distribution of a statistic may depend on unknown parameters; cf. a pivot, a random variable whose distribution does not depend on unknown parameters, though it may be a function of unknown parameters.
That something is a statistic doesn't mean you have to call it one: in applications the term tends to be reserved for random variables that play a special rôle in inference or description, & typically reduce the dimensionality of the sample space. Your T is a random variable; & also a statistic, even though no such motivation for using the latter term is evident.
