A painter leans a ladder against a vertical wall. The top of the ladder is 7 meters above the ground. When the bottom of the ladder is moved 1 meter farther away from the wall, the top of the ladder is 5 meters above the ground. What is the length of the ladder? Round to the nearest thousandth.

To find the length of the ladder, we can use the Pythagorean theorem, which states that in a right triangle, the square of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the other two sides.

In this case, the ladder forms the hypotenuse of the right triangle, with the wall forming one side and the ground forming the other side. Let's call the distance between the wall and the base of the ladder x.

Using the given information, we have two right triangles:

1. Original position:
- Wall side: x
- Ground side: 7 meters
- Hypotenuse (ladder length): unknown (let's call it L1)

2. Moved position:
- Wall side: x + 1 (since the bottom of the ladder was moved 1 meter farther away from the wall)
- Ground side: 5 meters
- Hypotenuse (ladder length): unknown (let's call it L2)

According to the Pythagorean theorem, we have the following equations:

1. Original position:
x^2 + 7^2 = L1^2

2. Moved position:
(x + 1)^2 + 5^2 = L2^2

To solve this system of equations, we can use the method of substitution. Let's solve equation 1 for L1^2 and substitute it into equation 2:

L1^2 = x^2 + 7^2
(x + 1)^2 + 5^2 = L2^2

Now we have only one equation with one unknown:

(x + 1)^2 + 5^2 = x^2 + 7^2
x^2 + 2x + 1 + 25 = x^2 + 49
2x + 26 = 49
2x = 23
x = 23/2
x ≈ 11.5

Now that we have the value of x, we can substitute it back into equation 1 to find the length of the ladder (L1):

L1^2 = x^2 + 7^2
L1^2 = (11.5)^2 + 7^2
L1^2 ≈ 132.25 + 49
L1^2 ≈ 181.25
L1 ≈ √181.25
L1 ≈ 13.472 (rounded to the nearest thousandth)

Therefore, the length of the ladder is approximately 13.472 meters, rounded to the nearest thousandth.