Sub topic 11
When the context limits the domain
What this chapter assumes
You should already be comfortable with function notation, evaluating f(x), interval and set notation, and finding the domain of an equation by excluding division by zero and negative numbers under even roots. This chapter adds one more source of restriction: the situation the function describes.
Two kinds of domain
A formula such as A(r) = πr² accepts every real number if you look at the algebra alone. No division, no root, so nothing is excluded. The implied domain (also called the natural domain) is the set of all inputs for which the formula produces a real number.
Now suppose A(r) gives the area of a circular garden with radius r meters. A radius of −2 meters has no physical meaning, and neither does a radius of 0 if the garden must exist. The contextual domain is the set of inputs that make sense in the situation. It is usually a subset of the implied domain.
The rule to remember:
- The domain you report is the implied domain intersected with any restrictions from the context.
- If the problem states a domain, use the stated one. A stated domain overrides the natural one.
- If the problem describes a situation and states no domain, you must decide what the context allows, and you should say so in words.
Common sources of contextual restriction
| Situation | Typical restriction | Why |
|---|---|---|
| Length, area, mass, price | Input ≥ 0 (sometimes > 0) | Physical quantities cannot be negative |
| Time since an event | t ≥ 0 | The model starts at t = 0 |
| Counting objects (tickets, people) | Whole numbers 0, 1, 2, … | You cannot sell 2.5 tickets |
| Fixed capacity or budget | Upper bound | A 40-seat bus holds at most 40 people |
| Limited time span | Closed interval | A model valid only for the first 10 hours |
| Denominator from the context | Exclude zero | Rate = distance ÷ time needs time ≠ 0 |
Two ideas are worth separating here.
- Bounds. The input must lie between two numbers, which gives an interval.
- Discreteness. The input must be a whole number (or a multiple of some step), which gives a list or a set of integers, not an interval.
Worked example 1: a continuous domain
A rectangular pen is built with 40 meters of fence. If one side has length w, the other side has length 20 − w, so the area is
A(w) = w(20 − w).
Step 1: implied domain. The formula is a polynomial, so every real number is allowed: (−∞, ∞).
Step 2: context. The side length w is a length. It must be positive for a pen to exist. The other side, 20 − w, must also be positive, so w < 20.
Step 3: combine. We need w > 0 and w < 20.
- Interval notation: (0, 20)
- Set notation: {w | 0 < w < 20}
The endpoints are excluded because w = 0 or w = 20 gives a pen with zero area, which is a degenerate rectangle. Whether to include such endpoints is a modeling choice. If your course treats a "pen" of zero width as acceptable, [0, 20] is defensible. State your choice and the reason.
Range, using the context. A(w) = 20w − w² is a downward-opening parabola with vertex at w = 10, where A(10) = 100. On (0, 20) the area takes every value greater than 0 up to and including 100. So the range is (0, 100].
The code below checks this numerically.
def area(w):
if not (0 < w < 20):
raise ValueError("w is outside the contextual domain (0, 20)")
return w * (20 - w)
samples = [0.5, 5, 10, 15, 19.5]
for w in samples:
print(w, area(w))
print(max(area(w / 10) for w in range(1, 200))) # 100.0The loop tries w = 0.1, 0.2, …, 19.9 and the maximum is 100.0, reached at w = 10.
Worked example 2: a discrete domain
A theater charges $12 per ticket. The revenue function is R(n) = 12n, where n is the number of tickets sold. The theater has 150 seats.
- Implied domain: all real numbers.
- Context: n counts tickets, so n is a whole number, and n ≤ 150.
- Contextual domain: {0, 1, 2, …, 150}.
You cannot write this as the interval [0, 150], because that interval includes 2.5, 74.9, and other values that are not ticket counts. The range is also discrete: {0, 12, 24, …, 1800}. That is the set of multiples of 12 from 0 to 1800.
def revenue(n):
if not isinstance(n, int) or n < 0 or n > 150:
raise ValueError("n must be an integer from 0 to 150")
return 12 * n
domain = list(range(0, 151))
outputs = [revenue(n) for n in domain]
print(len(domain)) # 151
print(min(outputs), max(outputs)) # 0 1800Note the count: there are 151 values in the domain, not 150, because 0 is included.
A graph of this function is a set of separate dots, not a line. Connecting the dots would suggest that fractional tickets exist.
Worked example 3: context and algebra together
A taxi company models the average cost per kilometer of a trip as
C(d) = (3 + 1.5d) / d,
where d is the trip distance in kilometers and the cost is in dollars. The company only serves trips of at most 30 km.
- Algebra. The denominator d cannot be 0, so the implied domain is d ≠ 0.
- Context. Distance is not negative, so d > 0. The service limit gives d ≤ 30.
- Combine. The contextual domain is (0, 30].
Here the algebraic restriction (d ≠ 0) is already covered by the context (d > 0). When this happens, you do not list both. The sharper condition d > 0 includes the other.
For the range, rewrite C(d) = 3/d + 1.5. As d grows, 3/d shrinks, so C decreases. At d = 30, C = 0.1 + 1.5 = 1.6. As d approaches 0, 3/d becomes large without bound. So the range is [1.6, ∞).
def cost_per_km(d):
if not (0 < d <= 30):
raise ValueError("d must be in (0, 30]")
return (3 + 1.5 * d) / d
print(cost_per_km(30)) # 1.6
print(cost_per_km(1)) # 4.5
print(cost_per_km(0.01)) # 301.5Edge cases and common errors
- Reporting the implied domain for a word problem. Writing (−∞, ∞) for the pen example ignores the situation. Always ask what the input represents.
- Using an interval for countable things. If the input is a count, write a set of integers. An interval claims every real number between the ends is allowed.
- Wrong endpoint type. Decide whether the boundary case makes sense. Zero items sold is usually fine. A rectangle with zero width usually is not. Use a square bracket only when the endpoint is a valid input.
- Confusing domain and range. The 150-seat limit restricts the input n. The 1800 maximum revenue is a consequence, so it belongs to the range.
- Restricting the range directly. Context restricts the inputs. The range is then computed from those inputs. Do not choose a range first and work backward.
- Forgetting that restriction changes the range. Without a context, A(w) = w(20 − w) has range (−∞, 100]. With the pen context, the range is (0, 100]. A smaller domain can give a smaller range.
- Using sensible-sounding but unstated limits. A person's age could be limited to 0 through 120, but if the problem gives no bound, say what assumption you made, or leave the upper end open when the context does not force a limit.
Writing the answer
A complete answer to a contextual-domain question has three parts:
- The domain in interval or set notation.
- A short reason tied to the situation, such as "the width of a pen must be positive and less than 20 meters."
- Any assumption you made, such as whether a boundary value counts.
For example: "The domain is {n | n is an integer, 0 ≤ n ≤ 150}, because n counts tickets and the theater has 150 seats."
Summary
The formula gives the implied domain. The situation may shrink it by imposing bounds, by requiring whole numbers, or both. Report the combined set, using an interval for continuous quantities and a set of integers for counted ones. Then compute the range from that restricted domain, not from the implied one.
Exercise
A water tank holds 500 liters. Water is added at 20 liters per minute, starting from an empty tank, so the volume is V(t) = 20t, where t is the time in minutes. The model is used only until the tank is full. (a) Find the contextual domain of V in interval notation. (b) Find the range. (c) How would the domain change if the tank started with 100 liters and V(t) = 100 + 20t?
Show answer
(a) The tank is full when 20t = 500, so t = 25. Time starts at 0, so the domain is [0, 25]. Both endpoints are valid inputs: t = 0 is the empty tank, and t = 25 is the full tank. (b) V(0) = 0 and V(25) = 500, and V increases steadily, so the range is [0, 500]. (c) The tank is full when 100 + 20t = 500, so t = 20. The domain becomes [0, 20], and the range becomes [100, 500].
Exercise
A bakery sells muffins in boxes of 6. The cost of an order is C(b) = 9b dollars, where b is the number of boxes. The bakery can make at most 40 boxes per day. Write the domain and the range, and explain why [0, 40] is not an acceptable domain.
Show answer
Domain: {0, 1, 2, …, 40}, the whole numbers from 0 to 40, since b counts boxes. Range: {0, 9, 18, …, 360}, the multiples of 9 from 0 to 360. The interval [0, 40] is not acceptable because it contains non-integer values such as 2.5, and you cannot sell 2.5 boxes. The interval would also make the range the whole interval [0, 360] instead of a list of separate values.
Exercise
A ball is thrown upward from the ground and its height in meters is h(t) = 20t − 5t², where t is the time in seconds. The ball is in the air from the moment it is thrown until it lands. Find the contextual domain and the range.
Show answer
The ball lands when h(t) = 0: 20t − 5t² = 5t(4 − t) = 0, so t = 0 or t = 4. The domain is [0, 4]. The vertex of the parabola is at t = 2, where h(2) = 40 − 20 = 20. At both endpoints h = 0, so the range is [0, 20].