To measure the dynamic resistance of a p-n junction diode, the diode should be forward-biased. This allows us to observe the small-signal resistance, which is defined as the change in voltage across the diode for a small change in current.
In option (2), the diode D2 is correctly forward-biased with a 5V supply, allowing for the measurement of dynamic resistance.
Hence, option (2) is the correct choice.