Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Circular lists - 26 letters
January 12, 2009, 8:35 pm
rate this thread
Re: Circular lists - 26 letters
Which alphabet? There are 26 letters in the English alphabet. You can
get an alphabet consisting of 25 letters by eliminating one letter from
the English alphabet. There are 26 ways to do that. You can eliminate 2
letters to get a 24-letter alphabet; there are 26*25 ways to do that.
Given N distinct letters, there are N! permutations formed by selecting
N letters from the set in order. N! = N * (N-1) * (N-2) * ... * 3 * 2 *
1 (but you knew that).
Given N distinct letters, there are N!/(N-M)! different ways to select
M letters in order from N distinct letters (M < N).
Every word in the English language that does not have repeated letters,
and then some! What is your definition of a "word".
Not if you generate the permutations one-at-a-time. See, for example,
'perldoc -q permute'
Not much (see above).
A very long time. Enough time to generate
26! + 26! + (26!/2!) + (26!/3!) + (26!/4!) + . . . + (26*25) + 26 + 1
permutations ( or thereabouts -- my math might be off a little). Since
26! is 4.0329E26, you will need about 10**13 years assuming you can
generate and process 1,000,000 permutations per second.
- » FAQ 3.19 How can I make my CGI script more efficient?
- — Previous thread in » PERL Discussions