Vivid examples of vector spaces? When teaching abstract vector spaces for the first time, it is handy to have some really weird examples at hand, or even some really weird non-examples that may illustrate the concept. For example, a physicist friend of mine uses "color space" as a (non) example, with two different bases given essentially {red, green, blue} and {hue, saturation and brightness} (see http://en.wikipedia.org/wiki/Color_space). I say this is a non-example for a number of reasons, the most obvious being the absence of "negative color". 
Anyhow, what are some bizarre and vivid examples of vector spaces you've come across that would be suitable for a first introduction?
 A: Vector spaces over $\mathbb{Z}_2$ are quite interesting. Tell them $0=$ false and $1=$ true.
Then $0+0=0$, $0+1=1$, $1+0=1$, and $1+1=0$ means "$+$" is "exclusive or".
$00=0$, $01=0$, $10=0$, and $11=1$ means "$\times$" is "and".
The $\mathbb{Z}_2$-vector space $(\mathbb{Z}_2)^n$ is the space of codes with $n$-bits.


*

*Wikipedia article on Binary Codes.

A: The solutions of the differential equation $y''+p y' +q y=0$ on some interval $I\subset{\mathbb R}$ form a vector space $V$ of functions $f:I\to{\mathbb R}$. What is the dimension of this space? Physical intuition or the fundamental existence and uniqueness theorem for differential equations tell you that this dimension is 2: Consider the two initial problems $y(0)=1, y'(0)=0$ and $y(0)=0, y'(0)=1$. The two corresponding solutions $y_1(\cdot)$, $y_2(\cdot)$ form a basis of $V$. Now comes the upshot: You can "guess" explicit solutions of the form $y(t):=e^{\lambda t}$ for suitable $\lambda$'s (apart from special cases), and in this way you obtain a completely different basis of $V$.
Of course this is not "weird", but it is an instance of a finite-dimensional vector space which does not have a "natural" basis to begin with.
A: The vector space of all order $n$ magic squares ($n\times n$ matrices with real entries and all row and column and diagonal sums equal). 
The reals as a vector space over the rationals. ${\bf Q}(\sqrt2)$ as a vector space over the rationals. 
A: An interesting one I saw in Anton Elementary Linear Algebra (10th ed. ch.4 ex. 8: "An Unusual Vector Space").
The set of positive reals as a vector space over the reals.  (I will place a vector over vectors, e.g. $\vec{u}$ and use plain letters for scalars and the values of vectors as reals (so $\vec{u}$ is the vector whose "real number value" is $u$), hopefully this reduces confusion.)
For vectors $\vec{u}$ and $\vec{v}$ and a real number $k$ define:
$\vec{u}+\vec{v} := uv$
$k\cdot\vec{u} := u^k$
We then have:
$\vec{0} = 1$
$-\vec{u} = 1/u$
A: Some examples that come to mind are Fock space, the vector space of all linear combinations of bets on a set of events, the subspace of all coherent combinations of bets (which is the kernel of the linear map from the space of all combinations to their expectation values), and the vector space of all functions specifying air pressure as a function of time, say, on a 5-minute interval, which includes all sorts of speeches and songs as well as all their combinations with people speaking and singing on top of each other with different volumes.
A: The space of all light switch settings in a house is a vector space over the field with 2 elements, and the set of all invertible adjectives in sentences is a vector space over the field with 3 elements.
A: The real vector space of all fibonacci sequences (the first two values are arbitrary) is quite instructive. Or the subspace of all smooth functions satisfying the differential equation $f'=f$. It is quite illuminating that elementary linear algebra has a interplay with analysis.
A: *

*The positive real numbers, where 1 is the "zero vector," "scalar multiplication" is really numerical exponentiation, and "addition" is really numerical multiplication. 

*Simplicial complexes, as in algebraic topology, are another good example, but perhaps this is even too weird. Still, it might be fun to throw out the idea that mathematicians like to add triangles to each other to get quadrilaterals and negate them to reverse orientation, but they'll probably have to take it on faith that this is actually useful. 
A: I like the example $C([0,1])$ of continuous functions on the interval (or something similar). It is familiar-looking but shows that there is not always a natural choice of basis.
A: I like the color example.  It shows how the idea of a basis is useful, even though it's not a vector space.
Barycentric coordinates are another example of something like a vector space but not a vector space.
A: Let $G$ be a finite, simple, undirected graph. A spanning subgraph of $G$ is a subgraph that contains all of the vertices of $G$. The set of spanning subgraphs of $G$ is a vector space over the finite field $\mathbb{F}_2$: given spanning subgraphs $H$ and $H'$, declare a pair of vertices to be adjacent in $H+H'$ if and only if they are adjacent in exactly one of $H$ or $H'$.
An interesting subspace of this vector space is the cycle space $C(G)$, which consists of those spanning subgraphs which are even, in the sense that every vertex has even degree. It is an interesting exercise to show that, as the name indicates, $C(G)$ is spanned by the cycles of $G$. 
Indeed, assume that $G$ is connected, and let $T$ be a spanning tree of $G$. Adding any single edge of $G-T$ to $T$ produces a cycle. The cycles constructed in this way are called the fundamental cycles of $T$, and in fact these cycles form a basis for $C(G)$.
One application of this theory is Mac Lane's planarity criterion, which states that a graph is planar if and only if there exists a basis $\beta$ for $C(G)$ such that each edge of $G$ is an edge of at most two elements of $\beta$.
A: After introducing the standard scalar multiplication and addition in $\mathbb{R}^n$ the following example may be entertaining.
Example 1 Suppose $n \geqslant 1$, we define in $\mathbb{R}^{n+1}$ the addition by
$$
\\
(x_0,x_1,\dots,x_n) + (y_0,y_1,\dots,y_n)=
\begin{cases}
\left(x_0+y_0,\frac{x_0x_1+y_0y_1}{x_0+y_0}, \dots,\frac{x_0x_n+y_0y_n}{x_0+y_0}\right) &\text{if } x_0+y_0\neq0,
\\
\left(0,x_0x_1+y_0y_1, \dots,x_0x_n+y_0y_n \right) &\text{if } x_0+y_0=0, x_0\neq0,
\\
\left(y_0,x_1+\frac{y_1}{y_0}, \dots,x_n+\frac{y_n}{y_0} \right) &\text{if } x_0=0,y_0\neq0,
\\
\left(x_0,\frac{x_1}{x_0}+y_1, \dots,\frac{x_n}{x_0}+y_n \right) &\text{if } x_0\neq0,y_0=0,
\\
\left(0,x_1+y_1, \dots,x_n+y_n \right) &\text{if } x_0=0,y_0=0.
\end{cases}$$
and the scalar multiplication by
$$a\cdot(x_0,x_1,\dots,x_n) = 
\begin{cases}
(0,0,\dots,0) &\text{if } a=0,
\\
(ax_0,x_1,\dots,x_n) &\text{if } a\neq 0,x_0\neq0,
\\
(0,ax_1,\dots,ax_n) &\text{if } x_0=0.
\end{cases}
$$
Example 2
A slightly more general example based off the same idea. Suppose $V$ is a vector space over a field $\mathbb{K}$ and define the addition by
\begin{align*}
+ : (\mathbb{K}\times V)\times  (\mathbb{K}\times V) &\to  (\mathbb{K}\times V) \\  (x,\pmb{u}) + (y,\pmb{v})&=
\begin{cases}
\left(x+y,\frac{x}{x+y}\pmb{u} + \frac{y}{x+y}\pmb{v}\right) &\text{if } x+y\neq0,
\\
\left(0,x\pmb{u}+y\pmb{v} \right) &\text{if } x+y=0, x\neq0,
\\
\left(y,\pmb{u}+\frac{1}{y}\pmb{v} \right) &\text{if } x=0,y\neq0,
\\
\left(x,\frac{1}{x}\pmb{u}+\pmb{v} \right) &\text{if } x\neq 0,y=0,
\\
\left(0,\pmb{u} +\pmb{v} \right) &\text{if } x=0,y=0,
\end{cases}
\end{align*}
and the scalar multiplication by
\begin{align*}
\cdot : \mathbb{K}\times  (\mathbb{K}\times V) &\to  (\mathbb{K}\times V) \\  a\cdot(x,\pmb{v}) &= 
\begin{cases}
(0,\pmb{0}) &\text{if } a=0,
\\
(ax,\pmb{v}) &\text{if } a\neq 0,x\neq0,
\\
(0,a\pmb{v}) &\text{if } x=0.
\end{cases}
\end{align*}
Then the first example is just a special case ($V=\mathbb{R}^n$). Checking that these are indeed vector spaces is a good home work.
Both examples are drawn from the construction of an universal space of an affine space applied to affine space $\mathbb{R}^n$ or a vector space $V$ with its standard affine structure. However, none of this needs to be revealed when introducing the example for the first time. The details of a general case for an affine space can be found e.g. in M. Berger Geometry I page 70.
