There is a sequence of n operations, The ith operation costs 2i if i is an exact power of 2, costs 3i if i is an exact power of 3, and 1 for all other operations.
Hi first up I want to say that it is a homework problem and I don't want you to solve it for me.I have solved it using the aggregate method. For which I summed up the series of powers of 2 and series of powers of 3 and got amortized cost of 10. I then checked it using the accounting method, for really long sequences and it did not fail. But my problem is how to prove that it would never fail, I can show for as long sequence I want but it would still not guarantee that it would not fail some time after.
Also I tried solving it with the potential function method, this is where I am really stuck, to device a potential function I think you need to be really creative, I cant find some condition which states that at this point this would always hold, need some help there too.
Just some ideas about how to prove it in the accounting method and how to device a potential function should be enough. Thanks