During my graduate work, I have come across a problem that I do not know how to solve. I would like to know how probable it is for a DNA strand of length N to have two regions of length M that are complementary.
For example, how likely it is that a DNA strand of 100 nucleotides contains two regions of 5 bases that could form intramolecular base-pairs. Additionally, how long does a DNA strand need to certainly ( probability close to 1) contain two such complementary 5 base regions?
I believe this could be solved with combinatorics, but my math is very rusty and I can't seem to find a solution online. I would be extremely grateful if you could assist me with this problem, in any possible way.