Can't work out the forumula for this (SOLVED)

13»

Comments

  • MeteredOut
    MeteredOut Posts: 2,794 Forumite
    1,000 Posts Second Anniversary Name Dropper
    edited 31 October 2024 at 1:25PM
    Hi, please can someone tell me the formula for working out how to get every possible combination* of all the following 12 letters?

    * (They don't need to be swapped within their own section. The order within each section does not matter. So in the LEFT section S does not need to be swapped with i, for example. Only need them swapped from different sections).



    I started doing it manually (by swapping two letters from each section to another section, and putting them back, and swapping two more) but then I realised there are a LOT more combinations that I thought. I now realise there could be hundreds!

    But how do I find out all of them?

    I'm not mathematically minded at all. Got a D in Maths GCSE.

    Thanks a lot
    I asked my AI to provide a solution for you and it came up with this ...hope it helps.

    Do you think that solution helps?
    What I would do, is have a go myself. The difficulty is having somebody with relevant experience check it for me. It would be quite embarassing to publish especially if associated with a prize. The machine is simply a tool that is validating its own answer. The final decision to publish is whether you are able to trust the answer. On the issue of GCSE D math, its about the norm but there should be enough skill in oneself to let the machine help develop or improve skills. Perplexity alway provides links from where it scraped the data so check them out.

    I've read that 3 times, and I'm still not clear if it was written by AI or some under the influence of some narcotic.

    For anyone with any basic comprehension skills, Its's clear the AI you referred to did not even understand the question, never-mind getting anywhere close to providing something that would help progress with a solution. 

    I question why you post a link to something that clearly does not help in any way and added "hope it helps". 

    You've posted a few links to that AI today - are you connected to it in some way? Based on this one example here, it seems well behind ChatGPT.
  • [Deleted User]
    [Deleted User] Posts: 0 Newbie
    Part of the Furniture 100 Posts Name Dropper Photogenic
    edited 31 October 2024 at 1:25PM
    Hi, please can someone tell me the formula for working out how to get every possible combination* of all the following 12 letters?

    * (They don't need to be swapped within their own section. The order within each section does not matter. So in the LEFT section S does not need to be swapped with i, for example. Only need them swapped from different sections).



    I started doing it manually (by swapping two letters from each section to another section, and putting them back, and swapping two more) but then I realised there are a LOT more combinations that I thought. I now realise there could be hundreds!

    But how do I find out all of them?

    I'm not mathematically minded at all. Got a D in Maths GCSE.

    Thanks a lot
    I asked my AI to provide a solution for you and it came up with this ...hope it helps.

    Do you think that solution helps?
    What I would do, is have a go myself. The difficulty is having somebody with relevant experience check it for me. It would be quite embarassing to publish especially if associated with a prize. The machine is simply a tool that is validating its own answer. The final decision to publish is whether you are able to trust the answer. On the issue of GCSE D math, its about the norm but there should be enough skill in oneself to let the machine help develop or improve skills. Perplexity alway provides links from where it scraped the data so check them out.

    I've read that 3 times, and I'm still not clear if it was written by AI or some under the influence of some narcotic.

    For anyone with any basic comprehension skills, Its's clear the AI you referred to did not even understand the question, never-mind getting anywhere close to providing something that would help progress with a solution. 

    I question why you post a link to something that clearly does not help in any way and added "hope it helps". 

    You've posted a few links to that AI today - are you connected to it in some way? Based on this one example here, it seems well behind ChatGPT.

    You could ask the machine to explain points that you find challenging. One thing that greatly assists code is if it has comments so I asked the machine to comment the code and then ran it as an Excel 16 macro. It produced the following output. I use Windows Copilot to double check Perplexity and vica-versa. Copilot does not allow its output to be shared in the manner that Perplexity does.

    01. ABCDEFGHIJKLMNOP
    02. ABCDEFGHMNOPIJKL
    03. ABCDIJKLEFGHMNOP
    04. ABCDIJKLMNOPEFGH
    05. ABCDMNOPEFGHIJKL
    06. ABCDMNOPIJKLEFGH
    07. EFGHABCDIJKLMNOP
    08. EFGHABCDMNOPIJKL
    09. EFGHIJKLABCDMNOP
    10. EFGHIJKLMNOPABCD
    11. EFGHMNOPABCDIJKL
    12. EFGHMNOPIJKLABCD
    13. IJKLABCDEFGHMNOP
    14. IJKLABCDMNOPEFGH
    15. IJKLEFGHABCDMNOP
    16. IJKLEFGHMNOPABCD
    17. IJKLMNOPABCDEFGH
    18. IJKLMNOPEFGHABCD
    19. MNOPABCDEFGHIJKL
    20. MNOPABCDIJKLEFGH
    21. MNOPEFGHABCDIJKL
    22. MNOPEFGHIJKLABCD
    23. MNOPIJKLABCDEFGH
    24. MNOPIJKLEFGHABCD
  • MeteredOut
    MeteredOut Posts: 2,794 Forumite
    1,000 Posts Second Anniversary Name Dropper
    That solution above still does not come anywhere close to solving the OP's challenge. It shows a complete lack of understanding of the question.

    As an AI engine, that is a huge failure.
  • TryingToWork As to your question - you can get a formula to give you the number of permutations, but you won't get a formula to give you those permutations.

    For that, you'll need to drop into code, probably using recursion. ChatGPT could probably give you a head start.
    Hi @MeteredOut and @HappyHarry

    Thank you both. I appreciate your help.

    Yes I think I need code. But how do I word it to tell Chat GPT to do what you said?

    Thanks a lot


    Google Gemini is more language orientated and not very good at coding. All the Perplexity stuff posted is not subscription Pro stuff where clarifying questions are asked of the user. Anyway, as I previously said I use Copilot to double check Perpexity output. So I asked it if it understood the OP posting. This is what it said:

    [1]: https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this ""
    [2]: https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this/p2 ""

    Yes, I understand. The original poster (OP) on the forum is trying to find a formula or method to generate all possible combinations of a set of 12 letters¹[1]. They specify that the order within each section does not matter and the letters do not need to be swapped within their own section¹[1].

    However, in a later post, the OP clarified that if the sections made the whole thing too complicated, they were willing to settle for mixing up all 12 letters without the sections²[2].

    A user on the forum provided a solution in both JavaScript and Python for generating all permutations of a given string²[2]. However, this solution generates all permutations of the string, not just the combinations, and it doesn't take into account the OP's original requirement about sections²[2].

    The OP seems to be trying to solve a puzzle similar to the New York Times' Letterboxed game, but in a hexagonal version²[2]. They are looking for a way to generate solution words for the puzzle²[2].

    Please note that generating all combinations or permutations of a set of 12 letters can result in a very large number of results, which may be impractical to compute or display²[2].

    Source: Conversation with Bing, 29/04/2024
    (1) Can't work out the forumula for this - MoneySavingExpert Forum. https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this.
    (2) Can't work out the forumula for this - MoneySavingExpert Forum. https://forums.moneysavingexpert.com/discussion/6505595/cant-work-out-the-forumula-for-this/p2.

    Next I asked it to code a solution:

    Sure, I can provide a simple VBA solution to generate all possible combinations of a set of 12 letters. This solution doesn't take into account the sections mentioned by the OP in the forum post, but it should give you a good starting point.

    Here's a simple VBA function that generates all combinations of a given string:

    ```vba
    Sub GenerateCombinations()
        Dim letters As String
        Dim i As Long
        Dim j As Long
        
        ' Define the set of 12 letters
        letters = "ABCDEFGHIJKL"
        
        ' Loop through each character in the string
        For i = 1 To Len(letters)
            ' Generate all combinations starting with the i-th character
            For j = i To Len(letters)
                Debug.Print Mid(letters, i, j - i + 1)
            Next j
        Next i
    End Sub
    ```

    This code defines a string `letters` containing 12 characters. It then loops through each character in the string, and for each character, it generates all combinations of characters starting with that character. The combinations are printed to the Immediate window in the VBA editor.

    Please note that this code generates combinations, not permutations, and it doesn't take into account the sections mentioned by the OP in the forum post. If you need to generate permutations or take into account the sections, the code would be more complex. Also, generating all combinations of a set of 12 letters can result in a very large number of results, which may be impractical to compute or display.

    You can run this code in the VBA editor in any Microsoft Office application, such as Excel or Word. To open the VBA editor, press `Alt + F11`. To run the code, press `F5` while the cursor is inside the `GenerateCombinations` subroutine. To view the output, open the Immediate window by pressing `Ctrl + G`.

    I hope this helps! Let me know if you have any other questions.

    The code produced the following output but not sure if this is what you want. It ran out of steam in the end:

    A
    AB
    ABC
    ABCD
    ABCDE
    ABCDEF
    ABCDEFG
    ABCDEFGH
    ABCDEFGHI
    ABCDEFGHIJ
    ABCDEFGHIJK
    ABCDEFGHIJKL
    B
    BC
    BCD
    BCDE
    BCDEF
    BCDEFG
    BCDEFGH
    BCDEFGHI
    BCDEFGHIJ
    BCDEFGHIJK
    BCDEFGHIJKL
    C
    CD
    CDE
    CDEF
    CDEFG
    CDEFGH
    CDEFGHI
    CDEFGHIJ
    CDEFGHIJK
    CDEFGHIJKL
    D
    DE
    DEF
    DEFG
    DEFGH
    DEFGHI
    DEFGHIJ
    DEFGHIJK
    DEFGHIJKL
    E
    EF
    EFG
    EFGH
    EFGHI
    EFGHIJ
    EFGHIJK
    EFGHIJKL
    F
    FG
    FGH
    FGHI
    FGHIJ
    FGHIJK
    FGHIJKL
    G
    GH
    GHI
    GHIJ
    GHIJK
    GHIJKL
    H
    HI
    HIJ
    HIJK
    HIJKL
    I
    IJ
    IJK
    IJKL
    J
    JK
    JKL
    K
    KL
    L

  • bob2302
    bob2302 Posts: 526 Forumite
    500 Posts Second Anniversary Name Dropper
    edited 30 April 2024 at 5:41PM
    I make it  12!(4!)^(-4) = 1444

    I looked at it this afternoon and was put off by the constraint that you can't swap letters within a group, but it doesn't actually make much difference; you just get 12 instead of 15.

    I'm assuming that it was intended that all letters be swapped out of their original group. If you want to count all configurations that can be reached through any number of pair exchanges between the groups that is, I think:

    16!(4!)^(-4) = 63,063,000
  • bob2302 said:
    I make it  12!(3!)^(-4) = 369,600

    I looked at it this afternoon and was put off by the constraint that you can't swap letters within a group, but it doesn't actually make much difference; you just get 12 instead of 15.

    I'm assuming that it was intended that all letters be swapped out of their original group. If you want to count all configurations that can be reached through any number of pair exchanges between the groups that is, I think:

    16!(3!)^(-4) = 16,144,128,000
    The OP has not helped his or herself by failing to write a requirement with examples to allow collaborative understanding. All that was given was a specification. The OP kept how the very large dataset was to be used, hidden. Can a requirement be posted to better understand the things?

  • MeteredOut
    MeteredOut Posts: 2,794 Forumite
    1,000 Posts Second Anniversary Name Dropper
    OP has not logged in for 3 weeks. Unlikely.
  • Username03725
    Username03725 Posts: 515 Forumite
    Fourth Anniversary 500 Posts Name Dropper
    edited 2 May 2024 at 12:29PM

    I work them out the slow way currently, but because I am building an app of the puzzles and the app learning is time consuming, I need a script to help me with the word combinations. 

    Try coming from a different angle. There are plenty of word lists available as plain text files on the net, so it might be easier to download one and then either import it into your app and maybe use some regex etc on it or load it into a background database where you can query it to get to where you want to be, assuming that is what you want to do. The options are there; trying to calculate every permutation may not be the best answer.

    As a side note, Wordle uses a list of 5 letter words for each day's puzzle, but be wary if you use it as it goes in sequence so once you know where yesterday's word is it's trivial to find today's [and ongoing]. It also uses another list of acceptable 5 letter words to match against each guess, so if you're limiting puzzles to 5 letters you could borrow that.
  • TryingToWork
    TryingToWork Posts: 97 Forumite
    Part of the Furniture 10 Posts Name Dropper Combo Breaker
    edited 31 May 2024 at 7:45PM
    I have stated this as SOLVED, as I no longer need reponses. But in reality I gave up trying, as I found it was impossible, as stated on page 2. Apologies to the kind people who continued responding. I don't get emails from this forum for some reason, even though I subscribe to my own posts. I now create different puzzles, so this is not needed. Thank you to all who helped. 
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 349.9K Banking & Borrowing
  • 252.6K Reduce Debt & Boost Income
  • 453K Spending & Discounts
  • 242.8K Work, Benefits & Business
  • 619.6K Mortgages, Homes & Bills
  • 176.4K Life & Family
  • 255.7K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 15.1K Coronavirus Support Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.