## Story

The event will hold in three days.

Well-cooked and delicious: rice and beans

Fresh avocados

Options of fish, chicken, cabeza

**Son:** Dad, what about vegan?

**Dad:** Let's not worry about vegan. Those folks would really be hungry.

They need to eat well.

**Son:** Does it mean that those who are vegan do not eat well?

**Dad:** I did not say that. Do not force words into my mouth.

**Son:** I just asked a question, Dad.

What about al pastor?

**Dad:** No, we do not eat pork.

Why should we give people what we do not eat?

Okay, let's go and order these burritos.

**Dad:** Buenas tardes, señora

How are you doing today?

**Son:** Good afternoon, Mama Esther.

**Esther:** Good afternoon. I am doing well.

How are you doing too?

**Dad:** We are doing well.

Thank you.

How much are your burritos?

**Esther:** It's $\$7.00$ each.

Guacamole costs extra ¢$50$ each.

**Dad:** We want to place an order for $1000$ burritos.

**Son:** Well-cooked: rice and beans; fresh avocados...everything

No guacamole.

**Esther:** Okay...

**Dad:** $300$ pescado; $300$ cabeza; $400$ chicken

How much is the cost?

**Esther:** How soon do you need them?

**Dad:** In three days.

**Esther:** Would I deliver them, or would you pick them up?

**Dad:** We shall pick them up.

**Esther:** It's going to be $\$7$ each for the first $300$ burritos

$\$6$ each for the next $300$, and $\$5.00$ each for the remaining $400$.

Fair enough?

So, the price is ...

$\$2100$ for the first $300$ + $\$1800$ for the next $300$ + $\$2000$ for
the remaining $400$

Total of $5900$

Add $10\%$ tax of $5900$

That gives $\$590$

Total cost of $\$6490.00$

**Son:** Dad, I could calculate the cost another way.

**Dad:** What way?

Is it better than the way Esther did?

**Son:** For many orders, yes!

And for writing a computer program to calculate it.

**Dad:** Interesting. What is it?

**Son:** We learned it in school.

Mama Esther did it as a simple Arithmetic.

Mr. C called it the Manual method.

Then, he taught us to do it algebraically ...

using the Piecewise Function method.

I think it is much better.

**Dad:** Okay, what's the method?

**Son:** We begin by defining the variables involved.

Let $b$ = buritto

and $c$ = cost

Which variable depends on the other variable?

**Son:** Does the buritto depend on the cost, or

does the cost depend on the number of burritos?

**Dad:** The cost depends on the number of burritos.

**Son:** That is correct.

We write it this way: $c = f(b)$

It can also be written as: $c(b)$

**Dad:** Okay...

**Son:** So, $c(b)$ =

$$ c(b) = \begin{cases} 7b; & \quad 1 \leq b \leq 300 \\[3ex] 6b + 300; & \quad 300 \lt b \leq 600 \\[3ex] 5b + 900; & \quad 600 \lt b \leq 1000 \end{cases} $$

**Dad:** How is this better than the way Esther did it?

**Son:** Say you wanted to order $900$ burritos

How much would it cost excluding the taxes?

**Dad:** $\$7$ for the first $300$ gives $\$2100$

$\$6$ for the next $300$ gives $\$1800$

$\$5$ for the remaining $300$ gives $\$1500$

That gives a total of $\$5400$

**Son:** How many steps did you do before you got the answer?

**Dad:** Three steps...

**Son:** I shall do only two steps before I get that answer.

$c(900) = 5(900) + 900 = 4500 + 900 = 5400$

**Dad:** You used the $3rd$ equation because $900$ falls in ...

**Son:** that piece...yes...in that domain.

**Dad:** That is interesting! How did you get those equations?

**Son:** Welcome to Piecewise Functions!, Dad.