Dimension of the vector space of homogeneous polynomials Let $k[X_0, X_1, \ldots, X_n]_d$, or briefly $k[X]_d$, be the $k$-vector space whose elements are the zero polynomial and homogeneous polynomials of degree $d\geq 1$. I found the following formula for the dimension
$$dim(k[X]_d)= \binom{n+d} {n}$$

but in my book there is no justification for this equality. Could someone explain me, possibly in an intuitive way, why that binomial coefficient is the dimension of that vector space?
Added later: Except the formula is correct, as shown in the comments below; I had mis-read it; when $d = 2$ and you have 3 variables, $n = 2$, since the variable indexing starts at zero. And 4-choose-2 is in fact six, as expected.

[what follows is incorrect]

A nice basis for that space consists of all monomials in the $n$ variables with total degree $d$. 

Wait...what about degree $d = 2$ and $n = 3$ variables. Listing the basis elements, I see
$$
x^2, y^2, z^2, xy, xz, yz, 
$$
which is only $6$ dimensions, but 5 choose 3 is 10. Seems as if there might be a mistake in your formula, or perhaps I'm not understanding how it's supposed to be applied. (See below for resolution of this apparent contradiction.)

I think (or thought) perhaps your formula is incorrect.
A degree 2, also known as quadratic, polynomial in the 1 variable  x  is of the form
                      a*x^2 + b*x^2 + c



for some numbers  a,b,c . The polynomial is determined by the 3 coefficients  a,b,c , and different choices of  (a,b,c)  result in different polynomials.
In linear algebraic terms, the space of degree 2 polynomials in 1 variable is of dimension 3 since it consists of all linear combinations of 3 linearly independent vectors  x2,x,  and  1 .
A degree 2 polynomial in 2 variables  x1,x2  is of the form
             $a*x_1^2 + b*x_2^2 + c*x_1*x_2 + d*x_1+ e*x_2 + f$            

for some numbers  a,b,c,d,e,f . Different choices of  (a,b,c,d,e,f)  result in different polynomials.
In linear algebraic terms, the space of degree 2 polynomials in 2 variables is of dimension 6 since it consists of all linear combinations of 6 linearly independent vectors x_1^2,x_2^2,x_1x_2,x_1,x_2, and 1.