# Homework Help: Compositions - I'm confused

1. Jan 12, 2007

### Bucs44

Let f and g be functions from the positive integers to the positive integers defined by the equations:

f(n) = 2n + 1, g(n) = 3n - 1

Find the compositions f o f, g o g, f o g, and g o f

So far here is what I've come up with - please point out where I have gone wrong and how to get back on track.

f o f (n) = 2(2n + 1)
g o g (n) = 6n - 1
f o g (n) = (6n + 1)
g o f (n) = (6n) + 1

Any help would be greatly appreciated!

2. Jan 12, 2007

### cristo

Staff Emeritus
f o f(n)=f(f(n))=f(2n+1)

Do you see what I'm doing here? You now have to substitute (2n+1) into the equation for f(m)=2m+1 where m=(2n+1)

3. Jan 12, 2007

### Bucs44

I think that I follow you - So f o f = f(2n + 1) ??

4. Jan 12, 2007

### cristo

Staff Emeritus
Yes, so then f(2n+1)= 2(2n+1)+1. Expand and you'll have the answer.

Try the same for the other problems.

5. Jan 12, 2007

### Bucs44

Just so I'm clear - for f o f - I do not need to go any further than what you had above?

for g o g it would be g(f(n)) = g(2n + 1) = 2(3n - 1)

6. Jan 12, 2007

### cristo

Staff Emeritus
Well, you should expand and simplify.

No. Note that (g o g)(n) is equivalent to writing g(g(n)).

7. Jan 12, 2007

### Jumpy Lee

If done correctly u should get

f o f(n) = 4n + 3
g o g(n)= 9n - 4
f o g(n) = 6n - 1
g o f(n) = 6n + 1

8. Jan 12, 2007

### cristo

Staff Emeritus
Hi, Jumpy Lee, and welcome to PF. Please note that we do not give out solutions to questions in homework forums; rather, we attempt to help the original poster to get the answer for himself. In the long term, this will benefit his learning of the topic.

9. Jan 12, 2007

### Bucs44

I'm not sure what you mean by expanding.

So g o g = 3n -1(3n - 1)(2n + 1) ??

10. Jan 12, 2007

### Jumpy Lee

When doing composistions u replace the verable in the outside function with the value of the inside function.

Like g(n) = 3n - 1 so g(g(n)) = 3(3n - 1) -1

Try that on the other compositions

11. Jan 12, 2007

### Jumpy Lee

Whops sorry bout that

12. Jan 12, 2007

### cristo

Staff Emeritus
Sorry, I might be explaining this too quickly! Let's retrack a bit.

(f o f)(n)=f(f(n)). Now note that f is a function, whereas f(n) is a number. So, if we set f(n)=m, then we can re-write: f(f(n))=f(m).

So, lets look at your functions. f(n)=2n+1; let's denote this by m. Now, f(f(n))=f(m)=f(2n+1). So now, we substitute "2n+1" in place of n in the function of f(n).

Thus f(2n+1)=2(2n+1)+1=4n+3. (That's what I meant by simplify, simply multiply out the brackets!)

Now, let's look at g o g in a similar way: g(g(n))=g(3n-1)=3(3n-1)-1.

The key thing to remember is that, when you have, say g(3n-1) you substitute the expression in the brackets into the formula for g, just like if you had g(m) you would substitute m into the formula for g.

Have I explained clearer this time?

13. Jan 12, 2007

### Bucs44

I'm following you now for the most part - the only thing that I'm unclear on is for both fof and gog, you have the +1 and -1 at the end of each equation - where does that come from?

14. Jan 12, 2007

### Bucs44

For f o g then it would be (2n + 1)=2(3n - 1) - 1

15. Jan 12, 2007

### Jumpy Lee

The 1 at the end of the equation comes from the function.

in the gog u are replacing the n in the original 3n - 1 with 3n - 1. therefore when 3n - 1 is substuted for n u get the equation 3(3n - 1) - 1.

16. Jan 12, 2007

### Jumpy Lee

no

fog is the same as f(g(n)) which is f(3n - 1)

now put the 3n - 1 in for n in the f(n) equation

17. Jan 12, 2007

### Bucs44

And this is just inverted for g o f correct? 3(2n + 1) + 1

18. Jan 12, 2007

### Jumpy Lee

Make shure that the +/- sign after the () is the sign that comes before the 1 in the first equation

19. Jan 12, 2007

### Bucs44

So then f o g is 2(3n - 1) - 1 = 6n - 1

and g o f is 3(2n + 1) + 1 = 6n + 1

20. Jan 12, 2007

### Jumpy Lee

switch the signs before the last 1 before the equals sign and u will have it