On a road trip, your distance from the starting point (in miles) after
t hours of actual driving is
d(t)=60t. Because of traffic and stops, the actual time you spend driving (out of total elapsed time) is
h(n)=43n, where
n is the total elapsed time in hours. If the trip has taken 4 hours total, how far have you actually driven? Find
(d∘h)(4).
This shows how composition handles multi-stage processes: the total elapsed time goes into h first to find actual driving time, and that result goes into d to find distance. Without composition, you might mistakenly compute 60⋅4=240 miles, which ignores the stops.