Question about definition of random sample In my statistics class, we're just beginning to talk about (point) estimation. I have a small question that might actually be due more to notation/definition than anything very conceptual:
Say you have a population $P$ of students in a classroom and you want to find the mean height by randomly selecting $n$ students $s_1,...,s_n$ in $S\subseteq P$ to measure. My book calls $X_1,...,X_n$ a random sample. I'm just a little confused as to what $X_i$ is defined to be (what $X_i$, as a random variable, is mapping from). In this example, my book would say {$X_1,...,X_n$} are the respective heights of the $n$ randomly selected students. Just to make sure I have the right picture in my head: $S$ is the ("first") sample space and $X:S\to\mathbb{R}$ is a random variable ($X$ is the "height" function defined on $S$). We denote $X_i$ as the restriction of $X$ to the $s_i$-th student in $S$. That is, we define $X_i:${$s_i$}$\to\mathbb{R}$ so $X_i(s_j)$ is not defined for $i\neq j$, and: 
$X_1(s_1)=X(s_1)=x_1$
$X_2(s_2)=X(s_2)=x_2$
$.$
$.$
$.$
$X_n(s_n)=X(s_n)=x_n,$ where $x_1,...,x_n$ are the respective heights of the $n$ students. Then $Range(X)=${$X_1(s_1),...,X_n(s_n)$}$=${$X_1,....,X_n$} is considered the new sample space that we define the pmf/pdf $f$ on, where $f:\mathbb{R}\to\mathbb{R}$ and $f\circ X(s_1)=f(x_i)$. 
Is this the right idea?
 A: It's a good question. A lot of introductory statistics books are a bit vague when it comes to the mathematical set-up of the topics they treat.
The answer probably requires some familiarity with non-basic probability theory, but I think you'll follow just fine.
A stochastic variable is a measurable function from a background probability space, $\Omega$, into some other space. In our case we'll call this function $X$ such that $X: \Omega \rightarrow \mathbb{R}^n$. In this way, every coordinate will give the height of one the the students in a specific sample.
We now have the stochastic variable as a function from the background space.
What confuses you is probably just notation. In some books $X$ is reserved for the stochastic variable, while $x$ is reserved for some specific outcome. I think this a good way of doing it as it helps teach the distinction, but it is obvious that you're already aware of the distinction. If $x$ occurs with positive probability, we know that there exists $\omega \in \Omega$ such that $X(\omega) = x$. Or if we know that $X$ is surjective, we can also find such a $\omega$. Note that $x$ is a vector of $n$ heights, analogously to $X$ being a vector function.
In your above presentation, you are using multiple values in the background space for each outcome and talking about a restriction of $X$ to some student. It is more fruitful to think of one outcome (one $\omega$) and a vector function that determines the heights of all students.
In your case, the probability distribution is discrete in the sense that we only have finitely many students to choose from (each with one height), thus we can only combine them in finitely many ways. However, we can still define $X$ to take values in $\mathbb{R}^n$; zero probability is just assigned to most points. From this joint probability distribution, marginal and conditional ones can be calculated.
Alternatively, we could drop the notion of examining one specific class room and think of sampling from all potential class rooms.
