# Modeling with tables, equations, and graphs

See how relationships between two variables like number of toppings and cost of pizza can be represented using a table, equation, or a graph.
Math is all about relationships. For example, how can we describe the relationship between a person's height and weight? Or how can we describe the relationship between how much money you make and how many hours you work?
The three main ways to represent a relationship in math are using a table, a graph, or an equation. In this article, we'll represent the same relationship with a table, graph, and equation to see how this works.
Example relationship: A pizza company sells a small pizza for $\6$ . Each topping costs $\2$.

## Representing with a table

We know that the cost of a pizza with $0$ toppings is $\6$, the cost of a pizza with $1$ topping is $\2$ more which is $\8$, and so on. Here's a table showing this:
Toppings on the pizza $(x)$Total cost $(y)$
$0$$\6$
$1$$\8$
$2$$\10$
$3$$\12$
$4$$\14$
Of course, this table just shows the total cost for a few of the possible number of toppings. For example, there's no reason we couldn't have $7$ toppings on the pizza. (Other than that it'd be gross!)
Let's see how this table makes sense for a small pizza with $4$ toppings.
Here's the cost of just the pizza:
$\\greenD6$
Here's the cost of the $\blueD4$ toppings:
$\blueD4$ toppings $\cdot$ $\2$ per topping $=$ $\\goldD8$
This leads to the total cost of
$\\greenD6 + \\goldD8 = \14$.
How much would a small pizza with $5$ toppings cost?
$\$

Let's extend the table one more row:
Toppings on the pizza $(x)$Total cost $(y)$
$0$$\6$
$1$$\8$
$2$$\10$
$3$$\12$
$4$$\14$
$5$$\16$
A small pizza with $5$ toppings costs $\16$.

## Representing with an equation

Let's write an equation for the total cost $y$ of a pizza with $x$ toppings.
Here's the cost of just the pizza:
$\\greenD6$
Here's the cost of $x$ toppings:
$x$ toppings $\cdot$ $\2$ per topping $=$ $x \cdot 2 = \goldD{2x}$
So here's the equation for the total cost $y$ of a small pizza:
$y = \greenD6 + \goldD{2x}$
Let's see how this makes sense for a small pizza with $3$ toppings:
$x = \blueD3$ because there are $\blueD3$ toppings
The total cost is $6 + 2(\blueD3) = 6 + 6 = \12$
Use the equation to find the cost of a small pizza with $100$ toppings.
$\$

$x = \blueD{100}$ because there are $\blueD{100}$ toppings
The total cost is $6 + 2(\blueD{100}) = 6 + 200 = \206$

## Representing with a graph

We can create ordered pairs from the $x$ and $y$ values:
Toppings on the pizza $(x)$Total cost $(y)$Ordered pair $(x , y)$
$0$$\6$$(0, 6)$
$1$$\8$$(1, 8)$
$2$$\10$$(2, 10)$
$3$$\12$$(3, 12)$
$4$$\14$$(4, 14)$
We can use these ordered pairs to create a graph:

Cool! Notice how the graph helps us easily see that the total cost of the small pizza increases as we add more toppings.

## We did it!

We represented the situation where a pizza company sells a small pizza for $\6$, and each topping costs $\2$ using a table, an equation, and a graph.
What's really cool is we used these three methods to represent the same relationship. The table allowed us to see exactly how much a pizza with different number of toppings costs, the equation gave us a way to find the cost of a pizza with any number of toppings, and the graph helped us visually see the relationship.
Now let's give you a chance to create a table, an equation, and a graph to represent a relationship.

## Give it a try!

An ice cream shop sells $2$ scoops of ice cream for $\3$. Each additional scoop costs $\1$.
Complete the table to represent the relationship.
Scoops of ice cream $(x)$Total cost $(y)$
$2$$\3$
$3$$$4$$
$5$$$6$$

Remember that each addition scoop adds $\1$ to the total cost:
Scoops of ice cream $(x)$Total cost $(y)$
$2$$\3$
$3$$\4$
$4$$\5$
$5$$\6$
$6$$\7$
Write an equation to represent the relationship.
Remember to use $x$ for scoops of ice cream and $y$ for total cost.

This equation is tricky!
We know that the cost of each addition scoop after $2$ scoops is $\\blueD 1$. So, the equation has to include
$\blueD1 \cdot x$.
In order for the equation to be true for the values $x =2$ and $y=3$ for example, we need to add $\greenD 1$. So, here's the equation:
$y = \blueD1 \cdot x + \greenD1$
We can also write it like this:
$y = x + \greenD 1$
Plot the points from the table on the graph to represent the relationship.
Be sure to plot the exact points in the table above!

Here are the ordered pairs from the $x$ and $y$ values:
Scoops of ice cream $(x)$Total cost $(y)$Ordered pair $(x , y)$
$2$$\3$$(2, 3)$
$3$$\4$$(3, 4)$
$4$$\5$$(4, 5)$
$5$$\6$$(5, 6)$
$6$$\7$$(6, 7)$
Here is the graph:


## Comparing the three different ways

We learned that the three main ways to represent a relationship is with a table, an equation, or a graph.
What do you think are the advantages and disadvantages of each representation?
For example, why might someone use a graph instead of a table? Why might someone use an equation instead of a graph?
Feel free to discuss in the comments below!