Block:
1.
a. I walk at a rate of 2 miles per hour. Write a function which uses time as its
input, and how far I've walked as its output.
b. I burn 110 calories per 1 mile that I walk. Write a function (pro-tip: a linear
function) which
uses
miles
as its input
and calories burned as its output.
c. Using the two function definitions you just wrote, write a composite function
which
uses
time
as its input, and
calories burned as its output. Simplify it as
much as you can.
d. Use this function you just wrote to find how many calories I burn in 3 hours of
walking.



Answer :

Great! Let's solve each part of the question step by step.

1.

a. Given that you walk at a rate of 2 miles per hour, let's define a function that calculates the distance walked based on the time.

Input: Time (hours)
Output: Distance walked (miles)

The distance walked can be calculated using the formula:
[tex]\[ \text{distance} = \text{rate} \times \text{time} \][/tex]

So, if the rate is 2 miles per hour:
[tex]\[ \text{distance} = 2 \times \text{time} \][/tex]

Let's define this function [tex]\( D(t) \)[/tex]:

[tex]\[ D(t) = 2t \][/tex]

where [tex]\( t \)[/tex] is the time in hours.

b. Given that you burn 110 calories per mile, let's define a function that calculates the calories burned based on the distance walked.

Input: Distance (miles)
Output: Calories burned

The calories burned can be calculated using the formula:
[tex]\[ \text{calories} = \text{calories\_per\_mile} \times \text{distance} \][/tex]

So, if 110 calories are burnt per mile:
[tex]\[ \text{calories} = 110 \times \text{distance} \][/tex]

Let's define this function [tex]\( C(d) \)[/tex]:

[tex]\[ C(d) = 110d \][/tex]

where [tex]\( d \)[/tex] is the distance in miles.

c. Now, let’s create a composite function that calculates the calories burned based on the time walked.

We already have:
[tex]\[ D(t) = 2t \][/tex]
[tex]\[ C(d) = 110d \][/tex]

The composite function [tex]\( C(D(t)) \)[/tex] means we first calculate the distance walked using time [tex]\( t \)[/tex], and then we use that distance to calculate the calories burned.

[tex]\[ C(D(t)) = 110 \times (2t) \][/tex]

Simplifying, we get:
[tex]\[ C(D(t)) = 220t \][/tex]

So the composite function [tex]\( C_D(t) \)[/tex] that gives calories burned given time walked is:
[tex]\[ C_D(t) = 220t \][/tex]

d. Using the composite function [tex]\( C_D(t) \)[/tex], we can find out how many calories are burned in 3 hours of walking.

[tex]\[ t = 3 \][/tex]
[tex]\[ C_D(3) = 220 \times 3 \][/tex]
[tex]\[ C_D(3) = 660 \][/tex]

Answer: In 3 hours of walking, you burn 660 calories.