A classic problem in quantum mechanics is a one-dimensional well with infinite walls. Such a system can be used to describe the behavior of electrons in a very thin metal film.
Consider the following potential:
\[U(x) = \begin{cases}
+\infty, \quad &x<0 \text{ or } x > a \\
0, \quad & 0 < x < a
\end{cases},\]
where $a$ is the width of the well.
For such a system, the probability of finding a particle outside the boundaries of the well is zero, and therefore $\Psi(0) = \Psi(a) = 0$.
Let's imagine that there are $N$ electrons in the well that dont interact with each other (for example the elecrtostatic interaction is screened in the metal). Remember that electrons are fermions and that's why they cannot be in the same state.
Fermions cannot be in the same state and that's why part of elecrtons <