If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Converting recursive & explicit forms of arithmetic sequences

Sal is given an arithmetic sequence in explicit form and he converts it to recursive form. Then he does so the other way around!

Want to join the conversation?

  • duskpin ultimate style avatar for user CHEYENNE
    So an arithmetic sequence has a constant rate right
    (19 votes)
    Default Khan Academy avatar avatar for user
  • aqualine tree style avatar for user Marika Blonner
    so can the recursive formula be stated in 2 ways or is there a preferred version.
    g1 = x, gn = g(n-1) + y
    or g(n) = x if n = 1
    = g(n-1) + y if n > 1
    (6 votes)
    Default Khan Academy avatar avatar for user
    • starky tree style avatar for user Hannah C.
      the recursive formula can be stated in two ways/ forms. however, there is the preferred version, which is g(n)= g(n-1) +y. technically you can change it into g(n)= y+ g(n-1). it's just easier to see/ visualize the function in the first format rather the second one.
      (7 votes)
  • marcimus orange style avatar for user Ibby
    at doesn't he mean subtract seven not negative seven
    (7 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user 342Sarhamam
    Is arithmetic sequence basically a linear function with the domain of positive integers?
    Are there other differences?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Nikolay
      Late comment. The others are correct. To expand, if you graphed your sequence, you would get what looks like dots that can be connected by a line (just like the functions in the previous playlist). As we only look at positive integers, the line wouldn't actually be drawn.
      (2 votes)
  • piceratops ultimate style avatar for user Baron rojo
    what's the meaning of "h" and "g" f is function and n stand for number of times (i guess) but what about the first two
    (5 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user nina.shult
      It's all just different ways of writing a function, so if I said Height (abbrev to H) was a function of time (abbrev to t). Another way of writing that would be H(t). That just tells you H or height is a function of time-which makes sense if something were growing at a constant rate over time. Time is the independent variable and height is the variable that is dependent on the amount of time it takes. It used to confuse me a little too, but any problem with functions will define the rules and the variables of the functions. Another way to think about it is if the function were a chart H(t) would be the y coordinate and t would be the x coordinate value. The y value depends on what the x value is. You can really use any letter combination to define a function just think of the variable in the parenthesis as the x coordinate or the input and the final answer as the output.
      (2 votes)
  • mr pants teal style avatar for user Ira B.
    Why would you even want to do this? How is this used in real life and why do you need to change formulas?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Nikolay
      Q1: Sequences come in handy in higher maths when you begin calculus. In the "real world", sequences are used in many areas, including home loans and engineering (to name a few).

      Q2: The changing of the formulas is shown for your knowledge. Since there are 2 formulas available, it's good to know how to get one from the other. Also, students often prefer one over the other. Given a formula, those students can convert it into their preferred one.
      (2 votes)
  • starky sapling style avatar for user pxu1577
    At , does a recursive formula have to have n-1, or can I just write 9.7 - 0.1(n)?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      The function at is the explicit formula (not recursive). You could simplify the explicit formula into your version.

      The recursive formula is give in the function h(n). Recursive formulas require that you know the previous term to calculate the next term. So, you would use (n-1).
      (4 votes)
  • piceratops sapling style avatar for user Eliza
    does anyone know of a KA vid that properly explains going between the forms a + b(n-1) and a + b(n)?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Julie Vermeire
    he says subtract negative 7 NO....just subtract 7
    (1 vote)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      This is a known error in the video, and a correction box is shown at in the video. But, to see the correction boxes, you can't be watching the video in full screen mode. So, always check for the correction box prior to posting what you think is an error.
      (3 votes)
  • piceratops ultimate style avatar for user Julian Mohsennia
    Wouldn't 9.7 - 0.1n be a lot easier that the whole function? Why not use this?
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

- So I have a function here, h of n, and let's say that it explicitly defines the terms of a sequence. Let me make a little... Let me make a quick table here. We have n, and then we have h of n. When n is equal to one, h of n is negative 31, minus seven times one minus one, which is going to be... This is just going to be zero, so it's going to be negative 31. When n is equal to two, it's going to be negative 31 minus seven times two minus one, so two minus one. This is just going to be one, so it's negative 31 minus seven, which is equal to negative 38. When n is equal to three, it's gonna be negative 31 minus seven times three minus one, which is just two, so we're gonna subtract seven twice. It's gonna be negative 31 minus 14, which is equal negative 45. What do we see happening here? We're starting at negative 31, and then we keep subtracting, we keep subtracting negative seven. We keep subtracting negative seven from that. In fact we subtract negative seven one less than the term... We subtract negative seven one less times than the term we're dealing with. If we're dealing with the third term we subtract negative seven twice. If we're dealing with the second term we subtract negative seven once. This is all nice, but what I want you to do now is pause the video and see if you can define this exact same sequence. The sequence here is you start at negative 31, and you keep subtracting negative seven, so negative 38, negative 45. The next one is gonna be negative 52, and you go on and on and on. You keep subtracting negative seven. Can we define this sequence in terms of a recursive function? Why don't you have a go at that. Let's try to define it in terms of a recursive function. Let's just call that g of n, so g of n. In some ways a recursive function is easier, because you can say okay look. The first term when n is equal to one, if n is equal to one, let me just write it, If n is equal to one, if n is equal to one, what's g of n gonna be? It's gonna be negative 31, negative 31. And if n, if n is greater than one and a whole number, so this is gonna be defined for all positive integers, and whole, and whole number, it's just going to be the previous term, so g of n minus one minus seven, minus seven. We're saying hey if we're just picking an arbitrary term we just have to look at the previous term and then subtract, and then subtract seven. It all works out nice and easy, because you keep looking at previous, previous, previous terms all the way until you get to the base case, which is when n is equal to one, and you can build up back from that. You get this exact same sequence. Let's do another example, but let's go the other way around. Here we have a, we have a sequence defined recursively, and I want to create a function that defines a sequence explicitly. Let's think about this. One way to think about it, this sequence, when n is equal to one it starts at 9.6, and then every term is the previous term minus 0.1. The second term is gonna be the previous term minus 0.1, so it's gonna be 9.5. Then you're gonna go to 9.4. Then you're gonna go to 9.3. We could keep going on and on and on. If we want, we could make a little table here, and we could say this is n, this is h of n, and you see when n is equal to one, h of n is 9.6. When n is equal to two, we're now in this case over here, it's gonna h of two minus one, so it's gonna be h of one minus 0.1. It's just gonna be this minus 0.1, which is going to be 9.5. When h is three, it's gonna be h of two, h of two minus 0.1, minus 0.1. H of two is right over here. You subtract a tenth you're gonna get 9.4, exactly what we saw over here. Let's see if we can pause the video now and define this... Create a function that constructs or defines this arithmetic sequence explicitly. Here it was recursively. We wanna define it explicitly. So let's just call it, I don't know, let's just call it f of n. We can say look, it's gonna be 9.6, but we're gonna subtract, we're gonna subtract 0.1 a certain number of times depending on what term we're talking about. We're gonna subtract 0.1, but how many times are we gonna subtract it as a function of n? Let's see. If we're talking about the first term we subtract zero times. The second term we subtract one time. The third term we subtract two times. The fourth term we subtract three times. Whatever term we're talking about we subtract that term minus one times. If we're talking about the nth term, we subtracted this value n minus one times. You can verify that this is going to work. When n is equal to one this term here is going to be zero, so this whole thing is gonna be zero. You get 9.6. When n is equal to two, two minus one, you subtract 0.1 one time. 9.6 minus 0.1 is 9.5. You could keep doing that. You could draw a table, and evaluate these if you want to. The key thing is your'e starting at 9.6 and you're subtracting 0.1 one fewer times than the term you're looking at. If you're looking at the if n is equal to, this is n is equal to four, well you're gonna subtract 0.1 three times, and you see that. Subtract 0.1 once, subtract 0.1 twice, subtract 0.1 three times.