When an electron in a hydrogen atom transitions from a higher energy level to a lower energy level, it emits a photon. The wavelength of the emitted photon determines which region of the electromagnetic spectrum the transition occurs in.
In the case of the ultraviolet region, the transition that occurs is from the second energy level (n=2) to the first energy level (n=1), which corresponds to the emission of ultraviolet light.
Thus, the transition is \( 2 \rightarrow 1 \).
Therefore, the correct answer is \( \boxed{2 \rightarrow 1} \).