Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
XP is just a number
 
PerlMonks  

Re: creating all possible random 'words' from 4 letters

by Elgon (Curate)
on Nov 07, 2003 at 09:22 UTC ( [id://305301]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to creating all possible random 'words' from 4 letters

Anonymonk,

I suggest you use the "Search" function at the top left with the keywords "permutations" or "combinations" as this will turn up lots of code to give you a head start. Broadly speaking you want to assign each letter to an index in an array and jumble them up in all possible ways, which is a standard algorithm.

If you want the maximum number of combinations of four prechosen letters where each letter is only used once, I think that there are 24 combinations btw (4!) and if any letter may be used more than once, there are something like 456,976 combinations (26^4)

Elgon

UPDATE: Thanks to pinetree for the link to the maths faq. In the above node, I am talking about permutations and NOT combinations. You live and learn.

Please, if this node offends you, re-read it. Think for a bit. I am almost certainly not trying to offend you. Remember - Please never take anything I do or say seriously.

  • Comment on Re: creating all possible random 'words' from 4 letters

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://305301]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.