A certain computer algorithm executes twice as many operations when it is run with an input of size k as when it is run with an input of size k-1 (where k is an integer that is greater than 1 ). When the algorithm is run with an input of size 1 , it executes seven operations. How many operations does it execute when it is run with an input of size 22?
For each integer n>=1, let s_(n-1) be the number of operations the algorithm executes when it is run with an input of size n. Then s_(0)= q, ✓ and s_(k)= q, for each integer k>=1. Therefore, s_(0),s_(1),s_(2),dots is q,
with constant q, ✓, which is ◻ X. So, for every integer n>=0,s_(n)= ◻ . It follows that for an input of size 22, the number of operations executed by the algorithm is s q, ✓, which equals
q, ✓.
Need Help?