Agnishom gave Chris a program written in Python.
1 2 3 4 5 6 7 8 9 10 11 12 |
|
How many ordered pair of non-negative integers are there such that the time complexity of this recursive function is ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
3 n = a ⋅ 3 n − 1 + b ⋅ 3 n − 2
9 = 3 a + b b must be a multiple of 3, so let's say b = 3 b 2
so we now have b 2 + a = 3
the solutions of which are ( 0 , 3 ) ( 1 , 2 ) ( 2 , 1 ) ( 3 , 0 )
So we have 4 solutions