Constant Rate of Change
COSma Coding
COSma Learning
Changing Quantities
Suppose is a variable. Recall that we generally think of as representing the varying value of some quantity. In math and science, we generally ask questions about how a value changes over some interval.
So, suppose varies from to . By how much did change by? Your gut might tell you that changed by 5 - which is correct! To represent that " changed by 5," we generally write . The triangle, , is actually the Greek letter "Delta", and we use this symbol to denote a "change".
Now, suppose that varies from to . By how much did change by? In this case, changed by 5, but in the negative direction! That is, decreased by 5! To represent this, we would write .
In general, the change in is the amount that the final value of exceeds the initial value of , which means that if varies from to then the change in is Let's write some code to do some computing for us! The code below shows a change()
function that takes an initial value and a final value as inputs, and then computes the change in value from the initial value to the final value.
function change(initial_value, final_value) {
return final_value - initial_value;
}
print( change(3, 8) );
print( change(2, -3) );
print( change(1.72, 1.834) );
In lines (1) - (3) above, we define a function change()
that computes a change from initial_value
to final_value
. Then, lines (5) - (7) use this function. Make sure this makes sense to you! Why does line (6) print a negative value?
Constant Rate of Change: Special Changes
Constant rate of change relationships are very important in math! They are a special type of relationship between two quantities where the change in one quantity's value is always same number of times as large as the change in the value of the other quantity.
For example, if and vary together at a constant rate of change of 2, it means that whenever changes by some amount, changes by exactly 2 times as much. So if increases by 1, will increase by . If increases by 0.5 then changes by . If changes by 0.001 then changes by . In general, if changes by then will change by This is a very useful property! If we know how much changes by, we know exactly how much will change by!
The code editor below...