function problem

This topic has expert replies
Senior | Next Rank: 100 Posts
Posts: 97
Joined: Wed Sep 01, 2010 11:11 am
Thanked: 1 times
Followed by:2 members

function problem

by akshatgupta87 » Sun Jan 15, 2012 11:31 am
Q) The function g(x) is defined for integers x such that if x is even, g(x) = x/2 and if x is odd, g(x) = x + 5. Given that g(g(g(g(g(x))))) = 19, how many possible values for x would satisfy this equation?
A) 1
B) 5
C) 7
D) 8
E) 11

Someone explain..

~ Thanks,
Akshat
Source: — Problem Solving |

GMAT/MBA Expert

User avatar
GMAT Instructor
Posts: 768
Joined: Wed Dec 28, 2011 4:18 pm
Location: Berkeley, CA
Thanked: 387 times
Followed by:140 members

by Mike@Magoosh » Sun Jan 15, 2012 2:01 pm
Hi, I'm happy to help with this. :)

This is a difficult question. Let's take it one step at a time.

The setup: The function g(x) is defined for integers x such that if x is even, g(x) = x/2 and if x is odd, g(x) = x + 5.

Notice, that g(even) = even/2, which could be even or odd. But g(odd) = odd + 5 = even. Thus, we know, if the output of g(x) is even, it could result from an even or odd input, but if the output is odd, it can only result from an even input.

Start with g(x) = 19. That can only result from g(38) = 19.

Next, g(g(x)) = 19 means that g(x) = 38, which can result from g(76) = 38 or g(33) = 38. In other words, 33 & 76 are the inputs of g(g(x)) that have an output of 19.

Next, g(g(g(x))) = 19 means g(g(x)) = 38, which means g(x) = 76 or g(x) = 33. The former can result from g(152) = 76 or from g(71) = 76. The latter can result only from g(28) = 33. In other words, 28 & 71 & 152 are the inputs of g(g(g(x))) that have an output of 19.

Next, g(g(g(g(x)))) = 19 means g(g(g(x))) = 38, which means g(g(x)) = 76 or g(g(x)) = 33, which means g(x) equals either 28 or 71 or 152. We can get 28 from g(56) = 28 or g(23) = 28. We can get 71 only from g(142) = 71. We can get 152 either from g(147) = 152 or g(304) = 152. These five numbers, 23 or 56 or 142 or 147 or 304, are the five possible inputs of g(g(g(g(x)))) that have an output of 19.

Next, if g(g(g(g(g(x))))) = 19, this means
g(g(g(g(x)))) = 38, which means
g(g(g(x))) = 76 or 33, which means
g(g(x)) = 28 or 71 or 152, which means
g(x) = 23 or 56 or 142 or 147 or 304

We can get g(x) = 23 only from g(18) = 23.
We can get g(x) = 56 from either g(112) = 56 or g(51) = 56
We can get g(x) = 142 from either g(284) = 142 or g(137) = 142
We can get g(x) = 147 only from g(294) = 147
We can get g(x) = 304 from either g(608) = 304 or from g(299) = 304.

Any of those 8 bold values are inputs that will give g(g(g(g(g(x))))) an output of 19. Eight possibilities. The answer is D.

Incidentally, it's no coincidence that the number of possibilities at each state (1, 2, 3, 5, 8) was following the Fibonacci sequence. In fact, that's determined by the initial conditions.

Does that make sense? Please let me know if you have any questions on what I've said here.

Mike :)
Magoosh GMAT Instructor
https://gmat.magoosh.com/

Legendary Member
Posts: 1084
Joined: Fri Apr 15, 2011 2:33 pm
Thanked: 158 times
Followed by:21 members

by pemdas » Sun Jan 15, 2012 2:11 pm
these five functions can be defined such a way that x with even multiplier (by 2) may be assigned five values and the odd values (added by 5) may be max. only three, even+odd=odd and odd+odd=even. As 19 cannot be x+5, since x will be 14 then (14 is even) we start from even in the first function.
in total 5 even and three odd values for x

d

akshatgupta87 wrote:Q) The function g(x) is defined for integers x such that if x is even, g(x) = x/2 and if x is odd, g(x) = x + 5. Given that g(g(g(g(g(x))))) = 19, how many possible values for x would satisfy this equation?
A) 1
B) 5
C) 7
D) 8
E) 11

Someone explain..

~ Thanks,
Akshat
Success doesn't come overnight!

Senior | Next Rank: 100 Posts
Posts: 57
Joined: Mon Dec 21, 2009 6:27 am
Location: Melbourne, Australia
Thanked: 17 times

by [email protected] » Sun Jan 15, 2012 6:46 pm
The simple way to tackle this problem is to apply reverse engineering,until we find a definite pattern.

Given g(x) = 19, we can consider which operation applied to (x). If it was x/2, then (x)= 38. 38 is even so this can be the case. If it was x + 5, then (x) was 14. 14 is even, so this operation would not have been applied.
We can make a tree, with 19 as the root, and 38 as the first child.
Next consider 38. 38 could have resulted from 76/2 or 33 + 5. Two choices give us two children of 38:

19 -> 38 -> 76, 33.

We can now observe the pattern that with an odd number, it must have come from an even, but an even could come from either of two numbers.

Therefore our 76 will branch into 2 numbers, and the 33 into just one.
33 -> 66
76 -> 73, 152..
19
|
38
/ \
33 76
| | \
E E O
/ \ /\ |
E O E O E
/ \ | /\ | /\
E 0 E EO E E O

counting the node at the lowest level give us 8 choices

User avatar
Legendary Member
Posts: 626
Joined: Fri Dec 23, 2011 2:50 am
Location: Ahmedabad
Thanked: 31 times
Followed by:10 members

by ronnie1985 » Sun Jan 15, 2012 7:48 pm
This is a lengthy question. There shall be 2 x's for each g(x), one odd and other even. Since for odd+odd = even, 19 = 38/2, all the even outcomes are because of summation with 5
Make a tree diagram starting with 19 to obtain the no of possible inputs as
Attachments
Solution.pdf
Solution
(12.99 KiB) Downloaded 125 times
Follow your passion, Success as perceived by others shall follow you

User avatar
Legendary Member
Posts: 626
Joined: Fri Dec 23, 2011 2:50 am
Location: Ahmedabad
Thanked: 31 times
Followed by:10 members

by ronnie1985 » Sun Jan 15, 2012 7:49 pm
Answer is 5 - (B)
Follow your passion, Success as perceived by others shall follow you

Master | Next Rank: 500 Posts
Posts: 234
Joined: Fri Oct 01, 2010 7:28 pm
Location: chennai
Thanked: 5 times
Followed by:4 members

by pappueshwar » Sun Feb 05, 2012 6:54 pm
hi guha,

in the example that u have given, the tree form is a good way to understand. but how did u stop at the lowest node? i mean why cant the anwser go on a step further?

is it becoz the answer choice is limited to number 8 ?

Senior | Next Rank: 100 Posts
Posts: 57
Joined: Mon Dec 21, 2009 6:27 am
Location: Melbourne, Australia
Thanked: 17 times

by [email protected] » Sun Feb 05, 2012 7:17 pm
pappueshwar wrote:hi guha,

in the example that u have given, the tree form is a good way to understand. but how did u stop at the lowest node? i mean why cant the anwser go on a step further?

is it becoz the answer choice is limited to number 8 ?
It was given that g(g(g(g(g(x))))) = 19, SO there is total 5 operation that we need to perform, hence the depth of tree=5.