In quantum mechanics, light (or any other quantum particle) does not "choose" to be a wave or a particle in the conventional sense. Instead, the behavior of light is described by wave-particle duality, which means that it can exhibit both wave-like and particle-like characteristics depending on the experimental setup or observation.
The wave-particle duality arises from the mathematical formalism of quantum mechanics, which uses wavefunctions to describe the probabilistic behavior of particles. The wavefunction represents the quantum state of a particle and contains information about its potential position, momentum, and other observable properties.
When an observation or measurement is made on a quantum system, the wavefunction "collapses" into a particular state corresponding to the measured property. This collapse leads to the observation of the particle-like behavior, where the particle is localized at a specific position with definite properties.
On the other hand, when a quantum system is not subjected to a measurement or observation, its behavior is described by the wave-like nature of its wavefunction. This wavefunction can exhibit interference, diffraction, and other wave-like phenomena.
The choice of whether light (or any other quantum particle) behaves as a wave or a particle is not up to the particle itself. It is determined by the experimental conditions, the nature of the measurement being performed, and the interactions involved. The behavior of quantum particles is inherently probabilistic, and the wave-particle duality captures this probabilistic nature of quantum mechanics.
So, it's important to note that light does not "choose" its behavior. Instead, its behavior is determined by the mathematical framework of quantum mechanics and the specific experimental setup or observation being conducted.