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

2009-09-23 Thread eSKay
I disagee. Please don't force your personal opinions on everybody like this. Thanks. On Sep 20, 4:39 pm, ankur aggarwal wrote: > i think there is no use of discussing this ques.. > > On Sun, Sep 20, 2009 at 2:25 PM, eSKay wrote: > > > yes it is different. > > > Coin Denomination Problem [http:/

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

2009-09-23 Thread eSKay
@Shishir cool! this seems to work!! C[i] = (N-1)/D[i] ; //this is super cool On Sep 21, 10:29 am, Shishir Mittal <1987.shis...@gmail.com> wrote: > Let the denominations be D[] = {1000,500,100}, > and amount be N. > Let C[] , denotes the count of each denomination. > for ( i=0 ; i < 2 ; i++) { >

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

2009-09-23 Thread eSKay
@Channa thanks for explaining for the benefit of everybody. On Sep 22, 4:50 pm, Channa Bankapur wrote: > @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, whi

[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: What algorithm can be used to decide the denomination of notes in an ATM machine?

2009-09-21 Thread Ramaswamy R
I don't quite get the "if possible" clause. But here is what we can do. Have an array C[i] with counts correspondint to denominations in D[i] (ordered). >From the lowest denomination assign 1 of each until the total doesn't exceed the required amount. Once that is done, from the highest denominati

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

2009-09-21 Thread Nagendra Kumar
idea is to give note of each denomination at least once (if possible). On Mon, Sep 21, 2009 at 10:59 AM, Shishir Mittal <1987.shis...@gmail.com>wrote: > Let the denominations be D[] = {1000,500,100}, > and amount be N. > Let C[] , denotes the count of each denomination. > for ( i=0 ; i < 2 ; i++)

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

2009-09-20 Thread Shishir Mittal
Let the denominations be D[] = {1000,500,100}, and amount be N. Let C[] , denotes the count of each denomination. for ( i=0 ; i < 2 ; i++) { C[i] = (N-1)/D[i] ; N = N - D[i]*C[i] ; } C[2] = N/D[2] ; For N=4800, C[] = {4, 1, 8} For N= 2000, C[] = {1, 1, 5}, as required. Nice observat

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

2009-09-20 Thread Dufus
@Ankur I cannot agree more with you Perhaps a more precise question would have been better instead of just an observation _dufus On Sep 20, 4:39 pm, ankur aggarwal wrote: > i think there is no use of discussing this ques.. > > On Sun, Sep 20, 2009 at 2:25 PM, eSKay wrote: > > > yes it is dif

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

2009-09-20 Thread ankur aggarwal
i think there is no use of discussing this ques.. On Sun, Sep 20, 2009 at 2:25 PM, eSKay wrote: > > yes it is different. > > Coin Denomination Problem [http://haroonsaeed.wordpress.com/2006/06/06/ > coin-denomination-problem/

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

2009-09-20 Thread ankur aggarwal
@dufus i dont think becoz if u have to take 1000rs then we have 500 note and 100 rs note though we have 1000rs note. IT is in INDIA.. i dont know about other countries On 9/20/09, Dufus wrote: > > Is it different from classic Coin Denomination problem? > > _dufus > > On Sep 19, 11:20 pm, eSKay

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

2009-09-20 Thread eSKay
yes it is different. Coin Denomination Problem [http://haroonsaeed.wordpress.com/2006/06/06/ coin-denomination-problem/] [http://www.seeingwithc.org/ topic1html.html] would give 2000=1000+1000. Thats not the case with an ATM machine. On Sep 20, 10:21 am, Dufus wrote: > Is it different from cla

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

2009-09-20 Thread Dufus
Is it different from classic Coin Denomination problem? _dufus On Sep 19, 11:20 pm, eSKay wrote: > for example: if I draw 2000, what I get is > 1000+500+100+100+100+100+100. > > What algorithm can be used to decide how to break up the entered > amount? --~--~-~--~~~

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

2009-09-20 Thread ankur aggarwal
i think if we input any data > 500 and < 1000 then it will give 500+ number of 100 and also if it is in 1000 or 2000 then 100*5 + 500 +1000( number of thousand accordingly ) On Sat, Sep 19, 2009 at 11:50 PM, eSKay wrote: > > for example: if I draw 2000, what I get is > 1000+500+100+100+100+1