Dimension of global sections Let $X$ be a hypersurface of degree $d$ in a projective space of dimension $n$. Is there a formula which expresses the dimension of the dimension of the space of global sections of the line bundle $O(k)$ on $X$?

If $n = 1$, then $X$ is a union of $d$ points, so $\mathcal O_{X}(k) = \mathcal O_X$, which has $d$ linearly-independent global sections.
If $n \geq 2$, then consider the short exact sequence,
$$ 0 \to \mathcal O_{\mathbb P^n} (-d) \to \mathcal O_{\mathbb P^n} \to \mathcal O_X \to 0.$$
Tensoring with $\mathcal O_{\mathbb P^n}(k)$, we get the short exact sequence,
$$ 0 \to \mathcal O_{\mathbb P^n} (k-d) \to \mathcal O_{\mathbb P^n}(k) \to \mathcal O_X (k)\to 0.$$
Now look at the long exact sequence:
$$ 0 \to H^0 (\mathcal O_{\mathbb P^n} (k-d)) \to H^0 (\mathcal O_{\mathbb P^n}(k)) \to H^0 (\mathcal O_X (k))\to 0 ,$$
(where I've used the fact that $H^1 (\mathcal O_{\mathbb P^n} (k-d))= 0$ when $n \geq 2$ to get the $0$ at the end).
Thus
$$ {\rm dim \ } H^0 (\mathcal O_X (k)) = {\rm dim \ } H^0 (\mathcal O_{\mathbb P^n}(k)) - {\rm dim \ } H^0 (\mathcal O_{\mathbb P^n}(k - d)),$$
so you can read off the dimension of $H^0 (\mathcal O_X (k))$ from the standard formula,
$${\rm dim \ } H^0 (\mathcal O_{\mathbb P^n } (r)) = \begin{cases} \binom{n + r}{n} & {\rm if \ } r \geq 0 \\ \ \ \ 0  &{\rm otherwise} \end{cases}.$$
