The ladder needs to be only √(8²+2²)=√68=8.25m long to reach the roof of the house, so if the foot of the ladder must be 2m from the house, then the ladder will protrude 9-8.25=0.75m beyond the roof. That is a comfortable length to use the ladder to access the roof in safety.