Question 213415
This question is about similar triangles. A question regarding similar triangles has been on every SAT test ever written.
a)
The ladder is the hypotenuse of a right triangle formed by the ground and the building wall as the other 2 sides. There is also a smaller similar triangle formed by the fence, ladder and ground.
The smallest possible hypotenuse (ladder) occurs when the triangles are isosceles (45 degree angles). (1,1,sqrt(2) triangle).
So, the length of ground from where the ladder touches to the fence must be equal to the height of the fence, 2m.
The distance from the ground to the wall is 5m and where the ladder touches the wall is also 5m.
The shortest length of the ladder is 5sqrt(2)m. 
b)
If the ladder is 1 meter from the fence then the smaller triangle is a 1, 2, sqrt(5) triangle.
The distance to the wall is 4m. The ladder touches the wall at 8m high and the length of the ladder is 4sqrt(5)m.
.
Ed