We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

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

Options
TryingToWork
TryingToWork Posts: 97 Forumite
Part of the Furniture 10 Posts Name Dropper Combo Breaker
edited 31 May 2024 at 7:32PM in Techie Stuff
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
«13

Comments

  • So if I understood correctly, you only need to move four sections around. Which is something called factorial or 4!. There are 24 combinations of this. Unfortunately I don't know a formula for finding exactly what they are, but if you are doing it manually, there are only 24. 
  • TryingToWork
    TryingToWork Posts: 97 Forumite
    Part of the Furniture 10 Posts Name Dropper Combo Breaker
    edited 13 February 2024 at 3:20PM
    Superhoopza said:
    So if I understood correctly, you only need to move four sections around. Which is something called factorial or 4!. There are 24 combinations of this. Unfortunately I don't know a formula for finding exactly what they are, but if you are doing it manually, there are only 24. 
    Sorry I can't have explained it right. I got up to past 50 combinations before I realised there were hundreds.



    Using the example in the pic, I need to be able to swap the s with the g, (and put them back how they were), then swap the s with each of all the other letters in the other sections [Right, Top and Bottom]

    That alone would give a minumum of 108 combinations (9 x 12... the number in the 3 remaining sections x the total number).

    Then once I have done that with the S I need to do the same again with every other letter. 

    And it's possible I might need to multiply the above by 12 again... or even by 144! (or more  :#:o:'(

    (It was at this stage my brain fried! ...and why I need help working it out!)


    If the sections part is too complicated, how do I find out how to jumble up all 12 letters into all possible combinations? 

    Oh god... I think it is 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12 x 12

    or something like that?!  :'(:'(:'(:'(

    My calculator couldn't cope either so I asked Google... still none the wiser! Don't know what the answer means: 


    I estimated it to be hundreds, but it could be millions.


     I still need to know how to do it, because I have to input all the combinations into those boxes... Ha!



    Or is it just 144?

    or 144 x 144 = 20736

    Or 20736 / 12 = 1728 ? !!

    I think that might be it... The last one I said!

    Can anyone confirm if I'm close?

    Thank you




  • Alright, I'll ask.

    Why?
  • Alright, I'll ask.

    Why?

    I make puzzles. I don't make money from them, but I hope to release a free app of them soon. 

    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. 

    See my previous thread here: 
    https://forums.moneysavingexpert.com/discussion/6503223/how-to-build-my-puzzles-in-an-app
  • HappyHarry
    HappyHarry Posts: 1,801 Forumite
    Tenth Anniversary 1,000 Posts Name Dropper
    Do you mean that each letter can go in any one of 12 places? 

    If so, then the first letter can go in any of 12 places, then the second letter could go in any of the remaining 11 places, then the third letter could go in any of the remaining 10 places and so on.

    =12x11x….x3x2x1 = 479,001,600
    I am an Independent Financial Adviser. Any comments I make here are intended for information / discussion only. Nothing I post here should be construed as advice. If you are looking for individual financial advice, please contact a local Independent Financial Adviser.
  • MeteredOut
    MeteredOut Posts: 3,037 Forumite
    1,000 Posts Second Anniversary Name Dropper
    edited 13 February 2024 at 4:15PM
    Do you mean that each letter can go in any one of 12 places? 

    If so, then the first letter can go in any of 12 places, then the second letter could go in any of the remaining 11 places, then the third letter could go in any of the remaining 10 places and so on.

    =12x11x….x3x2x1 = 479,001,600
    If I'm reading things right, the letters in each of the 4 grouping cannot be interchanged with each other, only with each of the letters in the other 3 groupings (9 others in total).

    Does that make it 10! * 3 = 10,886,400?


  • HappyHarry
    HappyHarry Posts: 1,801 Forumite
    Tenth Anniversary 1,000 Posts Name Dropper
    Do you mean that each letter can go in any one of 12 places? 

    If so, then the first letter can go in any of 12 places, then the second letter could go in any of the remaining 11 places, then the third letter could go in any of the remaining 10 places and so on.

    =12x11x….x3x2x1 = 479,001,600
    If I'm reading things right, the letters in each of the 4 grouping cannot be interchanged with each other, only with each of the letters in the other 3 groupings (9 others in total).

    Does that make it 10! * 3 = 10,886,400


    Ok - reading again the order of each letter in each of  the four sets is immaterial.

    So each set has 6 possible combinations which are permitted.

    There are four sets.

    We know that there are a total of 12! combinations of all letters.

    Divide that by the six combinations available in the top set, and the six combinations available in the left set and so on.

    So this would give 12!/(6^4) = 369,600
    I am an Independent Financial Adviser. Any comments I make here are intended for information / discussion only. Nothing I post here should be construed as advice. If you are looking for individual financial advice, please contact a local Independent Financial Adviser.
  • MeteredOut
    MeteredOut Posts: 3,037 Forumite
    1,000 Posts Second Anniversary Name Dropper
    edited 13 February 2024 at 6:55PM
    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.
  • 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


  • TryingToWork
    TryingToWork Posts: 97 Forumite
    Part of the Furniture 10 Posts Name Dropper Combo Breaker
    edited 13 February 2024 at 10:53PM
    I could not sign in to ChatGPT. I even tried registering again under a new email and then my Google account. All three failed so the site is having a breakdown of sorts!

    So I tried Google Gemini (formerly Google Bard AI) and I said this:

    "Please make a list of all the possible order combinations of the following 12 letters: 
    INSDTGUHABEM "


    Google Gemini's answer:

    Unfortunately, I cannot generate the complete list of order combinations for 12 letters as it would be incredibly vast. There are 12! (factorial of 12) possible arrangements, which equals approximately 479,001,600 permutations. Generating and storing such a massive list would be impractical and unnecessary for most purposes.

    However, depending on your specific needs, I can offer alternative solutions:

    1. Smaller Number of Letters: If you only need combinations of a few letters from 
    etc...

    then a long list of other stuff

    So I managed to break two AIs, and I never even logged in with one! LOL


    "...unnecessary for most purposes..."

    Cheek!.. Most purposes, yes, but not ALL purposes!
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
  • 350.8K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.8K Work, Benefits & Business
  • 598.7K Mortgages, Homes & Bills
  • 176.8K Life & Family
  • 257.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only 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.