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
