Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #13101
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <chris@rebertia.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.032 |
| X-Spam-Evidence | '*H*': 0.94; '*S*': 0.00; '(also': 0.09; 'url:github': 0.09; 'iterator': 0.16; 'refactored': 0.16; 'cc:addr :python-list': 0.16; 'written': 0.16; 'wrote:': 0.16; 'cheers,': 0.18; 'cc:no real name:2**0': 0.20; 'appears': 0.20; '(but': 0.21; 'cc:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'work,': 0.23; 'extensively': 0.23; 'sep': 0.23; 'pm,': 0.24; 'code': 0.25; 'sat,': 0.28; 'problem': 0.28; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.30; 'class': 0.30; 'chris': 0.32; "isn't": 0.33; "i've": 0.34; 'creates': 0.34; 'received:209.85.161': 0.35; 'skip:" 10': 0.36; 'but': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'suggestions': 0.39; 'version:': 0.39; 'appreciated.': 0.39; 'dr.': 0.68; 'numbered': 0.84; 'sender:addr:chris': 0.84; 'subject:balls': 0.84; 'url:rebertia': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=L3BaHIBzK2SvH/oG2Z7IdqFZoLTOzKBbp0CjJGxOOAo=; b=QNoDhYUmQmuehlu9gR6M4NXyZRsFe1U0S8VwjUX2FLFMqooWwq2fknPw4IY6BUXEin Gmu6SUtLjhmIgmUonQuuz/eaAg8XFA4zJ7qhPsa8nHxH6U0oo7BMtA3/6GtwZ5OzPM5h 6Pa5dIyQG8izPPqrJckCvpB94fhhvYx/iov8A= |
| MIME-Version | 1.0 |
| Sender | chris@rebertia.com |
| In-Reply-To | <32440187.post@talk.nabble.com> |
| References | <32440187.post@talk.nabble.com> |
| Date | Sat, 10 Sep 2011 19:18:47 -0700 |
| X-Google-Sender-Auth | CXAojRvkmdJ6O0skk5hgnd6x4vU |
| Subject | Re: recursive algorithm for balls in numbered boxes |
| From | Chris Rebert <clp2@rebertia.com> |
| To | "Dr. Phillip M. Feldman" <Phillip.M.Feldman@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.963.1315707530.27778.python-list@python.org> (permalink) |
| Lines | 19 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1315707530 news.xs4all.nl 2527 [2001:888:2000:d::a6]:59056 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:13101 |
Show key headers only | View raw
On Sat, Sep 10, 2011 at 5:43 PM, Dr. Phillip M. Feldman <Phillip.M.Feldman@gmail.com> wrote: > I've written a recursive class that creates an iterator to solve a general > formulation of the combinatorics problem known as "balls in numbered boxes" > (also known as "indistinguishable balls in distinguishable boxes"). The > code has been extensively tested and appears to work, but isn't terribly > elegant. Any suggestions about how to improve it will be appreciated. Significantly refactored (but untested) version: https://gist.github.com/1209079 Cheers, Chris -- http://rebertia.com
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: recursive algorithm for balls in numbered boxes Chris Rebert <clp2@rebertia.com> - 2011-09-10 19:18 -0700
csiph-web