Gentoo Archives: gentoo-user

From: Marcus Wanner <marcusw@×××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] program to solve assignment problem?
Date: Tue, 03 Nov 2009 02:48:59
Message-Id: 4AEF9A16.8090107@cox.net
In Reply to: Re: [gentoo-user] program to solve assignment problem? by Michael Sullivan
1 On 11/2/2009 5:59 PM, Michael Sullivan wrote:
2 > On Mon, 2009-11-02 at 17:48 -0500, Marcus Wanner wrote:
3 >
4 >> On 11/2/2009 3:49 PM, Erik wrote:
5 >>
6 >>> Is there some simple little program to solve assignment problems?
7 >>> Suppose that someone bought k meat (160), m fish (30) and n milk (15)
8 >>> for 700. So it should solve the equation k * 160 + m * 30 + n * 15 =
9 >>> 700. (A solution happens to be k = 4, m = 2, n = 0. An additional
10 >>> condition could be that he bought at most 6 items; k + m + n <= 6. That
11 >>> would eliminate solutions like k = 4, m = 0, n = 4.)
12 >>>
13 >>>
14 >> What?
15 >>
16 >>
17 >
18 > Can't one do this kind of thing in python?
19 >
20 That is what I would do, if I couldn't do it on paper...
21
22 But seriously, this does not belong on this list.
23
24 Marcus