Wave-particle duality implies that an atom’s electrons consist of a set of discrete waves, so there are only so many orbits they can take. They never fall into the nucleus, and we can count the possible options (no peaks, one peak, two peaks, and so on).