A chef needs 5lbs of butter for every batch of croissants they make.
Before the chef goes grocery shopping, they decide to construct a data table to help calculate the amount of butter they need to buy.
They record the data in the following table, with the variable b representing the amount of butter in pounds and the variable c representing the batches of croissants the chef can make.
Pounds of Butter

Batches of Croissants

0  0 
5  1 
10  2 
15  3 
20  4 
Assuming the chef uses exactly the same amount of butter for each batch, can we use this data table to figure out the amount of butter to make 8 batches?
Visually we can see that each batch of croissants needs 5 lbs of butter, so if we wanted to make 8 batches we would need 40 lbs of butter.
How much butter would we need for 800 batches? To solve this problem we can write a rule for the amount of butter we need for each batch of croissants.
Rules are tools which help us calculate future values once we have a pattern we can follow.
In the previous example, we need 5 lbs of butter for each 1 batch of croissants.
We can use this data to figure out a rule involving our two variables b and c.
Using a Rule 

Since each batch needs 5 lbs of butter, we can say that the amount of butter b we need is equal to 5 times the number of batches c.  b = 5c 
If we want to calculate the amount of butter for a certain number of batches, we can plug in the year number instead of the variable c. For instance, we can plug in 800 to find the amount of butter we need to make 800 batches of croissants. The chef would need 4000 lbs of butter to make 800 batches of croissants. 
b = 5(800) b = 4000 
Rules are very useful tools that help us calculate values in many different situations.
Let's break down the process for writing a rule in more detail.
Writing a Rule 

Depending on the situation, our rules will look slightly different. There are a few concepts we need to consider when writing a function. Rules will always have two variables. In this case, we use the letters b and c but you can change these to match the situation you are given. Sometimes, you will have to multiply one of your variables by a number like in the example we just saw. Other times, you will have to add a certain amount to one of your variables. 
b = 5c  
Let's take a look at the following word problem. Penny the cat is 3 years older than Beans the chicken. Write a rule that allows us to find Penny's age given Beans' age.
This is the second type of rule where we add some amount to one of our variables. 
p = b + 3 

Let's take a look at the following word problem. A movie theater earns $10 for every customer that attends a showing of a movie. Write an equation using the variables m for money, and c for customers to help the theater owner calculate his income based on the number of guests who watch a movie. 
m c 

Since the movie theater will earn $10 per customer, we can say that the money earned will be equal to the number of customers times 10. 
m = 10c 




The data table to the right relates the amount of customers c with the amount of money earned m. We can use our equation to calculate the income at any amount of customers present.
Or, we can be asked to calculate something much larger, like what would the income be if 5000 customers arrived?




Try to write the next equation by yourself before you read the explanation.
Practice: Writing a Rule 

Charlie is 5 inches taller than Bryce. Assuming the difference in their heights doesn't change, write a rule to give you Charlie's height if you know Bryce's.


Charlie is 5 inches taller than Bryce so we can say his height c is equal to Bryce's height b plus 5. 
c = b + 5 
Practice: Writing a Rule 

Margaret reads two books every week. Write an equation to represent the amount of books b Margaret reads each week w.  
The rate of change is two books for every week, so we will multiply the number of weeks by two to find the number of books. 
b = 2w 
We can also generate a table of values to help us write our rule. When we first record the number of books Margaret reads, zero weeks have passed. This means that Margaret has not had any time to read books! It makes sense then that the number of books she reads is equal to zero. We can plug in some values for the number of weeks in order to identify the amount of books read. If we plug in a zero for w it becomes apparent that we have read zero books b. 

As you have seen in the previous examples, our rules tend to look slightly different in each situation presented.
Now that you have seen how to write rules from word problems, we can begin to learn to write them from data tables.
Writing a Rule Given a Table 

A police officer is trying to calculate the number of donuts he needs to bring to the office. He knows that every police officer eats around three donuts.  
The officer quickly puts together this data table where p represents the number of police officers, and d represents the number of donuts. The chief of police asks the officer to create an equation that can be used countywide to find the amount of donuts needed for all police officers. 

Tables can be used to figure out how to write a rule. Since each officer eats 3 donuts, we can find the total number of donuts required by multiplying the number of officers by 3. 

The number of donuts needed is equal to the number of police officers times three. 
d = 3p 
If we are given a rule, we can create a data table by plugging in a few values into the equation.
Creating a Data Table Given an Equation 

A librarian uses this equation to calculate the fee f to charge overdue books based on how many weeks w they are late. There is a $2 fee when a book is late and it increases by $1 each week after that point. 
f = 2 + 1w 
To construct a data table, plug in some values for the number of weeks something is late. You should always start with small, easy numbers such as 0, 1 and 2.

f = 2 + 1(0) = 2 f = 2 + 1(1) = 3 f = 2 + 1(2) = 4 
Finally, record these data values in a table. 

We sometimes also call rules equations or functions.