# What is the difference between random variable and random sample?

These two expressions confused me a lot when I was learning statistics. It seems to me that they are totally different things.

A random sample is to randomly take a sample from a population, whereas a random variable is like a function that maps the set of all possible outcomes of an experiment to a real number.

However, say if I draw some samples $X_1$, $X_2$, $X_3$ and $X_i \sim N(\mu,\sigma^2)$, where $\mu$ and $\sigma$ are unknown, are $X_1$, $X_2$, $X_3$ random samples or random variables?

Yes, a random variable, $X:\Omega \rightarrow \mathbb R$, is a function from the sample space to the real line. This is a deterministic formula that can be as simple as writing down the number a die lands on in the random experiment of tossing a die. The experiment is random, in the way that we don't control many of the physical factors determining its outcome; however, as soon as the die lands the random variable maps the outcome in the physical world to a number.

Other examples would include measuring the height of a sample of eight graders, perhaps to infer the population parameters (including mean and variance). Each boy or girl would be a random experiment, pretty much like tossing a coin. However, once a subject is selected, the actual mapping to a number in inches or centimeters is not subject to randomness, despite its name of "random variable."

A group of such experiments would constitute a sample:

In statistics, a simple random sample is a subset of individuals (a sample) chosen from a larger set (a population). Each individual is chosen randomly and entirely by chance, such that each individual has the same probability of being chosen at any stage during the sampling process, and each subset of $k$ individuals has the same probability of being chosen for the sample as any other subset of $k$ individuals.

I would think that $\{X_1, X_2, X_3\}$ in the OP are a sample from a normal distribution (although you did not spell it out, I think that was the intention), and each one of the $X_i$ is a realization of the random variable.

Here is an identical post on Quora and parallel post on Math SE.

Also, I highly recommend the series of lectures by Professor Krishna Jagannathan from IIT. He is an MIT graduate, and has the most accessible series on-line on probability gently introducing measure theory. Wonderful!

• I tried to help, by simplifying. But my attempt was downvoted, so I removed it. A random variable is a hypothetical box to put numbers in. A sample is a collection of numbers. If you do no like that, simplify yourself. – Carl Mar 25 '18 at 0:57
• Each boy or girl would be a random experiment or Each boy or girl would be an outcome of a random experiment? I am feeling that second one is apt for the example. Am i wrong? – hanugm Aug 14 '19 at 4:37

In the OP's example, each random sample $$X_i$$ is an observation of same random variable $$X$$. So random sample is an observation of a random variable. Random variable is a function that maps sample space to real numbers.