Re: Problem with algorithm

2007-04-13 Thread Robert Kern
Paul McGuire wrote: > If I see farther, it is because I stand on the shoulders of an > infinite number of monkeys. If I ever get around to writing a book on numerical methods/computational science/whatever, this will be the chapter quote for my chapter on Monte Carlo algorithms. -- Robert Kern

Re: Problem with algorithm

2007-04-13 Thread azrael
Are you maybe trying to create a rainbow table, or a very big dictionary -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with algorithm

2007-04-13 Thread Steve Holden
Paul McGuire wrote: > On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> I'm pretty sure you could give a separate name to each atom ont he known >> universe with a scheme like this. Do you really need 20-byte strings? >> > > Steve, > > Based on the Wikipedia article's estimate of 10

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:41 am, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > On Apr 13, 10:22 am, Michael Bentley <[EMAIL PROTECTED]> > wrote: > > > > > > > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > > If you just expand the length to five million* or so, one of those > > > strings will contain all

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > I'm pretty sure you could give a separate name to each atom ont he known > universe with a scheme like this. Do you really need 20-byte strings? > Steve, Based on the Wikipedia article's estimate of 10**79 atoms in the observable un

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:49 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > On Fri, 2007-04-13 at 10:22 -0500, Michael Bentley wrote: > > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > > If you just expand the length to five million* or so, one of those > > > strings will contain all the works of Shake

Re: Problem with algorithm

2007-04-13 Thread Carsten Haese
On Fri, 2007-04-13 at 10:22 -0500, Michael Bentley wrote: > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Not likely, even with a tiny sampling of the works of Sh

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 10:22 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Not likely, even with a tiny sampling of the works o

Re: Problem with algorithm

2007-04-13 Thread Michael Bentley
On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote: > If you just expand the length to five million* or so, one of those > strings will contain all the works of Shakespeare. Not likely, even with a tiny sampling of the works of Shakespeare: # :-) import string import random def main(bardText, ma

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 9:27 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > If you just expand the length to five million* or so, one of those > > strings will contain all the works of Shakespeare. > > Oops, you have this formula in math? > > Actually I want to scan a range of network for some certain files. Sorr

Re: Problem with algorithm

2007-04-13 Thread Jia Lu
> If you just expand the length to five million* or so, one of those > strings will contain all the works of Shakespeare. Oops, you have this formula in math? Actually I want to scan a range of network for some certain files. -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with algorithm

2007-04-13 Thread Paul McGuire
On Apr 13, 8:53 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jia Lu wrote: > >> for m in test: > >> for n in test: > >> for o in test: > >> for p in test: > >> print m+n+o+p > > > Thanx for your anwser. > > But if I consider about a combination of over 26 le

Re: Problem with algorithm

2007-04-13 Thread Steve Holden
Jia Lu wrote: >> for m in test: >> for n in test: >> for o in test: >> for p in test: >> print m+n+o+p > > Thanx for your anwser. > But if I consider about a combination of over 26 letter's list just > like: > "abcdefssdzxcvzxcvzcv" > "asllxcvxcbbedfgdfgdg"

Re: Problem with algorithm

2007-04-13 Thread azrael
sorry for the bad grammar. I didn't investigate the StackLess Python, but as I have been reading about it (so if it was correct), the recursionlimit should not be the problem using StackLess Python. >From my expirience with python and recursions, it works well to the depth of about 200 to 500 (depe

Re: Problem with algorithm

2007-04-13 Thread Michael Hoffman
azrael wrote: > I think that this would be very silly to do. bad kung foo. The > recoursion technique would be more satisfying. You sholud consider > that this would take about 4 lines to write. Also be avare of the > default recoursion depth in python wich is 1000. you can get and set > the recou

Re: Problem with algorithm

2007-04-13 Thread Paddy
On Apr 13, 8:16 am, "Jia Lu" <[EMAIL PROTECTED]> wrote: > > for m in test: > > for n in test: > > for o in test: > > for p in test: > > print m+n+o+p > > Thanx for your anwser. > But if I consider about a combination of over 26 letter's list just > like: > "a

Re: Problem with algorithm

2007-04-13 Thread azrael
I think that this would be very silly to do. bad kung foo. The recoursion technique would be more satisfying. You sholud consider that this would take about 4 lines to write. Also be avare of the default recoursion depth in python wich is 1000. you can get and set the recoursion limit hrough impor

Re: Problem with algorithm

2007-04-13 Thread Jia Lu
> for m in test: > for n in test: > for o in test: > for p in test: > print m+n+o+p Thanx for your anwser. But if I consider about a combination of over 26 letter's list just like: "abcdefssdzxcvzxcvzcv" "asllxcvxcbbedfgdfgdg" . Need I write 26 for loo

Re: Problem with algorithm

2007-04-12 Thread Charles Sanders
Paul Rubin wrote: [snip] > > def a(n): > if n==0: > yield '' > return > for c in s: > for r in a(n-1): > yield c+r > > print list(a(3)) Of course, obvious in retrospect, recursion instead of iteration. I have yet to comp

Re: Problem with algorithm

2007-04-12 Thread Paul Rubin
Charles Sanders <[EMAIL PROTECTED]> writes: > Forgive any silly mistakes I have made (I've been teaching > myself python for about 1 week) but there is a moderately > well known algorithm for this that extends to arbitrary > lengths of both the list of alternatives and the length > of the required

Re: Problem with algorithm

2007-04-12 Thread Charles Sanders
[EMAIL PROTECTED] wrote: > On Apr 12, 10:16�pm, "Jia Lu" <[EMAIL PROTECTED]> wrote: >> Hi all. >> �I want to create a large list like: >> >> ~ >> >> Is there any good algorithm to do this? > > Sure. > test = '01' > > for m in test: > for n in test: > for o in test: >

Re: Problem with algorithm

2007-04-12 Thread [EMAIL PROTECTED]
On Apr 12, 10:16�pm, "Jia Lu" <[EMAIL PROTECTED]> wrote: > Hi all. > �I want to create a large list like: > > ~ > > Is there any good algorithm to do this? Sure. test = '01' for m in test: for n in test: for o in test: for p in test: print m+n+o+p

Problem with algorithm

2007-04-12 Thread Jia Lu
Hi all. I want to create a large list like: ~ Is there any good algorithm to do this? Thanx Jia Lu -- http://mail.python.org/mailman/listinfo/python-list