1. Home
  2. Blog
  3. Rule of a step function

How to find the rule of a step function from its graph

To find the rule f(x)=a⌊b(x−h)⌋+k of a step function from its graph, read the closed dots for the sign of b, the length of a step for |b|, the jump between steps for |a|, and take any closed dot as (h,k). The sign of a comes last: it matches the sign of b when the staircase climbs and is the opposite when it falls, and evaluating your rule at the ends of one step checks the answer.

Read the graph in this order

Each feature of the picture fixes one parameter, and the order matters: b comes first, because the sign of a depends on it.

  1. Which end of each step is closed? Closed at the left end: b>0. Closed at the right end: b<0.
  2. How long is a step? Measure from one closed dot to the next. If that length is L, then |b|=1L
  3. How far apart are two neighbouring steps? That vertical distance is |a|.
  4. Does the staircase climb or fall from left to right? If it climbs, a has the same sign as b. If it falls, a has the opposite sign.
  5. Pick any closed dot and call it (h,k).
  6. Check. Evaluate your rule at the closed dot, at a point inside the same step, and at the step's open end, where the value must already belong to the next step.

Why a closed dot, and never an open one? Put x=h into the rule: the bracket becomes ⌊0⌋=0, so f(h)=k. The point (h,k) is on the graph, and since b(x−h) passes the integer 0 there, it sits at the end of a step. A point of the graph at the end of a step is exactly what a closed dot is. An open dot is not on the graph at all, so it can never be (h,k).

Example 1: a staircase that climbs

−6−4−20246810−3−2−1012345678xy (−2, 1)(2, 4)(2, 1)
Example 1. Four steps, each 4 units long and closed at its left end.
  1. Closed ends. Every step is closed at its left end, so b>0.
  2. Step length. The closed dots (−2,1) and (2,4) are 4 apart horizontally, so |b|=14 and b=14.
  3. Jump. From height 1 to height 4 is 3, so |a|=3.
  4. Sign of a. The staircase climbs and b is positive, so a=3.
  5. Closed dot. Take (−2,1): h=−2 and k=1. Mind the sign: x−h=x−(−2)=x+2, a plus inside the bracket.
  6. Rule. f(x)=3⌊14(x+2)⌋+1
  7. Check. f(−2)=3⌊0⌋+1=1, the closed dot. f(1.9)=3⌊0.975⌋+1=1, still the same step. f(2)=3⌊1⌋+1=4, so at x=2 the next step has begun and (2,1) is rightly an open dot. f(−6)=3⌊−1⌋+1=−2, the height of the bottom step.

The rule is not unique

Starting from the other labelled closed dot, (2,4), gives g(x)=3⌊14(x−2)⌋+4 which looks different but is the same function. For every x, 14(x+2) is exactly 1 more than 14(x−2), so its greatest integer is exactly 1 more too, and 3×1=3 is precisely the difference between the two values of k. Any closed dot gives a correct rule, so if your answer differs from someone else's, test both at a few points before deciding that one of them is wrong.

Example 2: a staircase that falls

−3−2−101234567891011−4−3−2−101234xy (1, 3)(4, 1)(1, 1)
Example 2. Four steps, each 3 units long and closed at its right end, falling from left to right.
  1. Closed ends. This time every step is closed at its right end, so b<0.
  2. Step length. The closed dots (1,3) and (4,1) are 3 apart horizontally, so |b|=13 and b=−13.
  3. Jump. From height 3 down to height 1 is 2, so |a|=2.
  4. Sign of a. The staircase falls, so a and b have opposite signs. Since b is negative, a=2, which is positive.
  5. Closed dot. Take (4,1): h=4 and k=1.
  6. Rule. f(x)=2⌊−13(x−4)⌋+1
  7. Check. f(4)=2⌊0⌋+1=1, the closed dot. f(1.3)=2⌊0.9⌋+1=1, still the same step. f(1)=2⌊1⌋+1=3, so x=1 belongs to the higher step: the dot (1,3) is closed and (1,1) is open, as drawn. f(4.3)=2⌊−0.1⌋+1=−1, so just past 4 the next step down has begun.

Starting from the closed dot (1,3) instead gives 2⌊−13(x−1)⌋+3, the same function again.

A falling staircase does not mean a negative a. Whether the steps climb or fall depends on a and b together, so the sign of a can only be chosen once b is known. In Example 2 the staircase falls and a=2 is positive, because b is negative. Taking a=−2 because the graph falls produces a staircase that climbs, and the check in step 7 catches it at once.

All four cases at a glance

  • Closed on the left, climbing: b>0 and a>0.
  • Closed on the left, falling: b>0 and a<0.
  • Closed on the right, climbing: b<0 and a<0. A price charged per started block has this shape.
  • Closed on the right, falling: b<0 and a>0, as in Example 2.

Check your understanding

No calculator needed.

  1. Every step of a staircase is 5 units long, and each one is closed at its left end. Which value of b does that give?
  2. True or false, with a reason: if every step of a graph is closed at its right end, then a is negative.
  3. A graph has three steps. Their closed dots are (−1,2), (1,6) and (3,10), and their open dots are (1,2), (3,6) and (5,10). Find a rule.
  4. A step function equals −2 on [0,4[, −5 on [4,8[ and −8 on [8,12[, and the pattern continues in both directions. Find a rule, then find f(−3).
  5. A step function equals 7 on ]−3,−1], 4 on ]−1,1] and 1 on ]1,3]. Find a rule.
  6. A graph has the steps [1,3[ at height 0, [3,5[ at height 2 and [5,7[ at height 4. A student takes (h,k)=(3,0) and writes f(x)=2⌊12(x−3)⌋. Find the error and correct the rule.
  7. Do f(x)=4⌊13x⌋+1 and g(x)=4⌊13(x−3)⌋+5 have the same graph? Explain.
  8. A staircase climbs by 2 at each jump, its steps are 0.5 units long and closed at their right ends, and (1,0) is a closed dot. Find a rule, then find f(0).
Show the answers
  1. b=15. The step length gives |b|=15, and closed left ends make b positive.
  2. False. Closed right ends only say that b<0. If the staircase falls, a has the sign opposite to b, so it is positive, as in Example 2, where a=2. The parameter a is negative only when such a staircase climbs.
  3. f(x)=4⌊12(x+1)⌋+2. Closed on the left, so b>0; steps 2 long, so b=12; climbing by 4, so a=4; closed dot (−1,2). Check: f(1)=4⌊1⌋+2=6 and f(0.9)=4⌊0.95⌋+2=2. Starting from (1,6) gives 4⌊12(x−1)⌋+6, the same function.
  4. f(x)=−3⌊14x⌋−2, and f(−3)=1. Closed on the left with steps 4 long, so b=14; falling by 3 with b positive, so a=−3; closed dot (0,−2). Then f(−3)=−3⌊−0.75⌋−2=−3(−1)−2=1: the input −3 lies on the step [−4,0[, one step above −2.
  5. f(x)=3⌊−12(x+1)⌋+7. Closed on the right, so b<0; steps 2 long, so b=−12; falling by 3 with b negative, so a=3; closed dot (−1,7). Check: f(1)=3⌊−1⌋+7=4 and f(2)=3⌊−1.5⌋+7=1.
  6. (3,0) is an open dot, so it is not on the graph: the graph has f(3)=2, while the student's rule gives f(3)=2⌊0⌋=0. Built on a point that is not on the graph, the student's rule comes out 2 too low at every x. Use a closed dot instead: (1,0) gives f(x)=2⌊12(x−1)⌋, and (3,2) gives the same function written as 2⌊12(x−3)⌋+2.
  7. Yes. 13x is exactly 1 more than 13(x−3), so its greatest integer is exactly 1 more, and f(x)=4⌊13(x−3)⌋+4+1=g(x). The two rules start from two closed dots of one staircase, (0,1) and (3,5).
  8. f(x)=−2⌊−2(x−1)⌋, and f(0)=−4. Closed at the right ends, so b<0, and steps 0.5 long give b=−2. Climbing with b negative, so a=−2. Closed dot (1,0): h=1, k=0. Then f(0)=−2⌊2⌋=−4. The input 0 is the closed right end of the step ]−0.5,0], two steps below the one that ends at (1,0).

Practise it

To read parameters in both directions, from a rule to its staircase and back, work through the free Secondary 4 step functions worksheet. The Secondary 5 step functions worksheet opens with a section on finding the rule.

Want one-on-one help with this? I offer Secondary 4 and 5 math tutoring in Montreal, in person or online. Sessions start with a short written diagnostic, and a written recap goes to whoever books after every session.

Practise finding the rule

Ready to improve your grades?

WhatsApp is the way to reach me — tell me the course you're taking and what you're stuck on, and we'll sort out a first session from there.

Message Me on WhatsApp

or send a message

I reply within a day, usually sooner. Your details are used only to answer you — see the Privacy Policy.

Private math & science tutoring in Montreal, QC — Westmount · Outremont · Town of Mount Royal · Hampstead · Côte-Saint-Luc · NDG · Nuns' Island · West Island — and online across Quebec.

Chat with Marius