Question 1164938
```python
import matplotlib.pyplot as plt
import numpy as np

# Plot 1: Videoke Rental
# C(d) = 1000 for 0 < d <= 3
# C(d) = 1000 + 400(d-3) for d > 3
d1 = np.linspace(0, 3, 100)
c1_1 = np.full_like(d1, 1000)
d2 = np.linspace(3, 10, 100)
c1_2 = 1000 + 400 * (d2 - 3)

plt.figure(figsize=(10, 5))
plt.plot(d1, c1_1, label='0 < d <= 3', color='blue', linewidth=2)
plt.plot(d2, c1_2, label='d > 3', color='red', linewidth=2)
plt.title('Videoke Rental Cost')
plt.xlabel('Number of Days (d)')
plt.ylabel('Cost (₱)')
plt.grid(True)
plt.legend()
plt.savefig('videoke_rental_cost.png')
plt.close()

# Plot 2: Cave Guide Fee
# C(n) = 700 * ceil(n/4)
n = np.arange(1, 21)
c2 = 700 * np.ceil(n / 4)

plt.figure(figsize=(10, 5))
plt.step(n, c2, where='post', label='Cost per persons', color='green', linewidth=2)
plt.scatter(n, c2, color='green')
plt.title('Cave Guide Fee')
plt.xlabel('Number of Persons (n)')
plt.ylabel('Cost (₱)')
plt.grid(True)
plt.legend()
plt.savefig('guide_fee_cost.png')
plt.close()



```

Here are the piecewise functions and plots for the three scenarios described:

### 1. Videoke Machine Rental

The cost  depends on the number of days . The first three days have a flat rate of ₱1,000. From the fourth day onwards, an additional ₱400 is added for each day beyond the third.

**Piecewise Function:**


*Simplified for : *

### 2. Cave Guide Fee

Each guide costs ₱700 and can handle a maximum of 4 persons. This creates a step function where the cost increases every time a new group of 4 (or fraction thereof) starts.

**Function:**



*(where  is the ceiling function, representing the number of guides needed)*

**Piecewise Representation:**


### 3. Catering Service Food Cost

The total cost  is the product of the number of attendees  and the specific price per head for that bracket.

**Piecewise Function:**


---

### Visualizations

The graphs below represent the cost functions for the Videoke Rental and the Cave Guide Fee.

**Graph 1: Videoke Rental Cost**
The graph stays flat at ₱1,000 for the first 3 days and then increases linearly with a slope of 400.

**Graph 2: Cave Guide Fee**
The graph is a step function, jumping by ₱700 for every 4 additional people.

(The following images are generated based on these functions)

{ "images": [ "videoke_rental_cost.png", "guide_fee_cost.png" ] }