473,320 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

mind

we have coins of a, b, c. and the shopkeaper also have the same. to purchase some thng we have to pay x rupees to shop keaper, he can also return coins to us. Write a program to find the minimum no. of coins required for transaction.
Aug 22 '08 #1
6 1367
newb16
687 512MB
Write a program to find the minimum no. of coins required for transaction.
What for? i.e any ideas why one should do it?
Aug 22 '08 #2
JosAH
11,448 Expert 8TB
we have coins of a, b, c. and the shopkeaper also have the same. to purchase some thng we have to pay x rupees to shop keaper, he can also return coins to us. Write a program to find the minimum no. of coins required for transaction.
That's a simple IP problem (Integer Programming); let n1, n2, n3 be the number
of coins of value a, b and c paid by the customer and m1, m2, n3 be the number
of coins returned by the shopkeeper. The single constraint is:

n1*a + n2*b + n3*c - m1*a - m2*b - m3*c == x

The cost function is n1+n2+n3+m1+m2+m3 which should be minimized.

kind regards,

Jos
Aug 22 '08 #3
write a c program for that
Aug 23 '08 #4
That's a simple IP problem (Integer Programming); let n1, n2, n3 be the number
of coins of value a, b and c paid by the customer and m1, m2, n3 be the number
of coins returned by the shopkeeper. The single constraint is:

n1*a + n2*b + n3*c - m1*a - m2*b - m3*c == x

The cost function is n1+n2+n3+m1+m2+m3 which should be minimized.

kind regards,

Jos
we want a c program for that
Aug 23 '08 #5
Banfa
9,065 Expert Mod 8TB
we want a c program for that
Excellent, when you have written it please feel free to post here with any problems that you are having with it.
Aug 23 '08 #6
JosAH
11,448 Expert 8TB
write a c program for that
Cplex (by ILog) is written in C; I believe they have a student license for their
Integer Linear Programming solver module. Good luck.

kind regards,

Jos
Aug 23 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Arthur T. Murray | last post by:
"Bill Modlin" <modlin1@metrocast.net> wrote on Fri, 26 Sep 2003: <snip> >>> If I wanted to explain how one of my programs worked >>> I would not give someone a print out of the code. >>> First I...
11
by: Arthur T. Murray | last post by:
Now, suppose that you wanted to write an AI in Python that would implement your mind-model and allow it to grow, mutate, develop. Here is one possible scenario. It would not be necessary to do...
0
by: net4professionals | last post by:
marriage in ur mind??? visit http://www.net4matrimonials.com job in ur mind??? visit http://www.net4professionals.com EMPLOYERS CAN POST UPTO 5 JOB FREE
13
by: Adrienne Boswell | last post by:
In the site I am redoing, I am frequently running into this screnario: Tel: (818) 555-1212 Fax: (818) 555-1234 where the tel and fax should be bold to stand out. Currently, I am using span with...
1
by: James Conrad StJohn Foreman | last post by:
Hi, we've recently changed our db2 server from using a single RAID array to a SAN. (machine is running 8.2.4 UDB on SLES 9, 2.6 kernel, 32 bit Intel) If we'd been using a RAID array, then...
0
by: tommak | last post by:
It's a dream of human beings to build machines that can think and behave like human beings. The most important part of of such a machine is an artificial mind that can emulate the cognitive...
11
by: Wayne | last post by:
I am a one man enterprise and have been asked by a prospective client what happens to their database regarding ongoing changes etc if I get hit by a bus. Obviously my databases are distributed...
1
by: tommak | last post by:
It's a dream of human beings to build machines that can think and behave like human beings. The most important part of of such a machine is an artificial mind that can emulate the cognitive...
3
by: StevieG555 | last post by:
Hi everyone, I am new to Ajax and have been fascinated by the possibilities available with JavaScript and XML. More specifically, I am interested in mind mapping and would like to know how to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.