Statistical mechanics of coil-hairpin transition in a single-stranded DNA oligomer