function(vehicletype) { var speed = 4; if (vehicletype === "bike") { speed *= randRange(1, 4); } else if (vehicletype === "horse") { speed *= randRange(1, 8); } else if (vehicletype === "train") { speed *= randRange(8, 20); } else { speed *= randRange(2, 16); } return speed; } REASONABLESPEED(vehicle(1)) REASONABLESPEED(vehicle(2)) SPEED1 < SPEED2 ? randRange(SPEED1 + 1, SPEED2 - 1) : randRange(SPEED2 + 1, SPEED1 - 1) randRange(1, 9) AVG * TIME (SPEED1 * SPEED2 * TIME - DIST * SPEED2) / (SPEED1 - SPEED2) DIST - DIST2 toFraction((DIST - SPEED2 * TIME) / (SPEED1 - SPEED2)) toFraction((DIST - SPEED1 * TIME) / (SPEED2 - SPEED1)) $._("distance") $._("speed") $._("time") $._("miles") $._("hour")

person(1) traveled by vehicle(1) at an average speed of SPEED1 miles per hour.

Then, he traveled by vehicle(2) at an average speed of SPEED2 miles per hour.

Then, she traveled by vehicle(2) at an average speed of SPEED2 miles per hour.

In total, he traveled DIST miles for TIME hour.In total, he traveled DIST miles for TIME hours.

In total, she traveled DIST miles for TIME hour.In total, she traveled DIST miles for TIME hours.

How many miles did person(1) travel by vehicle(1)? (Round to the nearest mile.)

round(DIST1) miles

So he traveled SPEED1 \times \frac{T1[0]}{T1[1]} T1[0] \approx round(DIST1) miles by vehicle(1).

So she traveled SPEED1 \times \frac{T1[0]}{T1[1]} T1[0] \approx round(DIST1) miles by vehicle(1).

How many miles did person(1) travel by vehicle(2)? (Round to the nearest mile.)

round(DIST2) miles

He traveled by vehicle(2) for TIME - \frac{T1[0]}{T1[1]} T1[0] = \frac{T2[0]}{T2[1]} hours.

She traveled by vehicle(2) for TIME - \frac{T1[0]}{T1[1]} T1[0] = \frac{T2[0]}{T2[1]} hours.

So he traveled SPEED2 \times \frac{T2[0]}{T2[1]} T2[0] \approx round(DIST2) miles by vehicle(2).

So she traveled SPEED2 \times \frac{T2[0]}{T2[1]} T2[0] \approx round(DIST2) miles by vehicle(2).

How many minutes did person(1) travel by vehicle(1)? (Round to the nearest minute.)

round(T1[0] / T1[1] * 60) minutes

\frac{T1[0]}{T1[1]} T1[0] \times \space 60 = round(T1[0] / T1[1] * 60) minutes.

How many minutes did person(1) travel by vehicle(2)? (Round to the nearest minute.)

round(T2[0] / T2[1] * 60) minutes

So he traveled by vehicle(2) for TIME - \frac{T1[0]}{T1[1]} T1[0] hours

So she traveled by vehicle(2) for TIME - \frac{T1[0]}{T1[1]} T1[0] hours

\frac{T2[0]}{T2[1]} \times 60 = round(T2[0] / T2[1] * 60) minutes.

Remember that \text{DISTANCE_TEXT} = \text{SPEED_TEXT} \times \text{TIME_TEXT}.

Call the time that person(1) traveled by vehicle(1), t.

Therefore the time person(1) traveled by vehicle(2) was TIME - t hours.

init({ range: [[0, 11], [-8, 5]], scale: [40, 5] // a unit square is now 20px wide by 30px high; omit for 40 x 40 }); style({ stroke: "black", strokeWidth: 2 }); path([[0.1, 0], [10.1, 0]]); path([[0.1, -1], [0.1, 1]]); path([[10.1, -1], [10.1, 1]]); style({ stroke: RED, arrows: "<->" }); path([[0.1, 2], [5.1, 2]]); style({ stroke: BLUE, arrows: "<->" }); path([[5.1, 2], [10.1, 2]]); label([ 2.6, 0.5 ], "t", "above", {color: RED}); label([ 7.6, 0.5 ], TIME + " - t", "above", {color: BLUE}); label([ 5.1, 0.5 ], TIME + "\\space \\text{" + $._("hours") + "}", "below");

person(1) traveled at SPEED1 \frac{ \text{MILES_TEXT} }{ \text{HOUR_TEXT} } for t hours by vehicle(1).

Therefore, he traveled SPEED1t miles by vehicle(1).
Therefore, she traveled SPEED1t miles by vehicle(1).

person(1) traveled at SPEED2 \frac{ \text{MILES_TEXT} }{ \text{HOUR_TEXT} } for TIME - t hours by vehicle(2).

Therefore, he traveled SPEED2 (TIME - t) miles by vehicle(2).
Therefore, she traveled SPEED2 (TIME - t) miles by vehicle(2).

The total distance person(1) traveled was SPEED1t + SPEED2(TIME - t) miles.

init({ range: [[0, 11], [-8, 5]], scale: [40, 5] // a unit square is now 20px wide by 30px high; omit for 40 x 40 }); style({ stroke: "black", strokeWidth: 2 }); path([[0.1, 0], [10.1, 0]]); path([[0.1, -1], [0.1, 1]]); path([[10.1, -1], [10.1, 1]]); style({ stroke: RED, arrows: "<->" }); path([[0.1, 2], [5.1, 2]]); style({ stroke: BLUE, arrows: "<->" }); path([[5.1, 2], [10.1, 2]]); label([ 2.6, 0.5 ], SPEED1 + "t", "above", {color: RED}); label([ 7.6, 0.5 ], SPEED2 + "(" + TIME + " - t)", "above", {color: BLUE}); label([ 5.1, 0.5 ], DIST + "\\space \\text{" + $._("miles") + "}", "below");

SPEED1t + SPEED2(TIME - t) = DIST

SPEED1t + SPEED2 * TIME - SPEED2t = DIST

SPEED1 - SPEED2t = DIST - SPEED2 * TIME

SPEED2 * TIME - DIST = SPEED2 - SPEED1t

Therefore, person(1) traveled by vehicle(1) for \frac{T1[0]}{T1[1]} T1[0] hours.