[algogeeks] Re: What algorithm can be used to decide the denomination of notes in an ATM machine?

2009-09-22 Thread Channa Bankapur
@eSKay, @Ankur, et al., Please be aware that there are non-Indians too in the group. Hi All, Let me try and define the problem precisely (as far as I can). The ATM machines, which we generally see in India have the following behavior when an user tries to withdraw money from their Bank account.

[algogeeks] Re: Form of 3^n

2009-09-22 Thread Dave
You could compute the logarithm of the number to the base 3 and see if the result is an integer. Dave On Sep 21, 12:22 pm, Anshya Aggarwal anshya.aggar...@gmail.com wrote: how to find that whether the given number was of the form 3^n. ( i.e. 3 to the power n). one way is to recursively

[algogeeks] Re: Form of 3^n

2009-09-22 Thread Ramaswamy R
Can we evaluate the logarithm any more efficiently that repeated division by 3? On Tue, Sep 22, 2009 at 12:27 PM, Dave dave_and_da...@juno.com wrote: You could compute the logarithm of the number to the base 3 and see if the result is an integer. Dave On Sep 21, 12:22 pm, Anshya Aggarwal

[algogeeks] Re: Form of 3^n

2009-09-22 Thread Dave
He didn't ask for efficient ways, only other ways. On Sep 22, 2:36 pm, Ramaswamy R ramaswam...@gmail.com wrote: Can we evaluate the logarithm any more efficiently that repeated division by 3? On Tue, Sep 22, 2009 at 12:27 PM, Dave dave_and_da...@juno.com wrote: You could compute the