From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1N55sV-0007vv-Q7 for garchives@archives.gentoo.org; Mon, 02 Nov 2009 23:00:00 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 967E1E0B96; Mon, 2 Nov 2009 22:59:58 +0000 (UTC) Received: from mail-yw0-f191.google.com (mail-yw0-f191.google.com [209.85.211.191]) by pigeon.gentoo.org (Postfix) with ESMTP id 71EB4E0B96 for ; Mon, 2 Nov 2009 22:59:58 +0000 (UTC) Received: by ywh29 with SMTP id 29so4897708ywh.32 for ; Mon, 02 Nov 2009 14:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=f5Wzi3aW8G6vDhuiBp/Vn4CqooydJWvP9XKFIc+Hvio=; b=PUXxjQuMUPZGROyLcVWIAhO9n/u6tO7QcCnZoMPEl2uRpHt2gNCzfbztWRp66HqQFE xhrvij/oanGy1P+qMmctdJP0Nyw7hdmSIOlpv13FkasnpD6OEU/nKrBykW0X1O+181Kk m2UmjJs2VnydnQrvMRT5nAUR6/ZzegYr/hLW8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=b4VansjHPg38EdWMc3wX0+LMbjr0ErXjNLOm8qF0NjtldJiorukoqICi0xkrs4TYuK 2xCw92Pg990v3k/h9m5ZdCtJQZg5lw1BDnuhbuCQTDjaDggh/Ytd9oSTZdJ0dZO19JEe Nfv8TPb63PgbrxZgJgqk1iv8z9q5NicPaiYiQ= Received: by 10.101.9.15 with SMTP id m15mr3023564ani.113.1257202798125; Mon, 02 Nov 2009 14:59:58 -0800 (PST) Received: from ?192.168.1.3? (adsl-70-234-126-70.dsl.tul2ok.sbcglobal.net [70.234.126.70]) by mx.google.com with ESMTPS id 39sm2722710yxd.9.2009.11.02.14.59.56 (version=SSLv3 cipher=RC4-MD5); Mon, 02 Nov 2009 14:59:56 -0800 (PST) Subject: Re: [gentoo-user] program to solve assignment problem? From: Michael Sullivan To: gentoo-user@lists.gentoo.org In-Reply-To: <4AEF61BA.7040405@cox.net> References: <4AEF45C2.20703@gmail.com> <4AEF61BA.7040405@cox.net> Content-Type: text/plain Date: Mon, 02 Nov 2009 16:59:54 -0600 Message-Id: <1257202794.14602.0.camel@camille.espersunited.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.26.3 Content-Transfer-Encoding: 7bit X-Archives-Salt: 8edb307b-8d62-43c0-8da3-20129ed46306 X-Archives-Hash: 7381017fd7d2ddf1df498b0344e62404 On Mon, 2009-11-02 at 17:48 -0500, Marcus Wanner wrote: > On 11/2/2009 3:49 PM, Erik wrote: > > Is there some simple little program to solve assignment problems? > > Suppose that someone bought k meat (160), m fish (30) and n milk (15) > > for 700. So it should solve the equation k * 160 + m * 30 + n * 15 = > > 700. (A solution happens to be k = 4, m = 2, n = 0. An additional > > condition could be that he bought at most 6 items; k + m + n <= 6. That > > would eliminate solutions like k = 4, m = 0, n = 4.) > > > What? > Can't one do this kind of thing in python?