Elizabeth visits her friend Andrew and then returns home by the same route. She always walks 2km/h when going uphill, 6km/h when going downhill and 3km/h when on level ground. If her total walking time is 6 hours, what is the total distance she walks in km?

this is wrong af

Let's represent the uphill distance as "x" kilometers, the downhill distance as "y" kilometers, and the distance on level ground as "z" kilometers.

Since Elizabeth walks at a speed of 2km/h uphill, the total time spent walking uphill is x / 2 hours.
Similarly, the total time spent walking downhill is y / 6 hours, and the time spent on level ground is z / 3 hours.

According to the problem, the total walking time is 6 hours, so we can write the equation x / 2 + y / 6 + z / 3 = 6.

Multiplying every term in the equation by 6 to eliminate any fractions gives us:
3x + y + 2z = 36 (Equation 1)

We also know that the total distance Elizabeth walks is equal to the sum of the uphill, downhill, and level ground distances. Therefore, the total distance is x + y + z.

Substituting the value of z from Equation 1 into the distance equation gives us:
x + y + (36 - 3x - 2z) = x + y + 36 - 3x - 2z = 36 - 2x - 2z (Equation 2)

Now, we need to simplify Equation 2 based on the information given in the problem.

Since Elizabeth walks uphill at a speed of 2km/h, the uphill distance (x) can be expressed as a function of time: x = (2km/h) * (x / 2 hours), which simplifies to x = x km.

Similarly, the downhill distance (y) and the distance on level ground (z) can be expressed as functions of time: y = (6km/h) * (y / 6 hours) = y km and z = (3km/h) * (z / 3 hours) = z km.

Substituting these expressions into Equation 2 gives us:
36 - 2x - 2z = 36 - 2x - 2z km.

Since the total distance walked is the sum of (x + y + z) km and we have x, y, and z km on both sides of the equation, we can rewrite Equation 2 as:
36 - 2x - 2z = x + y + z.

Rearranging the terms gives us:
3x + 2z + y = 36 (Equation 3)

Equations 1 and 3 are equivalent, so we can simplify the system of equations as:
3x + y + 2z = 36
3x + 2z + y = 36

We can solve this system of equations using several methods, such as substitution or elimination. By solving this system, we can find the values of x, y, and z, which represent the distances walked uphill, downhill, and on level ground, respectively.

However, the problem only asks for the total distance walked, which is the sum of x, y, and z. Therefore, we don't need to solve the equations. The answer is x + y + z = 36 km.

To find the total distance Elizabeth walks, we need to determine the time she spends walking uphill, downhill, and on level ground.

Let's assume she spends x hours walking uphill, y hours walking downhill, and z hours on level ground.

The distance she walks uphill is calculated by multiplying her speed (2km/h) by the time spent walking uphill: 2x km.
Similarly, the distance she walks downhill is calculated by multiplying her speed (6km/h) by the time spent walking downhill: 6y km.
And the distance she walks on level ground is calculated by multiplying her speed (3km/h) by the time spent walking on level ground: 3z km.

Since she visits her friend and returns home by the same route, the time spent walking uphill is equal to the time spent walking downhill. So, x = y.

We also know that her total walking time is 6 hours, so the equation x + y + z = 6 represents her total walking time.

Now we can find the distances she walks uphill, downhill, and on level ground by substituting x = y into the distance formulas:

Distance uphill = 2x km = 2y km
Distance downhill = 6y km
Distance on level ground = 3z km

To find the total distance she walks, we need to sum up the distances:

Total distance = Distance uphill + Distance downhill + Distance on level ground
Total distance = 2y km + 6y km + 3z km
Total distance = 8y km + 3z km

Now let's consider her total walking time equation: x + y + z = 6.

Since x = y, we can rewrite the equation as:
x + x + z = 6
2x + z = 6

Knowing this, we can substitute 2x + z in the expression for the total distance:

Total distance = 8y km + 3z km
Total distance = 8(y + x) km
Total distance = 8(6 - z) km [from the equation 2x + z = 6]

Now we need to find the maximum value for the total distance she walks. Since the total distance is the product of y and (6 - z), we can maximize it by maximizing y and (6 - z).

The maximum value for y is 3, which corresponds to the time spent walking downhill.
The maximum value for (6 - z) is 6, which corresponds to the time spent on level ground.

Then, the maximum total distance she walks is:

Total distance = 8(3) km + 3(6) km
Total distance = 24 km + 18 km
Total distance = 42 km

Therefore, Elizabeth walks a total distance of 42 km.

if the distance is a hilly km and b flat km, then

a/2 + b/3 + b/3 + a/6 = 6
4a + 4b = 36
a + b = 9

so, she walks 18 km