Optical and theoretical study of strand recognition by nucleic acid probes