taxi fare in the city is as follows:-
for the first kilometer the fear is replaced 20 and for the sequenta distance it is rupees 10 kilometer taking distance cover as x kilometer and the total fair as rupees 1. Write a linear EQUATION for this information and draw it's graph. Using graph find the fair for:-
10km
12km
Answers & Comments
Answer:
Let's denote the total fare as \( y \) and the distance covered as \( x \).
The given information can be represented by the following linear equation:
\[ y = 20 + 10(x-1) \]
Here's the breakdown of the equation:
- The initial fare for the first kilometer is \( 20 \) rupees.
- For the subsequent distance (\( x - 1 \) kilometers, as the first kilometer is already considered in the initial fare), the fare is \( 10 \) rupees per kilometer.
Now, let's plot this equation on a graph to visualize it.
```python
import matplotlib.pyplot as plt
import numpy as np
# Define the linear equation
def taxi_fare(x):
return 20 + 10 * (x - 1)
# Generate x values
x_values = np.arange(1, 15, 1)
# Calculate corresponding y values
y_values = taxi_fare(x_values)
# Plot the graph
plt.plot(x_values, y_values, label='Taxi Fare')
plt.scatter([10, 12], [taxi_fare(10), taxi_fare(12)], color='red') # Mark points for 10km and 12km
# Labeling the axes
plt.xlabel('Distance (km)')
plt.ylabel('Fare (rupees)')
# Title of the graph
plt.title('Taxi Fare Calculation')
# Show grid
plt.grid(True)
# Show the graph
plt.legend()
plt.show()
```
In this graph:
- The x-axis represents the distance in kilometers.
- The y-axis represents the total fare in rupees.
The red points on the graph correspond to the fare for 10km and 12km, respectively. You can read the fare values from the y-axis for these points.