A union of $d$ hyperplanes has multiplicty at most $d$ at every point, and a hyperplane in $\mathbf P^n$ can be made to pass through at most $n$ general points. So the conditions

- $m_i \leq d$ for each $i$
- $\sum_{i=1}^k m_i \leq dn$

are obviously necessary.

I claim they are also sufficient. (I think this is obvious, but in attempting to convince myself it is obvious, it became less obvious to me, so here is an argument.)

This is easy to see by induction on $d$.

For $d=1$ the conditions say there can be at most $n$ points, each with multiplicty 1. So take $Y$ to be a hyperplane through them.

Now assume the claim for $d-1$, and let $(m_1,\ldots,m_k)$ satisfy the above conditions. We can assume that $k> n$, since otherwise all the $p_i$ lie on a *single* hyperplane, and we can just take $d$ copies of that. Also we can reorder the points so that $m_1 \geq m_2 \geq \cdots \geq m_k$. Note that for $i \geq n+1$ we must have $m_i \leq d-1$, by the second condition.

By induction, there is a union $Y'$ of $d-1$ hyperplanes with multiplicity $\geq m_i-1$ at $p_i$ for $i \leq n$ and multiplicity $\geq m_i$ at $p_i$ for $i \geq n+1$.

Now let $H$ be a hyperplane through $p_1,\ldots,p_n$. Then $Y=Y' \cup H$ is a union of $d$ hyperplanes with multiplicity $\geq m_i$ at $p_i$ for $i=1,\ldots, k$.