Create all possible words using a set or lettersFinding all length-n words on an alphabet that have a specified number of each letterFinding all dictionary words that can be made with a given set of characters (Wordfeud/Scrabble)How to enumerate all possible binary associations?Sorting an Array with words in different languagesUsing StringCases and treating certain phrases as single wordsGraph showing valid English words obtained by insertion of single charactersTrim a list of elementsList all possible microstates and corresponding energy using mathematica.Selecting words having a specific number of letters from a textHow to generate letters for multiple people from a list of names

Parallel fifths in the orchestra

First Match - awk

Construct a word ladder

Compaq Portable vs IBM 5155 Portable PC

Can I summon an otherworldly creature with the Gate spell without knowing its true name?

How to politely tell someone they did not hit "reply to all" in an email?

How should I introduce map drawing to my players?

Why did the person in charge of a principality not just declare themself king?

How to patch glass cuts in a bicycle tire?

Is it possible to remotely hack the GPS system and disable GPS service worldwide?

Is the Indo-European language family made up?

Is Jon Snow the last of his House?

Did 20% of US soldiers in Vietnam use heroin, 95% of whom quit afterwards?

Make 24 using exactly three 3s

Count rotary dial pulses in a phone number (including letters)

Where have Brexit voters gone?

Specific alignment within beginalign environment

Using credit/debit card details vs swiping a card in a payment (credit card) terminal

Why does Mjolnir fall down in Age of Ultron but not in Endgame?

Why most published works in medical imaging try reducing false positives?

Do photons bend spacetime or not?

Do I need full recovery mode when I have multiple daily backup?

What was the idiom for something that we take without a doubt?

Can a British citizen living in France vote in both France and Britain in the European Elections?



Create all possible words using a set or letters


Finding all length-n words on an alphabet that have a specified number of each letterFinding all dictionary words that can be made with a given set of characters (Wordfeud/Scrabble)How to enumerate all possible binary associations?Sorting an Array with words in different languagesUsing StringCases and treating certain phrases as single wordsGraph showing valid English words obtained by insertion of single charactersTrim a list of elementsList all possible microstates and corresponding energy using mathematica.Selecting words having a specific number of letters from a textHow to generate letters for multiple people from a list of names













4












$begingroup$


Given a list of letters,



letters = "A", "B", ..., "F" 


is it possible to get Mathematica to generate all ‘words’ (in this example, 6 letter words), if only one letter can be used one time only, e.g. ABCDEF, ABCDFE, …? TIA.










share|improve this question











$endgroup$
















    4












    $begingroup$


    Given a list of letters,



    letters = "A", "B", ..., "F" 


    is it possible to get Mathematica to generate all ‘words’ (in this example, 6 letter words), if only one letter can be used one time only, e.g. ABCDEF, ABCDFE, …? TIA.










    share|improve this question











    $endgroup$














      4












      4








      4





      $begingroup$


      Given a list of letters,



      letters = "A", "B", ..., "F" 


      is it possible to get Mathematica to generate all ‘words’ (in this example, 6 letter words), if only one letter can be used one time only, e.g. ABCDEF, ABCDFE, …? TIA.










      share|improve this question











      $endgroup$




      Given a list of letters,



      letters = "A", "B", ..., "F" 


      is it possible to get Mathematica to generate all ‘words’ (in this example, 6 letter words), if only one letter can be used one time only, e.g. ABCDEF, ABCDFE, …? TIA.







      string-manipulation combinatorics






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 1:27









      J. M. is away

      99.2k10314472




      99.2k10314472










      asked Mar 24 at 0:54









      mf67mf67

      1246




      1246




















          3 Answers
          3






          active

          oldest

          votes


















          9












          $begingroup$

          Pemutations will do it:



          letters = "a", "b", "c";
          Permutations[letters, 3]
          "a", "b", "c", "a", "c", "b", "b", "a", "c",
          "b", "c", "a", "c", "a", "b", "c", "b", "a"


          To get all six-letter words:



          letters = "a", "b", "c", "d", "e", "f";
          perms = Permutations[letters, 6];
          StringJoin /@ perms

          {"abcdef", "abcdfe", "abcedf", "abcefd", "abcfde" ... etc.


          there are a lot of them.






          share|improve this answer











          $endgroup$




















            7












            $begingroup$

            You can create permutations with all of the letters as strings with:



            StringJoin /@ Permutations[letters]


            If you want lists of the individual letters just use:



            Permutations[letters]


            Check the documentation of Permutations to learn about permutations with subsets of letters. If you want to use each letter more than once, look at the documentation for Tuples.






            share|improve this answer









            $endgroup$












            • $begingroup$
              Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
              $endgroup$
              – mf67
              Mar 24 at 2:54


















            3












            $begingroup$

            If I follow the OP's question, I think they want the following:



            letters = "a", "b", "c";
            p = Permutations[letters, #] & /@ Range[Length[letters]];
            (StringJoin[#] & /@ #) & /@ p

            a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba





            share|improve this answer









            $endgroup$












            • $begingroup$
              No, the OP requested all six letter words.
              $endgroup$
              – m_goldberg
              Mar 24 at 11:22










            • $begingroup$
              Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
              $endgroup$
              – Doorknob
              Mar 24 at 22:48











            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "387"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193857%2fcreate-all-possible-words-using-a-set-or-letters%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            9












            $begingroup$

            Pemutations will do it:



            letters = "a", "b", "c";
            Permutations[letters, 3]
            "a", "b", "c", "a", "c", "b", "b", "a", "c",
            "b", "c", "a", "c", "a", "b", "c", "b", "a"


            To get all six-letter words:



            letters = "a", "b", "c", "d", "e", "f";
            perms = Permutations[letters, 6];
            StringJoin /@ perms

            {"abcdef", "abcdfe", "abcedf", "abcefd", "abcfde" ... etc.


            there are a lot of them.






            share|improve this answer











            $endgroup$

















              9












              $begingroup$

              Pemutations will do it:



              letters = "a", "b", "c";
              Permutations[letters, 3]
              "a", "b", "c", "a", "c", "b", "b", "a", "c",
              "b", "c", "a", "c", "a", "b", "c", "b", "a"


              To get all six-letter words:



              letters = "a", "b", "c", "d", "e", "f";
              perms = Permutations[letters, 6];
              StringJoin /@ perms

              {"abcdef", "abcdfe", "abcedf", "abcefd", "abcfde" ... etc.


              there are a lot of them.






              share|improve this answer











              $endgroup$















                9












                9








                9





                $begingroup$

                Pemutations will do it:



                letters = "a", "b", "c";
                Permutations[letters, 3]
                "a", "b", "c", "a", "c", "b", "b", "a", "c",
                "b", "c", "a", "c", "a", "b", "c", "b", "a"


                To get all six-letter words:



                letters = "a", "b", "c", "d", "e", "f";
                perms = Permutations[letters, 6];
                StringJoin /@ perms

                {"abcdef", "abcdfe", "abcedf", "abcefd", "abcfde" ... etc.


                there are a lot of them.






                share|improve this answer











                $endgroup$



                Pemutations will do it:



                letters = "a", "b", "c";
                Permutations[letters, 3]
                "a", "b", "c", "a", "c", "b", "b", "a", "c",
                "b", "c", "a", "c", "a", "b", "c", "b", "a"


                To get all six-letter words:



                letters = "a", "b", "c", "d", "e", "f";
                perms = Permutations[letters, 6];
                StringJoin /@ perms

                {"abcdef", "abcdfe", "abcedf", "abcefd", "abcfde" ... etc.


                there are a lot of them.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 24 at 13:36

























                answered Mar 24 at 1:13









                bill sbill s

                55.5k377159




                55.5k377159





















                    7












                    $begingroup$

                    You can create permutations with all of the letters as strings with:



                    StringJoin /@ Permutations[letters]


                    If you want lists of the individual letters just use:



                    Permutations[letters]


                    Check the documentation of Permutations to learn about permutations with subsets of letters. If you want to use each letter more than once, look at the documentation for Tuples.






                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                      $endgroup$
                      – mf67
                      Mar 24 at 2:54















                    7












                    $begingroup$

                    You can create permutations with all of the letters as strings with:



                    StringJoin /@ Permutations[letters]


                    If you want lists of the individual letters just use:



                    Permutations[letters]


                    Check the documentation of Permutations to learn about permutations with subsets of letters. If you want to use each letter more than once, look at the documentation for Tuples.






                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                      $endgroup$
                      – mf67
                      Mar 24 at 2:54













                    7












                    7








                    7





                    $begingroup$

                    You can create permutations with all of the letters as strings with:



                    StringJoin /@ Permutations[letters]


                    If you want lists of the individual letters just use:



                    Permutations[letters]


                    Check the documentation of Permutations to learn about permutations with subsets of letters. If you want to use each letter more than once, look at the documentation for Tuples.






                    share|improve this answer









                    $endgroup$



                    You can create permutations with all of the letters as strings with:



                    StringJoin /@ Permutations[letters]


                    If you want lists of the individual letters just use:



                    Permutations[letters]


                    Check the documentation of Permutations to learn about permutations with subsets of letters. If you want to use each letter more than once, look at the documentation for Tuples.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 24 at 1:15









                    LeeLee

                    50027




                    50027











                    • $begingroup$
                      Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                      $endgroup$
                      – mf67
                      Mar 24 at 2:54
















                    • $begingroup$
                      Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                      $endgroup$
                      – mf67
                      Mar 24 at 2:54















                    $begingroup$
                    Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                    $endgroup$
                    – mf67
                    Mar 24 at 2:54




                    $begingroup$
                    Thanks(x2). Is there some way to check how many words contain a ‘sub-word’, like ‘ab’ or even a set of ‘sub-words’ like ‘ab’ and ‘cd’? And is there any web page or text book that deals with combinatorics in Mathematica (on a more ‘basic’ level) that I could visit/buy and read?
                    $endgroup$
                    – mf67
                    Mar 24 at 2:54











                    3












                    $begingroup$

                    If I follow the OP's question, I think they want the following:



                    letters = "a", "b", "c";
                    p = Permutations[letters, #] & /@ Range[Length[letters]];
                    (StringJoin[#] & /@ #) & /@ p

                    a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba





                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      No, the OP requested all six letter words.
                      $endgroup$
                      – m_goldberg
                      Mar 24 at 11:22










                    • $begingroup$
                      Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                      $endgroup$
                      – Doorknob
                      Mar 24 at 22:48















                    3












                    $begingroup$

                    If I follow the OP's question, I think they want the following:



                    letters = "a", "b", "c";
                    p = Permutations[letters, #] & /@ Range[Length[letters]];
                    (StringJoin[#] & /@ #) & /@ p

                    a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba





                    share|improve this answer









                    $endgroup$












                    • $begingroup$
                      No, the OP requested all six letter words.
                      $endgroup$
                      – m_goldberg
                      Mar 24 at 11:22










                    • $begingroup$
                      Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                      $endgroup$
                      – Doorknob
                      Mar 24 at 22:48













                    3












                    3








                    3





                    $begingroup$

                    If I follow the OP's question, I think they want the following:



                    letters = "a", "b", "c";
                    p = Permutations[letters, #] & /@ Range[Length[letters]];
                    (StringJoin[#] & /@ #) & /@ p

                    a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba





                    share|improve this answer









                    $endgroup$



                    If I follow the OP's question, I think they want the following:



                    letters = "a", "b", "c";
                    p = Permutations[letters, #] & /@ Range[Length[letters]];
                    (StringJoin[#] & /@ #) & /@ p

                    a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 24 at 2:51









                    JagraJagra

                    7,96812160




                    7,96812160











                    • $begingroup$
                      No, the OP requested all six letter words.
                      $endgroup$
                      – m_goldberg
                      Mar 24 at 11:22










                    • $begingroup$
                      Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                      $endgroup$
                      – Doorknob
                      Mar 24 at 22:48
















                    • $begingroup$
                      No, the OP requested all six letter words.
                      $endgroup$
                      – m_goldberg
                      Mar 24 at 11:22










                    • $begingroup$
                      Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                      $endgroup$
                      – Doorknob
                      Mar 24 at 22:48















                    $begingroup$
                    No, the OP requested all six letter words.
                    $endgroup$
                    – m_goldberg
                    Mar 24 at 11:22




                    $begingroup$
                    No, the OP requested all six letter words.
                    $endgroup$
                    – m_goldberg
                    Mar 24 at 11:22












                    $begingroup$
                    Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                    $endgroup$
                    – Doorknob
                    Mar 24 at 22:48




                    $begingroup$
                    Your last line can be written more cleanly as Map@StringJoin/@p or Map[StringJoin, p, 2].
                    $endgroup$
                    – Doorknob
                    Mar 24 at 22:48

















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Mathematica Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193857%2fcreate-all-possible-words-using-a-set-or-letters%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript