Suppose A(n) denotes the number of strings that have 01 as substring
then first symbol in string of length n may be 0 or 1.
If it is 1 then number of strings possible now is due to first symbol being 1 becomes A(n-1).
If it is 0 then two cases may arise based on the second symbol in string.
case 1: if second symbol is 0 then number of strings possible now is due to first symbol being 0 and second also being 0 becomes A(n-2).
case 2 : If second symbol is 1 then desired substring has already occurs . so number of string possible due to this case is 2^(n-2)
so , required recurrence relation is
A(n) = A(n-1) + A(n-2) + 2^(n-2).