A museum charges k5 per person for a guide tour with a group of 1 to 9 people or a fixed k50 fee for a group of 10 or more people. Write a function relating the number of people, n to the cost, c.

1 answer

You can define the function relating the number of people \( n \) to the cost \( c \) based on the pricing structure provided. Here's the breakdown:

  1. If \( n \) (the number of people) is between 1 and 9 (inclusive), the cost is calculated as: \[ c(n) = 5n \]

  2. If \( n \) is 10 or more, the cost is a fixed rate of: \[ c(n) = 50 \]

Using this information, you can define the function \( c(n) \) mathematically as:

\[ c(n) = \begin{cases} 5n & \text{if } 1 \leq n \leq 9 \ 50 & \text{if } n \geq 10 \ 0 & \text{if } n < 1 \quad \text{(assuming no cost for 0 people)} \end{cases} \]

In a programming context, the function can be implemented in Python, for example, as follows:

def calculate_cost(n):
    if n < 1:
        return 0  # Assuming no cost for 0 people
    elif 1 <= n <= 9:
        return 5 * n
    else:  # n >= 10
        return 50

# Example usage:
number_of_people = 7
cost = calculate_cost(number_of_people)
print(f"The cost for {number_of_people} people is: {cost}")

This function will calculate the cost based on the number of people in the group according to the pricing structure described.