Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53856
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <antoon.pardon@rece.vub.ac.be> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.198 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.67; '*S*': 0.06; 'received:134': 0.05; 'question.': 0.14; 'fruit': 0.16; 'fruit.': 0.16; 'set,': 0.16; '>>>': 0.22; 'example': 0.22; 'header:User-Agent:1': 0.23; 'choices': 0.24; 'regardless': 0.24; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; 'sets': 0.30; "i'm": 0.30; 'sep': 0.31; '+0200,': 0.36; 'acceptable': 0.36; 'should': 0.36; 'jason': 0.38; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'above,': 0.60; 'kind': 0.63; 'pick': 0.64; 'different': 0.65; 'chance': 0.65; 'talking': 0.65; 'dict()': 0.84; 'pardon': 0.84; 'wanting': 0.93; '2013': 0.98 |
| X-IronPort-Anti-Spam-Filtered | true |
| X-IronPort-Anti-Spam-Result | Ap4EANpzLVKGuA9G/2dsb2JhbABaxiSBMoMaAQV4EQshFg8JAwIBAgFFEwYCAod+vRGIJJAHFoQHA5d1hhiLToMi |
| Date | Mon, 09 Sep 2013 09:12:05 +0200 |
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
| User-Agent | Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: Weighted choices |
| References | <CANy1k1gHFFgd82P5VZJEEZvWe_kHJvi2r1uqVh3Sr=nFZyazuQ@mail.gmail.com> <522CB887.9090000@rece.vub.ac.be> <kl4q29ta0kn2tnfoju13dg8nni4vjvco80@4ax.com> |
| In-Reply-To | <kl4q29ta0kn2tnfoju13dg8nni4vjvco80@4ax.com> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://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 | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.164.1378710734.5461.python-list@python.org> (permalink) |
| Lines | 28 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1378710734 news.xs4all.nl 15919 [2001:888:2000:d::a6]:60072 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:53856 |
Show key headers only | View raw
Op 09-09-13 02:21, Dennis Lee Bieber schreef: > On Sun, 08 Sep 2013 19:48:55 +0200, Antoon Pardon > <antoon.pardon@rece.vub.ac.be> declaimed the following: > >> Op 08-09-13 04:12, Jason Friedman schreef: >>> choices = dict() >>> choices["apple"] = 10 >>> choices["pear"] = 20 >>> choices["banana"] = 15 >>> choices["orange"] = 25 >>> choices["kiwi"] = 30 >>> >>> I want to pick sets of fruit, three in a set, where the chance of >>> selecting a given fruit is proportional to its weight. In the example >>> above, pears should appear twice as often as apples and kiwis should >>> appear twice as often as bananas. >> >> Just a small question. Is a set of three bananas an acceptable outcome? > > If we are talking probabilities, regardless of what the weighting is, > it should be probable (if unlikely) to get three-of-a-kind. Why should that be? I'm unfamiliar with any kind of imperative that discourages people from wanting sets with three different kinds of fruit. -- Antoon Pardon
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Re: Weighted choices Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-09 09:12 +0200
Re: Weighted choices Steven D'Aprano <steve@pearwood.info> - 2013-09-09 09:11 +0000
Re: Weighted choices Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2013-09-09 12:01 +0200
csiph-web