Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.113 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.78; '*S*': 0.00; 'say,': 0.05; 'remaining': 0.07; 'enormous': 0.09; 'latter': 0.09; 'exhaustive': 0.16; 'subject:generation': 0.16; 'elements': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'now?': 0.24; 'sorry,': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'generally': 0.29; 'url:mailman': 0.30; 'raised': 0.31; 'probably': 0.32; 'url:python': 0.33; 'computer.': 0.33; 'could': 0.34; 'something': 0.35; 'but': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'doing': 0.36; 'url:org': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'skip:8 10': 0.39; 'to:addr:python.org': 0.39; 'url:mail': 0.40; 'even': 0.60; 'march': 0.61; 'visit': 0.64; 'more': 0.64; 'close': 0.67; 'received:74.208': 0.68; 'power': 0.76; '100': 0.79; 'age': 0.80; '2015': 0.84; 'received:74.208.4.194': 0.84; 'hundred': 0.95 Date: Fri, 06 Mar 2015 06:22:34 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Speeding up permutations generation References: <201503060532.03842.gheskett@wdtv.com> In-Reply-To: <201503060532.03842.gheskett@wdtv.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:qxLRSUL9S+lI+L7q2zWsK+87WQezETyLUVlGUaGNdN0JmsKWDx8 3Rsg3vBc5mF38KQxMwz84L9liyCZtoXsekGQFgekJB7fh5UUZPq/+SbR5N06wpW5K0efUc0 C+/4baT9w1CaK+Ou84Gys3+KD8X/xOCR18sckf2qLamBgFR+vLqsYJx7mo1n7611VqEXwS1 SDBiEr8llAxNVxJ5Yvdeg== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.19 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 34 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1425640973 news.xs4all.nl 2860 [2001:888:2000:d::a6]:56835 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:87014 On 03/06/2015 05:32 AM, Gene Heskett wrote: > > > On Friday 06 March 2015 03:24:48 Abhiram R wrote: >>> A list of 100 elements has approximately 9.33 x 10**157 >>> permutations. If you could somehow generate one permutation every >>> yoctosecond, exhausting them would still take more than a hundred >>> orders of magnitude longer than the age of the universe. >>> -- >>> https://mail.python.org/mailman/listinfo/python-list >> >> ​True that :D I may have exaggerated on the number. Let's consider >> something more practically manageable​ => 50 elements with a 50! >> permutation. >> Is there a solution now? > > Yes, but its now only 8.881784197e+84 elements so it is still not a > practical target. Doing all elements of a matrix is generally equ to > n!, and 50 raised to the 50th power is still a number that will probably > use up this suns remaining lifetime doing it in assembly. Sorry, but 50! is not even close to 50**50. The latter is 85 digits as you say, but 50! is "only" 64. 30414093201713378043612608166064768844377641568960512000000000000L Still an enormous number of course, so an exhaustive visit to all those permutations is still impossible on a conventional computer. -- DaveA