I am having a hard time understanding the actual definition of random variable (especially sequence of random variables) and a random sample, as well as the relation between these definitions. Unfortunately this confusion makes it hard for me to understand some of the concepts in statistics.
A random variable is sometimes called a "variable" which value varies according to a probability distribution. At other times, it is called a function that maps from the probability space to the number space. This is confusing already, but I am to somehow couple these two definitions (I guess each of these is more appropriate depending on the context).
Which confuses me more is "sequence of (most frequently i.i.d.) random variables" and "a sample coming from a random variable". I mean, I know the "random variable" term is there to emphasize the fact that we are not talking about any particular values, but actually "a sample coming from a random variable" seems just the same for me as long as we don't specify any particular values.
Is there any practical difference between those two? Or can they be used interchangeably depending on what you want to emphasize? Especially, what is the difference between a sequence of independent and identically distributed random variables and a sample of independent and identically distributed observations taken from a random variable?
Rephrasing the question in programming way, if in R i run the following code:
values <- rnorm(100)
Is this a sample of size 100 taken from one random variable, or is this a realisation of 100 identically distributed random variables? That's the other problem, it seems that a random variable is sometimes treated as one value, and at other times it is treated as a generator from which you can sample.
I am confused and would appreciate any hints or good sources to understand this properly.