Seeking explanation for the statement: "in general, it is helpful to think of an n-vector as a function whose domain is the set {1, . . . , n}" From this book, I'm lost as to what the author is trying to present in section 4.4 (start at Page 94), in particular the part I clipped below:

I don't understand how $a$ went from being an element in a vector to a function, how that's equivalent to looking at vectors as a ordered series of numbers, and what the advantage of this is. 
I'm also confused on the definition for $R^{S}$, it supposedly denotes a set of functions but I don't know what functions they are referring to.
The last part talks about situations where $S$ does not have natural ordering. If we are working with vectors which are always ordered, under what circumstances would $S$ not be ordered?
 A: So I think I would come at this in the opposite direction.  For any set $S$, let $\mathbb{R}^S$ denote the set of functions from $S$ to $\mathbb{R}$.  Such a function just assigns a value to every element of $S$.  $S$ could be a set of numbers, or a subset of the plane, or even just a finite set of symbols like $\{\star,*, \#\}$.  It doesn't really matter what $S$ is.  Any function on $S$ can be scaled by a real number, and any two functions on the same set $S$ can be added.  In that way, functions on $S$ behave just like the vectors in $\mathbb{R}^n$ that you are familiar with.
If $S$ is a finite set with order on it, you could line them up like $s_1, s_2, \dots, s_n$, and then a function on $S$ would correspond to a list $(f(s_1),f(s_2),\dots,f(s_n))$.  In this way, all functions on $S$ correspond to all $n$-tuples of real numbers, or just $\mathbb{R}^n$.  But if $S$ isn't ordered (or isn't countable, for that matter), there's no good way to write $f$ out as a list.  You just have to think of it as a symbol $f$ such that $f(s)$ is a number for all $s\in S$.
This seems complex, but it does include our previous notion of vector.  If $S = \{1,2,\dots,n\}$, then functions on $S$ are just $n$-tuples, by associating $f$ with $(f(1),f(2),\dots,f(n))$.  In the more usual vector-like notation, $f^i= f(i)$ for each $i$ from $1$ to $n$.  So the function space $\mathbb{R}^{\{1,\dots,n\}}$ is the same thing as $\mathbb{R}^n$.
To be honest, I don't think it's “helpful” to think of an $n$-tuple as a function on a finite, ordered set.  Rather, it's more helpful to think of functions as a generalization of $n$-tuples.  The point is to learn to look beyond the idea of vector as $n$-tuple.  You're being prepared for the abstract idea of “vector space” as any set whose elements can be added and scaled in some well-behaved ways.  Recognizing vector spaces, and using what you've learned already in linear algebra on those spaces, is what makes linear algebra so powerful.
A: $a_i$, or $a^i$ as the notation used in your example, for $i=1,2,\cdots ,n$ is a real number, $a$ is the function from $[1,2,\cdots,n]\subset \mathbb{N}$ to $\mathbb{R}$ which for a single vector assigns real numbers to each of its $n$ discrete positions. 
$B^A$ denotes any mapping (function) from set $A$ to set $B$. In the case of $\mathbb{R^S}$ we have for example $f: \mathbb{N}\rightarrow\mathbb{R}$ $f(n)=\ln (n+\pi)$, $g:\mathbb{R}\rightarrow\mathbb{R}$ $g(x)=\cos x$
If our domain is a set like $\mathbb{Q}\subset \mathbb{R}$ how would an ordering look? Could we place all elements of $\mathbb{Q}$ (or $\mathbb{R}, or\cdots)$ in an order of this sort? 
A: In the Euclidean case, we can think of $x\in \mathbf{R}^n$ as an $n-$tuple $(x_1,\ldots, x_n)$. But, if you think about it, this is the same thing as taking a map $f:\{1,\ldots, n\}\to \mathbf{R}$ so that we attach the "nametag" $i$ to an element of $\mathbf{R}$, called $x_i$. Then, we have an ordered tuple $(f(1),\ldots, f(n))=(x_1,\ldots, x_n)$. 
In your question, you say you "don't understand how $a$ went from being an element in a vector to a function."
In this case, $a=(a_1,\ldots, a_n)$. This corresponds uniquely to a function $a:\{1,\ldots, n\}\to \mathbf{R}$ such that $a(1)=a_1,\ldots, a(n)=a_n$. Similarly, such a function corresponds uniquely to an $n-$tuple of real numbers. 
Next, given two sets $X,Y$ we define $X^Y:=\{f:Y\to X\}$. That is, this is the set of set functions from $Y$ to $X$. In particular, we specialize to $\mathbf{R}^S:=\{f:S\to \mathbf{R}\}$. Here, we say that $f\in \mathbf{R}^S$ if and only if $f$ is a rule which assigns to each $s\in S$ an element of $\mathbf{R}$. 
For example, let $S= \{1,2,3\}$. Then examples of $f,g \in \mathbf{R}^S$ are 
$$ f(1)=1, f(2)=2, f(3)=3$$
$$g(1)=\pi, g(2)= 8200, g(3)=\sqrt{e}.$$ 
Note that the data of these functions are captured entirely by the $3-$tuples $(1,2,3)$ and $(\pi, 8200, \sqrt{e})$, respectively. 
For an example of a non-ordered set $S$, take $S=\{X,Y,Z\}$, seen as formal objects. Then an element of $f\in \mathbf{R}^S$ is a map which assigns to $X,Y,Z$ a real number $f(X),f(Y),f(Z)$ respectively. It's not obvious how to order $\{X,Y,Z\}$, since $\{X,Y,Z\}=\{Y,X,Z\}=\cdots$. But, we can define vectors in $\mathbf{R}^{\{X,Y,Z\}}$ as functions. In this sense, the function definition of vectors generalizes, since it does not rely on a notion of ordering.
