The first flip must be heads which takes her to floor 7.
The second flip must be heads, which takes her to floor 8.
Now for the 3rd flip she can flip either heads or tails going to either floor 9 or floor 7
At floor 7 for the 4th flip she must flip heads to get to floor 8
At floor 9 for the 4th flip she can flip either heads or tails going to either Floor 10 or Floor 8
For the 5th flip, as she is on either floor 8 or floor 10, she can flip either heads or tails
so we end up with the following valid flip sequences
\(\left( \begin{array}{ccccc} H & H & T & H & T \\ H & H & T & H & H \\ H & H & H & T & T \\ H & H & H & T & H \\ H & H & H & H & T \\ H & H & H & H & H \\ \end{array} \right)\)
You can see there are 6 of them.
The total number of flip possibilities is \(2^5 = 32\)
So \(p=\dfrac{6}{32}=\dfrac{3}{16}\)
.